I have been away from blogging and making games for almost a year now. I had a lot of things going on at the same time since my education in game design and programming. But I have kept contact with some class mates and a few months ago (January 2017) I was inspired by Force Arena, a fast paced mmo rts – game (Massively Multiplayer Online Real Time Strategy). You play a hero who can move, attack and strategically place cards that will spawn AI-agents that will attack your enemy’s base.
This blog is about what I started doing after having played this game. I have finally done a functional A* search algorithm from scratch using only C++. SFML is used to graphically represent the path generated and to represent the simple agent who uses the A* and walks the path. What I’ve got now is a 20X20 grid containing nodes. Some of the tiles in the grid are walls and not walkable by the agent (black tiles).
The white tiles are walkable. (pic above)
When one of the tiles are clicked, the pathfinding begins and the agent (blue square) starts walking toward the goal (green tile in pic below). The cyan nodes will turn yellow, red, or blue. Yellow means it is in the open list, the red nodes are in the closed list and the blue nodes represent the actual path.
Now that this is done, a functional A* path finding algorithm, I want to start to give the agent some behavior, and also create new agents. For the first iteration I want two teams, both walking toward the other team’s base. That’s it. I will increase complexity every time I finish a task.
I am going to use a Behavior Tree as opposed to Finite State Machine because first of all I want to have made one. I know there are very useful tools around such as Unreal Engine 4’s Blackboard which is a visual BT, but nope, I am doing this for myself. The other reason is that BTs provide a better overview over the decisions than a state machine – making transitions of agent states easier to author. So I’ve heard. More of a dynamic feel to it than FSMs.
So what do I want to have in this BT? I skip all the formal names of all the nodes and what not for now because I am at research stage as of now, so I will just type it down. I want the agents to see if their enemy’s base is on a walkable tile. If it is, start the pathfinding algorithm and walk there. When they arrive they will make a note of it. I don’t know, a bool? A message to somewhere? don’t know yet. That’s it for today! I’ll return for an update on my first BT!
BTW, If you want to ask something, go ahead!
Peace out! (peas out, pees out)