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.