Jump to content
  • Advertisement
Sign in to follow this  
fuzinavl

StarCon navigation

This topic is 4812 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

I'm designing an asteroids pure-combat game similar to Star Control 2 or TimeWarp. I remember while playing SC2 that a syreen rocket could weave expertly through clouds of kohr-ah black blades. That always impressed me. Does anyone know how the combat-navigation algorithms work for starcon2?

Share this post


Link to post
Share on other sites
Advertisement
They're essentially "boid" behaviors. Do a Google search for "steering behaviors craig reynolds". Asteroids style games work really well with steering behaviors.

Every ship has a velocity vector (essentially describing direction and speed). If you want to change that, you turn the ship and fire the rockets in the correct direction to modify your velocity vector.

You can also sum other influences on the ship, like gravity from nearby planets, or tractor beams, or repulor fields, collisions, etc. So you would sum up all the other effects, add in your "ship piloting" adjustments, and then use that to modify the current velocity vector of the ship.

Hope that helps.

Share this post


Link to post
Share on other sites
Star Control II apparently had its source code freely released, and was remade as a freeware project called "The Ur-Quan Masters." See <http://sc2.sourceforge.net/>. (Remixed music too.) This is a great game, for those who haven't yet seen it.

Share this post


Link to post
Share on other sites
In the Ur-Quan Masters code, the race-specific AI appears to be in the src/sc2code/ships/racename/racename.c file, and is a function called "racename_intellegence". The general AI code seems to be in src/sc2code/cyborg.c, which appears to contain general functions used by the race-specific AI.

To me it looks like the ship AI has a few different behaviors (pursue, entice, and avoid) depending on what the situation is, and each of those behaviors specifies more fine-grained reactions depending on both ships' capabilities and current position.

You can look it up, but in my experince the UQM code tends to be rather hard to get through, since it's mostly uncommented and designed much more for efficiency than ease-of-reading. However, if you want to go for it, go for it.

Do note, however, that UQM's AI probably isn't a good model for a good, general algorithm... A LOT of the impressive things SC2 did could only be done because they had very very strict limitations. For instance, you will never have more than two ships in a battle, you will always be able to see the other ship, only X shots could exist at one time, etc. Still, you may learn a few things, and it's always fun to play with.

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!