← All works

AI for RTS games

2019-08-23

Introduction & Topics

In this  project, I built a full-stack AI for an playable RTS game. The AI system includes but not limited to the following aspect:

A Hierarchical Finite State Machine(HFSM) for the AI to determine its overall tactics and strategies.

Behavior tree for each individual AI(Both human & computer) to control their behaviors

Sample behavior tree of warrior:

61CF4D9F-7D5A-4051-9613-449A1AFBA432.png

A* with tactical heuristics and object avoidance(the choice of using teleport or not) for every AI to reach their set destination

Formation system using anchor point for the agents to form designated formation

A complex enough system, which includes a completely functional player interaction system, relatively large enough map, and different AI teams, for the AI to interact with.

Significantly Polished art assets and in-game interaction

System

The system we created is we have two different AI systems. For the main AI system, which we design it to make major decisions like when to build and develop, when to fight or retreat and what kinds of units should be produced. This system use the HFSM with three layers to achieve the goal. Then we have different individual

agent with different behavior tree for different kinds of agents. It would determine the behaviors, for example, the farmer of the game would determine when they should mine and when they should’ve sent the gold to the base. The individual agent would also use a* and formation when they march to different location under the main AI’s command.