F-Zero like gravity

Post Reply
Madness Of Madara
Posts: 2
Joined: Wed May 25, 2016 4:10 am

F-Zero like gravity

Post by Madness Of Madara »

How do it get F-Zero gravity like in this video?

https://youtu.be/0Aetc_Vmjvg
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: F-Zero like gravity

Post by benelot »

Hello Madness Of Madara,

This is a special kind of gravity as you might have realized. I would set the world gravity to zero and implement some kind of adhesive force to the tube you are moving on. This means that as long as you are near the tube (within a certain range), you get some force pulling you towards the center of it. If you drive on the inside of a curve, you get momentum that even pulls you onto it. But if you drive on the outside of the curve, the momentum pulls you off the tube, as it gets higher as the adhesive force. I am not sure if you need to reduce the friction or if by my idea you easily bump into the tube and fall off, but that would have to be tested. Else you might have to implement it in a non-physical way by tweaking the physics in many cases to behave correctly.

I do not remember exactly from the days I played F-zero: What are the cases you actually fall off?
Madness Of Madara
Posts: 2
Joined: Wed May 25, 2016 4:10 am

Re: F-Zero like gravity

Post by Madness Of Madara »

I already know that, but this is not a sphere that has a fixed center of gravity. The gravity I need changes depending where on the tube the vehicle it on.
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: F-Zero like gravity

Post by benelot »

Depending on what side it is on? Or what side on the curve? Is it not possible to pass slowly on the outside of the curve? Well, then you need to build a model of your curves and apply forces to your ship according to the position. Since F=m*a, you can easily describe your force in terms of gravity and then apply it to the ship via its weight. You can even create an applyGravity() method for thr ships.
Post Reply