I had enough coding time at the weekend to sort out the troublesome behaviours. My test Bot will now run, walk, strafe or face the direction being travelled and hardly ever gets stuck. It even ducks down behind cover. Not always quite where expected but it does not look daft.
Compared to the frustration of a week ago I am very pleased with the results.
The main change was to be consistent with what code updates the movement. It now always uses a route generated from the path finder class even if that ends up being a straight line. There was a lot of tidying up to be able to do this.
To be able to strafe I had to add an enemy target location and then a bit of tweaking to smooth the movement, especially aiming up and down, to stop it looking too jerky.
I reached a convenient point to test it on the Xbox 360 and I am pleased to say it works well and I still get a solid 60 frames per second. Not surprising because all the Artificial Intelligence (AI) and pathfinding code are carried out in separate hardware threads.
Now to make the behaviours find cover properly and to shoot back!
Monday, 23 January 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment