Pages: 1 [2]
|
 |
|
Author
|
Topic: New Open Source Game (Read 9156 times)
|
ar81
Zebranky food

Offline
Posts: 21
|
The problem of entering orbit is tht you have to aim retrograde (which will mean a constant change of heading), and if you fire your thrusters too much, your orbit could intersect the planet and you may crash.
So you have a speed lower than escape velocity, but also enough speed not to crash. At most you may achieve an elyptical orbit. Achieving a perfectly circular orbit seems very hard, for it would require precision maneuvering on SC.
Anyway, it would be very interesting to try it.
If any of you got to do it, just tell me.
|
|
|
Logged
|
|
|
|
Dean
Guest
|
Ah, I see your point. But it's still got quite a lot fo physics in it - just not those that would detract from gameplay. I suppose it's like an adventure game -- noone could possible fit a broom, shovel, etc. into their pockets all at once (or at all!) but it's nessesary to make the game.
Sometimes reality sucks. Still I agree; SC2, whoops, I mean UQM rules!
How's your code coming along OP?
- Dean
|
|
|
Logged
|
|
|
|
|
JonoPorter
Enlightened
    
Offline
Gender: 
Posts: 656

Don't mess with the US.
|
Since there is all this talk about gravity i dcided to put in my 2 cents on the topic.
This is some code I came up with that finds the velocity need to orbit a gravity well.
PosOfAccelPoint - this is the position of the gravity well. PosofShip - this is the position of the ship. AccelDoToGravity - this the acceleration do to gravity at PosofShip.
It returns the velocity vector that the ship must be going for circular orbit going counterclockwise around the gravity well.
public static Vector2D GetOrbitVelocity(Vector2D PosOfAccelPoint,Vector2D PosofShip,double AccelDoToGravity) { double MyOrbitConstant = 0.63661977236758134307553505349036; //(area under 1/4 of a sin wave)/(PI/2)
Vector2D distance = PosOfAccelPoint - PosofShip; double distanceMag = distance.Magnitude; Vector2D distanceNorm = distance*(1/distanceMag);
double VelocityForOrbit = Math.Sqrt(2*MyOrbitConstant*AccelDoToGravity*distanceMag); return distanceNorm.RightHandNormal*VelocityForOrbit; }
What it does is find the velocity that it will be going when it reached the gravity well. And then makes the ship go that velocity perpendicular to the direction of acceleration. So when the ship reaches ¼ of its orbit its velocity vector has been rotated 90 degrees.
Im pretty sure this would work in UQM except fo the fact that this code is C# and UQM is C.
|
|
« Last Edit: September 28, 2005, 09:31:51 pm by BioSlayer »
|
Logged
|
|
|
|
ar81
Zebranky food

Offline
Posts: 21
|
Is accel point the periabsis (lowest point in the orbit)? A retro burn to make orbit circular should start some time before you reach periapisis and it would end up some time after, so periapsis is at the middle.
Also, some eccentricity calculation is necessary, not only to know if you have an orbit instead of a slingshot, but also to prevent a crash on surface planet.
Geez, I am turning SC into a 2D simulator.
|
|
|
Logged
|
|
|
|
|
Pages: 1 [2]
|
|
|
|
|