I spent a few days prototyping a turn-based tactical RPG, a genre I’ve grown to love. X-COM: Terror from the Deep hooked me when I was a kid, and I’ve been looking for similar games ever since. It’s great to see the genre making a comeback with titles like The Banner Saga and X-COM: Enemy Unknown.
Like any proper tactical game, players choose their actions turn-by-turn, moving, attacking, or guarding. During the computer’s turn, it identifies the nearest player character and moves in to attack. The battle ends when either side is defeated.
The prototype has a functioning turn-based combat system on an auto-generated grid.
Grid-based is the tried-and-true approach, so that’s where I started. I blocked out a level in Blender using a placeholder tile set. Then I populate a node grid for visualization and pathfinding, it calculates the level bounds, divides the area into nodes, and initializes all nodes high above the level. For each node, it raycasts downward, the first surface it hits determines where the node is placed.
A visualization of raycasting downwards per grid cell and placing nodes.
These nodes serve as the foundation for the rest of the game logic. They enable A* pathfinding to create paths between the nodes, and allow the game to check whether a character can attack by inspecting surrounding nodes.
If I find some time next week, I’d love to create some graphics and add more features. For now, it’s just a prototype.