Previously, the AI would be using a very hacky finite-state machine to determine what action to do in response to the current target. This was fine to begin with, but in the long run it’s very ineffective.
I have changed the AI to use a mix of finite-state machines (FSM) and goal oriented action planning (GOAP). GOAP gives the entity certain actions and goals it can perform with costs, and the AI will see if it can perform it.
Each AI has a hidden “action point” counter that regenerates over time, and it can spend them on various actions, such as a standard attack, a roll, or a strong attack. The better the action, the higher the amount of points required. A harder AI to fight will get action points quicker than more common ones.
However, the AI isn’t perfect just yet, and still needs lots of refinement! I am wanting to add in an ability that lets me specify how much the AI favours a certain move over the other. So you might have a very evasive ninja who likes to roll, or a tough knight who always blocks your attacks. It will allow me to give lots of variety to your opponents and make them a fun fight overall.
Let me know your thoughts on the progress so far!
6 comments