Page 1 of 1

Spherical Worlds

Posted: Sat Apr 09, 2005 12:03 am
by AlexL
I've had the idea rolling over and over in my head now, for a game that takes place on spherical worlds. But I haven't quite been able to figure out how I should go about executing the idea, at first I thought about faking them, but as I got farther and farther along with my design documents I realized that this wouldn't work.
My next idea is to have a pivot point in the center of each 'world' and have the player being pulled in towards that point, so he doesn't fall into nothingness. But I'm not sure if this is a good way to do this, so what I'm asking is for some input on what to do here. If anyone knows of any links for reading up on spherical worlds, or a link if they've already been talked about here; I would be extreamly greatful, thanks for your time :)

Btw, the worlds would only be 2x to 3x the size of the player; quite small.

Posted: Sat Apr 09, 2005 4:43 pm
by Guest
just use your sphere model or whatever, but when u use ur physics engine, make sure the planet has like a whole bunch of gravity or something.

Posted: Sat Apr 09, 2005 6:04 pm
by AutoDMC
Just an idea, it might work. (Sorry if the picture stretches the board)
Image

I drew the picture with a physics engine in mind, but basically all you have to do is place your character in space, and put a sphere under it. Rotate the sphere according to the user's input, happiness.

If you want to use a physics engine, just drop your character onto a sphere with it's point of origin undernith the character, set upon the "gravity plane." Then roll the sphere around undernith the character.

:D Hav'nt tested it... just slapped it togeather.

Posted: Sat Apr 09, 2005 6:28 pm
by Dingsi
What will happen with other moving objects (e.g. other players), AutoDMC? How do they move on the sphere in your modell? o.o

Posted: Sat Apr 09, 2005 6:32 pm
by AutoDMC
Well, in my case, I made the assumption that there was going to be only 1 moving body (aka Sonic 3 bonus stages... the character moves, but everything else stays static to the world.)

If you want other things to move, you might be able to simply make the two bodies gravitationally attractive to each other (like what was already said), or you can translate the gravity plane to be perpindicular to every dynamic object as you do the physics engine part. I don't know how well that would work, though :D

Posted: Sat Apr 09, 2005 6:48 pm
by AlexL
Thanks for the picture and explanation AutoDMC, it really helped out and is going to make it much easier then the idea that I had in mind :D

Posted: Sun Apr 10, 2005 7:56 am
by SARIN
if i were u, i wouldnt rotate the world. these variables would have to be changed,
rotating the character to the world=1 vector
rotating the world=world vectors + any enemies, npcs, drops, and anything else like that

Posted: Sun Apr 10, 2005 7:18 pm
by Midnight
would this even require a physics engine??

seems to me you could use an algorithm of the spherical sort to fix the charactor a certain distance from the center point of your world.

Not sure how this would work but I am sure about one thing.

It's not going to be as easy as most things and it's going to require alot of PI and cheesecake.



...what I like cheesecake?!

Posted: Sun Apr 10, 2005 11:27 pm
by mohaps
a simple solution for a rotation like effect on a planetary world.

Write a Planet Scene Node..

Add a terrain scene node...

depending on the players's position select grids from the terrain to show..

for example

0.0 0.1 0.2
1.0 1.1 1.2
2.0 2.1 2.2

PLayer in grid x,y means the grid becomes


x_.y_ x_.y x_.y+
x.y_ x.y x.y+
x+.y_ x+.y x+.y+

where

x_ = (x-1) % GRID_SIZE
y_ = (y-1) % GRID_SIZE
x+ = (x+1) % GRID_SIZE
y+ = (y+1) % GRID_SIZE



render and place objects accordingly...

Posted: Mon Apr 11, 2005 3:01 am
by SARIN
hmm, u could also use upvectors. if ur using a physics engine, use the upvector joint (i no they have it in newton, not sure about others). however, this might cancel out some rotation;
to get the upvector, use something like the line2d getangle (for x and y, z for z use again for y and z or something) and convert it, maybe by %360 or something