StarCon navigation
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?
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.
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.
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.
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.
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.
-----http://alopex.liLet's Program: http://youtube.com/user/icefox192
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement