AI Behaviours - UQdeco2800/2022-studio-3 GitHub Wiki
Introduction
In Sprint 2, Team 4 hoped to have a fully functional movement AI complete, however, as we were doing research and started implementation we realised that this was more complicated than we expected and a fully fledged AI movement system was not feasible in Sprint 2, for now we have simple AI that moves to a target (city centre) with directional animations and starts attack animations when hitting a player. As such we've made this to document how we intend the AI to be implemented in future sprints.
Path Finding vs. Steering
Initially we went for the intuitive choice of using path finding, essentially providing a predefined paths for the enemy to follow however we came across some problems with that idea, we realised that globally predefined paths would be too rigid, make the AI predictable and not allow for it to have a more organic and "sinister" behaviour, instead we decided to go for steering AI, which is a way to approach movement AI in a cybernetic manner, where the start and end goal are constant and known but the real computation happens in how you dynamically steer the AI so that it eventually reaches its path.
This has a number of advantages over pure path finding:
- Reduces performance overhead as things like object avoidance reconfiguring paths can be done when needed and for a specific zone rather than predetermined for the whole map.
- Gives us the ability to make each enemy units behaviour unique and challenging, for example light and fast units would prefer to avoid walls and only attack soldiers, whereas big heavy units would attacks walls, buildings and players.
Additional Notes
- Steering AI has its theoretical foundations in control theory and cybernetics, in case your interested in doing further study in that