7 Day Roguelike 2024: Title, Pathfinding, UI
I had a productive evening working on Electric Organ. Firstly I implemented an animated main menu. I’m spending a lot of time up front working on aesthetics as I find that if the game is pretty I’m more motivated to work on it later in the week. Hopefully there’s enough time to implement all the mechanics I have planned.
See the animation along with the music on youtube.
I also got pathfinding working. This was interesting as I have several different types of NPC with different movement rules. Currently there are 3:
- zombies can only move into open spaces
- climbers can move over debris
- trespassers can open doors
To help with pathfinding I compute what I call “distance maps” (sometimes called “Dijkstra maps” elsewhere - read more in this post) which NPCs can use to quickly determine the distance from each location to the player. But now that different NPCs have different movement rules, the effective distance to the player may differ between NPCs. For example if the player is on the other side of a door, NPCs that can open doors will find the player much closer than NPCs that can’t. This means I need to maintain multiple distance maps for the different combination of movement rules that NPCs can have.
I also spent some time improving basic quality of life features like adding a message log and descriptions of tiles. This also carves out some space for the game’s UI which I’ll be adding to over the next few days as I implement the player’s stats and the combat system.