Skip to main content
GameDev.net gamedev.net
🔒 Locked

Simple spaceship AI

Started by Erik Sintorn Sep 24, 2005 at 6:29 AM 3 replies 1.9k views
Original Post
Erik Sintorn
Erik Sintorn
Hullo, I'm developing a space-trader game (as if there aren't enough of those) and am now forced to implement some rudimentary AI for the game to go anywhere. As I've never worked with this stuff I'm quite lost though. Basically what I want right now is a decent method to make a ship (that has a position and rotation and on which we can call thrust(), yaw(), pitch() and roll() methods) go to a specified point (and orientation). For example, the ship is somewhere in space and I want it to end up on the parking lot on a space station. Any thoughts on what I should do (or read) to get this working?
ErUs
ErUs
i made a space trading game but it wasnt 3d or even 2d. you clicked to fly somewhere and if you had to fight or something it was turnbased
-www.freewebs.com/tm1rbrt -> check out my gameboy emulator ( worklog updated regularly )
Erik Sintorn
Erik Sintorn
So then, it was a one dimensional space trader!? Thrilling, but I think it's a bit late for me to change change dimensions ;). Does anyone have an idea of how ta make my spacemen go where they wanna be?
kevmo
kevmo
If you don't take obstacles into account (which is a bad assumption to make, but a good starting point perhaps), you could look at using splines to make a smooth path to follow to get to your desired position and orientation. I don't know much about splines, but it may be possible to constrain the second derivative of the spline to account for how fast the ship can turn. At that point, it would just be a matter of calling the appropriate movement methods at the points required by the spline.

If this sort of method DID work, then you could handle obstacles by breaking your path into pieces, and re-calculating the parts of the path that overlap obstacles, with the endpoints adjusted to steer around the obstacle.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.