Page 1 of 1

momentum

Posted: Sun Sep 12, 2010 10:13 pm
by Yodeebe
Hiya.
when rotating or climbing/diving there's a bit of momentum so that you dont just stop dead when you take your finger off the control. not a lot, but a bit.
can that same type of momentum be applied to forward motion? maybe a bit more than that on the rotation, but not too much. i'm thinking 1 or 2 seconds of 'slide'.
or is that monumentally difficult?

I've thought it before on numerous occasions, so apologies if i asked the question before & forgot!

Posted: Mon Sep 13, 2010 6:37 am
by Kaks
Momentum in Oolite already applies to all movement, and I believe it follows the same principles for any and all movement types.

Not quite sure why we'd need to change it in order to make momentum 'stronger' only for a specific direction of movement.... :?:

Posted: Mon Sep 13, 2010 12:38 pm
by Yodeebe
because after turning engines off i could imagine you'd drift forwards a bit, like a boat, maybe. more momentum with the whole ship moving forwards than rotational momentum, which incidentally is spot on imo.
a bit of skidding type movement, so when you turn, you continue a touch in the same vector. a bit like the old asteroids game.

obviously not worth fussing over if it's a pain, as it's for minimal gain, but it's the rotational momentum that makes me think that the basics might already be there in the code. if it's just a case of changing a few numbers, then maybe someone could direct me?

you'd also be quite justified in telling me to get a grip, & stop being so fussy. :D :roll:

cheers.

Posted: Tue Sep 14, 2010 6:21 am
by Kaks
Obsessive? You fit right in! :D

I'm slightly computerless at the moment (netbooks, bah! :P), but it might well be something you can have a look at. If I remember correctly, the relevant code should be inside src/core/entities/playerentitycontrols ... Hope this helps! :D

Posted: Tue Sep 14, 2010 7:57 am
by Eric Walch
Yodeebe wrote:
obviously not worth fussing over if it's a pain, as it's for minimal gain, but it's the rotational momentum that makes me think that the basics might already be there in the code. if it's just a case of changing a few numbers, then maybe someone could direct me?
Momentum is already in the code. Its called thrust. When you accelerate or decelerate, the speed change is dictated by thrust. Oolite is just cheating a bit by multiplying the player thrust by 4, making it accelerate much faster than an identical defined npc ship. (deceleration is even 32 times faster than an identical npc ship). Its deliberately and I assume its to enhance gameplay for the player.

However I think you are confusing things. Newtonian inertia dictates that any body tries to persist in its movement when you don't apply a force on it. So, when you stop any thruster that makes you turning, a spaceship will persist in its rotation. When you stop your aft thruster the ship will just persist in its forward movement but any acceleration or deceleration shoud stop instantly.

Posted: Tue Sep 14, 2010 12:52 pm
by Darkbee
oh gawd, this is beginning to sound like FE2. :shock:

*runs and hides*

Posted: Tue Sep 14, 2010 5:52 pm
by Switeck
If Oolite's ships are moving because of space frame-dragging, then once the engines shut down they should almost immediately come to a complete stop.

Posted: Wed Sep 15, 2010 12:59 pm
by Commander McLane
Switeck wrote:
If Oolite's ships are moving because of space frame-dragging, then once the engines shut down they should almost immediately come to a complete stop.
Which is exactly what they do.

The engines shut down gradually. As soon as there is no engine activity anymore the ship is at a standstill.