Ship AI


Well I forget what I did yesterday but I do remember getting it done =)

Anyhow, I have to really rework the npc ship AI. Right now, i have several different types of npc ships: cruisers, traders, workers, pirates and police. I want them to behave in some cases quite differently: for instance pirates will attack the player unprovoked, where cruisers will run away, and police travel in squads whereas the others travel alone.

Now, I went and implemented sort of a first run for these ship AIs, somewhat succesfully, some months ago. What I want to do is refactor them into one modular AI. Not as hard as it probably sounds, but it's going to require I think that I strip things down quite a bit, and rework it from the bottom up. If I can modularize it, it makes maintainence much much easier (particularly when it comes time to make these guys be networkable) and, as with other modularized components, I can make things more interesting ultimately by combining things freely, linking with other umake parameters (for instance I could look and see if the pilot person had a bad temper, and affect some parameter that would make him more likely to attack the player based on that).

I think the thing to do, is strip it right down. I have a fair bit of working AI that I can rip out of the existing drones and rework piece by piece into it. So it will start out that all ship types behave exactly the same, and then gradually they will start to diverge as I add more and more type of modules. I can't yet see how I will put the modules together for many of the kind of behaviours I want to support, in particular the "swarming/flocking" effect that police ships have. But if I end up losing that or some other complex behaviours, it really isn't the end of the world I suppose, for what I gain.

Well, so that is the plan of action, strip down the npc ship AI and rebuild it modularized, not worrying too much what the final requirements might be.

2004-05-11


◀ Back