PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

AI for 3D spaceship movement - any good references / books

Seems to be a bit of a black hole (sorry for the pun) re: this area. Can anyone suggest good references or books that are actually useful.

Mainly I want to move ships under control of their own AI to either just cruise around or engage in combat.

(as with all my other posts this is re: Space Treker III & PocketGL)
There's a rather old book on AI that covered space ship AI via a neural net. I don't remember how applicable it is to your needs, but the book name is AI Agents in Virtual Reality Worlds, by Mark Watson. Other than that, you might search out Steve Woodcock's AI website - he's one of the best gaming AI guys around.
yeah, I'd come across the site earlier yesterday but did not read the neural net bits. Nice to see that he's a Star Trek nut (worse than me by the looks of it).

I'm starting to get promising results with my early paths for ships so another few days should get this to a point where it will pass.
Craig Reynold's steering behaviours are all extensible to 3D. They will give you nice wandering behaviour, pursuit, arrival, etc.

http://www.red3d.com/cwr/steer/
thanks, I will have a good read of this. It's amazing what does not turn up in a search. The ships are wandering already but not exactly steering :)
Conan wrote:
thanks, I will have a good read of this. It's amazing what does not turn up in a search. The ships are wandering already but not exactly steering :)


It was one of the hardest code in the Anthelion too.
I would say the key is to simulate how you would dogfight.

After analising it resulted for me that in most abstract way it is a simple state machine, when
a) you attack on the other other ship and fires
b) you try to go away from it preferably to its back.

That is the ideal way, in addition you should deal with
c) collision avoidance.
d) critical situations (your shield is too low, you are being hit while in state a) or b) so you might do some evasive manuever.
e) handling rockets / guided weapons (decide which one to use)
f) In Anthelion the lasers have speed/dimension, so it had to be added to the calculation.

In addition it is very important that you have phisical limitations (roll/pitch speed etc) and you have to control your ship having these constraints.-> it will look realistic this way.

I think the best is to first define the model (paper + pencil and draw the state-machnie (states+transitions), second: after implementing it, it will result about 10 constans the model uses in transition decisions.

Write a simulator where these models having different constans fight and watch the result. (fire/hit ration, collisions over time, kills/dies)

I was thinking about writing a neural network to do it.. might be a cool solution too. It is pretty fast in game (running it means only doing a lot of sigmoid_func(Summ (I*w)) but to teach it takes time.

G.
thanks for the advice Goro. Fortunately Space Treker is not a 'Space Shooter' so some of the complexities required in Anthelion won't be needed. (or is it that I'm too lazy). It's mainly exploration & trading.

When the player enters combat it's an alien ship against a weapon of choice from our ship's fitted items. Hopefully a bit like a tail gunner sequence but that's not started yet. The ship's weapons are all working correctly (thanks to Dan East who always sorts out my PocketGL problems) so once the alien ships are roaning around the solar systems correctly I can start the combat part. Currently the ships swoop & dive nicely but over time they sink lower & lower so a little more tweeking is needed.