Grid-based Game Map Editor
- Tech Stack: Processing 3 (Java)
- Demo URL: Link
We (a group of 4) joined the Ludum Dare 44 game jam but only 2 of the group (excluding me) were the main devs. The game was a grid-based dungeon crawler.
As a follow-up, I implemented a map editor for the game in Processing using the OOP principles I learnt in first year. The editor allows painting tiles (e.g. floor, wall, void) to create a level. The maps can then be exported and loaded in the main game.
Since the map is a large grid, I explored efficient data structures to do chunk loading, as inspired by Minecraft. This utilises hash maps that create new 4x4 chunks of empty tiles for efficient storage and look-up. As a result, the program does not lag much until the user creates about 200 chunks (800 tiles) in one axis. Considering the other axis as well would mean about 1,000 chunks (4,000 tiles) are created.
The map editor enforces logic on the tiles. For example, the user cannot put more than 1 player in the map, or enemies cannot be put on walls. It also has a terminal that logs the user's action (e.g. placing a tile) and warnings.
All of these Qt-widget-like components (e.g. slider on the terminal, text boxes with the blinking character animation) were created from scratch.