The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
December 12, 2024, 04:12:03 pm
Home Help Search Login Register
News: Celebrating 30 years of Star Control 2 - The Ur-Quan Masters

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  General UQM Discussion (Moderator: Death 999)
| | |-+  The Leyland Maneuver, does it actually exist?
« previous next »
Pages: [1] Print
Author Topic: The Leyland Maneuver, does it actually exist?  (Read 2459 times)
Angelfish
Enlightened
*****
Offline Offline

Posts: 568



View Profile
The Leyland Maneuver, does it actually exist?
« on: July 18, 2009, 04:10:37 pm »

I'm no genius in physics, but when trying to implement gravity wells into my code, the resulting gravity well doesn't actually generate a Gravity Whip effect when I move the ship past it. When approaching the planet the ship accellerates towards the planet. (I increase the x and y velocities by a value based on the angle and distance to the planet, aswell as the mass of the planet itself.)
But when it moves away from the planet it decelerates in the same way so that the effect is neutralized.

So, either my physics coding is wrong, or gravity whips can't actually be performed in real life Wink.
If the latter is the case, I'll decrease the gravity effect when the ship moves away from the planet by a certain factor.

Any advice is welcome Smiley
« Last Edit: July 18, 2009, 07:10:11 pm by Angelfish » Logged
jschmerge
Zebranky food
*
Offline Offline

Posts: 7



View Profile
Re: The Leyland Maneuver, does it actually exist?
« Reply #1 on: July 18, 2009, 06:34:48 pm »

Umm, your math is wrong. What you are mistaking for an increase in velocity should actually be a *change* in acceleration (acceleration is a vector, just like veloscity). I'm not going to get too much into the math here (any good calculus or physics text book will have several sections on modeling newtonian dynamics), but simply put you need two equations:

1.) Force of gravity exerted by the planet. This is proportional to the square of the distance from the planet, or F(d) = C/d^2 (where C is a constant, larger values for larger masses).

2.) An equation for the velocity of the ship. This is expressed as a sum of three terms: current velocity, current acceleration (i.e. caused by the ship's thrust), and acceleration base on gravity. All three of these terms are expressed as separate vectors, and when added together produce the resulting velocity.  So the equation for velocity, as expressed as an absolute function of time would look something like: V(t) = v'  + a * t + F(d) * t , where v' is the current velocity, and F(d) is the vector of acceleration *towards* the planetary mass.

That  equation doesn't work well for rendering graphics though... What you *really* want is an equation that can give you the current position and velocity based on (last position, last known velocity, current acceleration, and time delta). This works extremely well when running through an event loop that renders the graphics. I'll leave it up to you to figure out the math. If you like, I'll supply more information, but I think you need to figure this out for yourself Smiley
Logged
SweetSassyMolassy
*Smell* controller
****
Offline Offline

Posts: 271



View Profile
Re: The Leyland Maneuver, does it actually exist?
« Reply #2 on: July 18, 2009, 06:50:38 pm »

There's a little more to it then that, I think. In addition, moving inward toward the planet while traveling at a tangential velocity toward it will produce a Coriolis effect, which produces a force tangentially on the ship, thus adds to the slingshot effect.

You know, this might actually be easier with an energy equation. You have a velocity (or kinetic energy) and a potential GM/R. This article should explain the rest. Assuming that you're in a stationary frame with the planet maybe this will be easier, maybe not.

http://en.wikipedia.org/wiki/Gravitational_slingshot
« Last Edit: July 18, 2009, 06:58:53 pm by SweetSassyMolassy » Logged

I am not always understand about what you speak, unfortunately.
jschmerge
Zebranky food
*
Offline Offline

Posts: 7



View Profile
Re: The Leyland Maneuver, does it actually exist?
« Reply #3 on: July 18, 2009, 06:59:41 pm »

I'm not sure what a whether phenomenon has to do with modeling Newtonian bodies Smiley

You'll seriously get the gravity whip with just the math I presented.
Logged
SweetSassyMolassy
*Smell* controller
****
Offline Offline

Posts: 271



View Profile
Re: The Leyland Maneuver, does it actually exist?
« Reply #4 on: July 18, 2009, 07:15:10 pm »

It comes up a lot in weather, but it isn't a weather phenomenon. The clouds follow it as a property of rotating bodies. -2*omega X velocity gives a "fictional force" which moves tangential to the rotating body.

I'm sure it can be neglected when writing the code though, I was just being a smart-ass, especially since the planet isn't really rotating.

If the Newtonian kinematics prove hard though, there's always energy equations.
Logged

I am not always understand about what you speak, unfortunately.
Angelfish
Enlightened
*****
Offline Offline

Posts: 568



View Profile
Re: The Leyland Maneuver, does it actually exist?
« Reply #5 on: July 18, 2009, 07:31:13 pm »

Umm, your math is wrong. What you are mistaking for an increase in velocity should actually be a *change* in acceleration (acceleration is a vector, just like veloscity). I'm not going to get too much into the math here (any good calculus or physics text book will have several sections on modeling newtonian dynamics), but simply put you need two equations:

1.) Force of gravity exerted by the planet. This is proportional to the square of the distance from the planet, or F(d) = C/d^2 (where C is a constant, larger values for larger masses).

2.) An equation for the velocity of the ship. This is expressed as a sum of three terms: current velocity, current acceleration (i.e. caused by the ship's thrust), and acceleration base on gravity. All three of these terms are expressed as separate vectors, and when added together produce the resulting velocity.  So the equation for velocity, as expressed as an absolute function of time would look something like: V(t) = v'  + a * t + F(d) * t , where v' is the current velocity, and F(d) is the vector of acceleration *towards* the planetary mass.

That  equation doesn't work well for rendering graphics though... What you *really* want is an equation that can give you the current position and velocity based on (last position, last known velocity, current acceleration, and time delta). This works extremely well when running through an event loop that renders the graphics. I'll leave it up to you to figure out the math. If you like, I'll supply more information, but I think you need to figure this out for yourself Smiley

Actually, I think you misunderstood the way I did things. I do have gravity and acceleration vectors which result in the current velocity vector Smiley.
When using not the distance, but the square of the distance in the force of gravity calculation, my gravity well is working perfectly. Although I have to say that it's more difficult to use it than it is in SC2 (it takes more precisio).
« Last Edit: July 18, 2009, 07:55:35 pm by Angelfish » Logged
Mormont
*Smell* controller
****
Offline Offline

Posts: 253


I love YaBB 1G - SP1!


View Profile
Re: The Leyland Maneuver, does it actually exist?
« Reply #6 on: July 18, 2009, 09:46:51 pm »

Yes something similar does exist, and NASA uses it sometimes (such as the Voyager missions). The SC2 version is a huge simplification of course.
Logged
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: The Leyland Maneuver, does it actually exist?
« Reply #7 on: July 18, 2009, 09:55:26 pm »

The physics of Star Control are a bit strange. While it's possible in real life to nab large amounts of momentum off a planet (by the standards of a spaceship), this doesn't work in Star Control because the planet is fixed. Instead, the planet essentially removes the maximum speed limit, changing how a ship's acceleration works.

Hence, the Leyland manoeuvre is a way to get around one unrealistic aspect of Star Control physics (the speed limit) by introducing yet another strange rule.
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
Angelfish
Enlightened
*****
Offline Offline

Posts: 568



View Profile
Re: The Leyland Maneuver, does it actually exist?
« Reply #8 on: July 19, 2009, 02:43:48 am »

Thanks for all the help, guys Smiley. I'm still trying to figure out how to make my gravity wells behave the same way as in SC2 though, but I think that's just a matter of tweaking etc Wink.
Logged
Lukipela
Enlightened
*****
Offline Offline

Gender: Male
Posts: 3620


The Ancient One


View Profile
Re: The Leyland Maneuver, does it actually exist?
« Reply #9 on: July 19, 2009, 06:28:44 pm »

What is it your actually doing? Another melee engine, working on old Timewarp stuff, or what?
Logged

What's up doc?
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!