This weekend, I added weapons, monsters only move when you move, and I added flags to tell if items were identified, cursed, wielded or worn. Each flag multiplies the complexity of the code by at least three times, but it is flags like these that are central to the Roguelike experience. How many flags I choose to implement has a direct correlation to how the game plays… and whether I can finish it at all.
7DRL
7DRL: Building an Engine — YAML
If someone were to quiz me on how a game engine is different from a game, I’d think about it a bit, and then probably explain that a game is run by the game engine, but no part of the game is actually in the game engine. I’m enforcing that by moving the game (as opposed to the game engine) into YAML, which stands for YAML ain’t markup language. The game is data. The game engine runs that data.
7DRL: Building an Engine — Line of Sight
NPCs don’t want to hit their allies while they are attacking you with ranged attacks. Some objects in the room can block them as well — and using the objects in the room to deal with larger swarms of enemies will be an important strategy in the actual game. Today we go over the line of sight algorithm.
7DRL: Building an Engine — Path Finding
Path finding is central to all rogue-likes. If an enemy can’t find you, they can’t fight you… and that wouldn’t be any fun. Tonight, I go over Dijkstra’s famous pathfinding algorithm, the differences between that and A*, and how I implemented them in the engine.
7DRL: Building an Engine — Refactoring
I didn’t make a lot of visible progress today, but I decided it was time to take a step back and do a vital step in any programming project — refactoring.