Brett Laming gives a very fast paced talk on designing and building AI architecture in a game, from beginning to end. I got some notes from it, but you’ll find more information on the slides I’m sure. Since GTA: Chinatown Wars which some examples are given from is on the DS, I’m sure a lot of this is optimised and suitable for many game types.
Best practice to:
- Play to the teams strengths – give the physics guys the maths problems
- Assert and unit testing
- Automatic scripts as soak tests
- One coordinate system
- Cater tools to their needs – if you support 20 people with scripting tools, automate as much as possible
- Build a debugging suite
- Instant pause – when the error occurred
- Flyable camera – to check where it is
- Layered information
- Action histories – dumping logs
- Maintain player immersion
- AI should not be too bad or too good – don’t want the AI to fall down a hole. But don’t an AI to automatically see a player if they are in a certain radius and seeing through cover.
- Limit the AI to what the player would know
- Constrain them to the same actions the player can do
Can try and mimic the player in the AI – take in sensory data, do some thinking, send it through a controller and act on the output.
Detail level is important – RTS strategy versus Thief. Still need some general information per unit though. Seeing can be an arc as an approximation, the sound can be a circle. Give the AI some fuzzy error on it – audio should be less effective. AI can track movement if it knows the velocity and direction of something.
Can build a blackboard model – just have dead bodies and obstacles in the cones not everything listed, and do it just as positions.
Build up a get information → think → act system. Can remove the controller part.
Add in dt() – level of detail. Pause when dt() is 0, needs to be hooked into everything.
Lots of information on how to architect a planning system and behaviour system…
Navigation is good with navigation mesh – “Fixing Pathfinding Once And For All” by Touzor.
The mesh can be broken down for the current mesh part – it is optimised for the search space not the A* algorithm. When moving and doing constant updates to the pathfinding, dynamic calculations for intercept objects moving around, switch from navigation mesh to a object avoidance model.
With vehicles, there are the notions of gas and steering to use to navigate but it can work on the humanoid way of movement (which prioritises animation).