As I’m finding out, AI can be pretty difficult to do, but isn’t too terrible if you understand the principles and work in a modular fashion. I’m completely in the dark and have started working on AI just this week, been reading about ideas on how to approach it and I’d like to start a discussion about the specific direction I’m heading.
Figured there would be at least a couple of dev’s here with some experience with it. From what I gather, this may be hard for with what im working on because it is a 3d physics based flight game and I need active, flying, physics based AI… but I think it could be simplified enough to work without waypoints, navmeshes or constant pathfinding. I’m incapable of coding so I’ve been wiring everything up in PlayMaker, as all of my systems are also wired up.
Sources:
Steering Behaviors For Autonomous Characters
http://red3d.com/cwr/steer/
AI FSM Summary/Tutorial
http://research.ncl.ac.uk/game/mastersdegree/gametechnologies/aifinitestatemachines/AI%20Finite%20State%20Machines%20Tutorial.pdf
States and Behavior Trees
http://aigamedev.com/open/articles/bt-overview/
These sources have got me a little more familiar with some concepts behind designing the AI system, but I’m still not clear on how to directly approach it. I started so far by outlining a set of states that the AI could be in (Idling, Pursuing, Evading, Wandering, Following, Etc…) but I now wonder about conditionals that would trigger these states, and also the execution of movement and where to place it.
The movement system may be too complex to compress into a single state, and I want to separate it in another FSM then just feed it target data and have it compute how to get there. This would be the Motor FSM. It will also have to figure priorities on the fly but for navigational issues such as a giant object in the way and finding a path around it, but still taking full control of the thrust and navigation… Maybe there needs to be a Navi FSM or something to prioritize where the Motor should be pushing the ship to get to the target…?
The Behavior FSM should be dictated by a Priority System FSM which is checking conditional data, objective flags and things like that, then the Behavior FSM reads this information and decides which state it should be in and moves the target point(s) for the Motor FSM which just figures out how much thrust and torque to apply to the vectors to get to the target point.
So it would flow like… [Priority FSM] ↔ [Behavior FSM] → [Motor FSM].
Is this a good approach? Too expensive? Fundamental flaws? Missing critical elements?