🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

AI space battle movement

Started by
1 comment, last by lexington 8 years, 5 months ago

Hey everyone, I have been looking to make a space combat game in 3D and just wanted to ask for some advice when it came to the movement of the AI fighters/bombers

I know about steering behaviours and how I would use them (for example I would use seek (and match velocity when close enough) when chasing an enemy, flee/evade when hiding from someone targeting you and always have avoidance) but something that concerns me is the movement of the AI with these behaviours.

Every ship I have will have a direction vector and thrusters that push them in that direction (for example if the player was to push the thrusters up to 60 I could add a force in that direction). This would give me a nice curve when AI wants to turn around to target or evade something (like in a dog fight or other space combat games). But with steering behaviours it seems to me that you just have a speed/maxspeed and all the other forces are worked out independently of the thrusters and the ships directional vector. This would lead to ships that do what is needed and avoid any collisions but it not really what I'm looking for as I want it to be more based on the direction vector and the thrusters.

One way I was thinking of using the two together is by adding all the steering forces together like normal, then with the final velocity that comes from it, add that number to the current position and make the ship rotate to that point (which achieves the ship turning like an aircraft and other space games). the only problem i can see from this is that I would have to have some kind of thrusters logic on how much power is being used as this could still cause the ship to crash if it does not slow down.

Has anyone else got any other ideas about how to do this or how other space games get around this problem.

Thanks in advance :)

Advertisement
Use steering to compute an "ideal" velocity, then use a standard "physical" model to try and reach the ideal velocity each tick using the capabilities of each individual craft.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Use steering to compute an "ideal" velocity, then use a standard "physical" model to try and reach the ideal velocity each tick using the capabilities of each individual craft.

Thanks for the good suggestion. I think I have got this working to a good level

This topic is closed to new replies.

Advertisement