Jump to content
  • Advertisement
Sign in to follow this  
lexington

AI space battle movement

This topic is 956 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :) 

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!