Game Development Community

Newbie question about engine physics

by Magnus Ternstedt · in Torque Game Engine · 01/13/2005 (2:53 pm) · 11 replies

Hi
I'm part of a game project that will be developing a 3D FPS game that is based on a spherical planet.
The planet will take approx. 30sec to a minute for the game characters to run around (and back to the starting position)

I only wonder if it is possible for the Torque game engine to handle a round world or if we will have to tweak it alot
(do all calculations ourselves)???
(The gravity and positioning of the character must "originate" from the center of the planet and not from a "flat" plane )

The project is on a tight schedule because of a gaming contest here in Sweden
(And I just bought the engine yesterday :-)

Any good hints will be very welcomed

Thanks in advance

/Magnus

About the author

Recent Threads


#1
01/13/2005 (3:00 pm)
Um... I can't really help out on this one... BUt you just bought the engine, you are in a gaming contest allready?... That seems a bit rushed... This will take a good number of C++ changes though, won's be simple I can tell ya that. It's litterly making a magnet in the middle of a large sphere (don't know how you are goiing to go making a sphere that big...) and making the players conform to the planed to the don't appear as though they are running on their heads...


Sorry I can't be more of a help, Max
#2
01/13/2005 (3:39 pm)
Heh! Yes It might seem so....
Actually we are Game development students at a College in Sweden and the team consists of
4 Graphic Artists and designers and 4 C++ programmers

We've been looking for a good engine for some time but finally decided to use Torque

The game competition is between student projects so it's not that severe :-)
you can check it out at www.excitera.nu/sga/nyhetsarkiv.php
our project is called "Sphere World"

But sure it will take alot of hard work. The trouble and biggest possible showstopper is this issue.
So that's why I'm posting here :-) otherwise I don't usually do that without proper research first.

/Mag
#3
01/13/2005 (3:47 pm)
First you need to modify the engine to treat gravity as a position.
(instead of a simple vector pointing down)

then the gravity calculations will change to utilize the new gravity center.

second the object which you wish to traverse upon (sphere)
will not be a heightmap so you can axe the terrain.
you will prolly have best luck using a bsp model for this.

now that is done you need to modify the player transform code to support the new angles you impose (characters cannot rotate on the err.. damn messed up coordinate system, I think the x plan?)
either way only 2 planes of rotation are currently allowed on players. you will need all three.

I recommend doing all of this work in the Player class and forego items and vehicles for now. (ShapeBase)

once you have all player models falling to a position that is your "planet core"
the rest should be trivial.
#4
01/13/2005 (4:03 pm)
I advise creating a function which returns a gravity vector given any point in space.

This is the most generic solution
and if you decide to change from a sphere to something else
it keeps everything tidy.

(Plane, Cube, Donut)
#5
01/13/2005 (4:07 pm)
Yes we thought as much.... that we had to do it the hard way.

Thanks for the advise Badguy I will dig deeper into this.

/Mag
#6
01/13/2005 (4:12 pm)
Thank you Orion

It seems to be a simpler solution
I actually thought about that somewhat when I read Badguys post

Great work guys... this really helps !!

/Mag
#7
01/13/2005 (4:38 pm)
Please post a screenshot or two when your game is finished. We'd love to see how you did it.

ray
#8
01/13/2005 (4:45 pm)
Sure thing :-)

And If it gets good when it's finished (and the other team members agree) I might let you guys have it for free

/Mag
#9
01/14/2005 (11:52 am)
You'll also need to conform the players to the sphere. There is a small resource on conforming players to the terrain. Look at how it does it's calculations, and replace the terrain normal with the sphere normal at a given point (it's actually just the local gravity inverted and normalized). Then you do some magic math to have all "2D" rotations happen around that angle.
#10
01/14/2005 (12:00 pm)
Thanks Manoel!!

Now I've got some meat on my bones to go digging :-)

Thanks again all you guys

/Mag
#11
01/14/2005 (12:57 pm)
No problem. Ah, I meant around that "vector", not "angle".