Zombie simulator: starting work on the AI E-mail
Wednesday, 03 February 2010 18:54

Now that a couple of cars are in, it's time to work on the AI for the vehicles, people and zombies.

Having looked around the net a bit, there doesn't appear to be many steering libraries around. The most notable would seem to be OpenSteer, which has already been implemented as an Irrlicht class. True to form however, I need more control than a generic interface can provide, so I'm going to have to implement it manually myself.

I have two options for dealing with cars. One is to use OpenSteer, while the other is much simpler, and that's just to have the cars follow the road polygons around. As well as being simpler, I suspect that there's going to be a lot of extra work in dealing with making the cars avoid running into each other and maneuvering around road blocks and accidents. On the plus side, it'll probably use less CPU than OpenSteer.

With this in mind, I've opted to initially implement OpenSteer as a base class from which the mobile sprites and vehicles are both derived. Creatures will definitely need some sort of steering algorithm, so I'll find a use for it. If it proves too slow for use with the cars as well, then I can simply switch to something custom for the cars. I can't really tell one way or the other without actually implementing it because there is very little documentation for OpenSteer.

The basic idea for the path-finding will be to have people stay path find on the sidewalk, with the cars path finding on the roads, so neither will be on the look out for the other, which will hopefully cut down on performance issues. Pedestrians will cross at traffic lights and occasionally make a run for it without looking both ways... Zombies of course never look both ways. I'm also planning to make some drivers randomly aggressive and/or inattentive to give the city a bit more realism.

At this stage, I have completed integration of OpenSteer with the engine. The game compiles and runs without error, but the steering isn't working, so it's time to get debugging.

In the meantime, here's a bit of relevant amusement that I found while Googling today: AIGameDev's top 18 worst AI glitches.

blog comments powered by Disqus