GPWiki.org
GPWiki.org
It is currently Wed May 22, 2013 1:17 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Oct 12, 2010 5:45 am 
Rookie

Joined: Tue Oct 12, 2010 5:32 am
Posts: 2
Sorry about the length! It's late, and I get quite verbose when I get tired.

I am thinking about making a game which would, at least in part, take place on a space station. In my opinion, the best way to create an artificial gravity for this would be to have the station rotate. I would like to know if it is possible to find a physics engine that would allow for gravity of varying strength (less as the player approaches the center of rotation) to pull in a changing direction (directly away from the axis of rotation). The ideal situation would include real-time calculations, so the player would be able to jump across the center of the station and land on the opposite side of the room. I have seen some suggestions elsewhere recommending that, essentially, a constant gravity be used and just changing the direction of the force, but I would really like to have a more realistic system. The closest I have found is a suggestion of using a cylindrical force field with a calculated falloff, but I have no idea what engine(s) would be able to to that. Does anyone know of anything that would let me do anything with this? Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 12, 2010 12:25 pm 
Corpse Bride
User avatar

Joined: Tue Jul 01, 2008 11:44 pm
Posts: 2216
Location: England
I don't have an answer because I don't know anything about pre-made physics engines, but I will talk about physics.

The artificial gravity of rotating things isn't as simple as a force pointing outward (centrifugal force). There is a coriollis force too, which is felt as things move radially in or out. If you have things jumping across the station, the coriolis force becomes rather important.

Constant gravity is with a vector (0, 0, -g), where g is the force of gravity.

When we're dealing with central force fields from rotating frames of reference, we first derive this equation for acceleration:

Image

The r.Ã

_________________
I ain't pushing no moon buttons.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 12, 2010 2:29 pm 
Game Programming Guru

Joined: Sun Aug 15, 2004 6:20 pm
Posts: 1090
Your physics engine should allow you to apply your own forces. You can turn off the engine's default typical gravity and instead apply your own gravity force to each object during every physics step.

_________________
Heard in #gpwiki: <wzl> is there some serious grammar fail in your line or am i just too intelligent for your logic


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 13, 2010 1:35 am 
Rookie

Joined: Tue Oct 12, 2010 5:32 am
Posts: 2
Thanks for the help!

Jasmine: I was forgetting about the effect of moving laterally. Thanks for the equation and the pointers; I'll try to work them in!

sdw: I haven't even gotten that far, yet. Once I get out of the planning stage, though, I'll make sure that whatever engine I use will allow me to create custom fields. It's nice to know that it shouldn't be to difficult to find.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 13, 2010 7:39 pm 
Level 22 Norse Warrior-Librarian
User avatar

Joined: Mon Sep 04, 2006 5:25 pm
Posts: 517
Location: U.S.
This sort of thing can get kind of complicated, or so I hear, but I think in your situation it shouldn't be too bad, since you only want one source of variable gravity. I believe the people who made Prey built their own engine, in part because they wanted to be able to have several sources of gravity acting on things at the same time.

As Jasmine and sdw said, your best bet is probably going to be to turn off the default gravity and calculate it yourself. If you look in the internals of most physics engines, all they do for gravity is just loop through every object and add a downward force, every frame. Some physics engines don't even have functions for gravity, as it's considered to be an unnecessary bloat to the code :)

_________________
Worlds at War (Current Project) - http://www.awkward-games.com
Ganadu'r, The Eternal Sage (Other Current Project) - http://rpg.naget.com
Programming tutorials and web-design services: http://www.wyrmmage.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group