by date
Space Sim in the Torque Game Engine - Setting up the Gravity Mod
Space Sim in the Torque Game Engine - Setting up the Gravity Mod
| Name: | Rob Evans | ![]() |
|---|---|---|
| Date Posted: | Jul 10, 2007 | |
| Rating: | Not Rated | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for Rob Evans |
Blog post
Well... after some fiddling around, I have been unable to make the gravity mod (link) work with 1.5.2 so I'm going to edit the engine myself.
Instead of fiddle with lots of code internally, I have decided that because we want to keep gravity for everything except ships when we're in space, I'm just going to create a new vehicle from the flying vehicle code called SpaceVehicle. Any vehicle created with the SpaceVehicle datablock will have no gravity. This is cool because we can keep all the gravity stuff for when we're on planets or walking around space stations etc.
I am using the WarSparrow object available for purchase here at GG and I suggest you purchase it to continue. I will NOT include or distribute this part of the code to anyone so you HAVE to buy it if you want to follow what I'm doing here.
However, if you are knowledgeable in the creation of vehicles in TGE, there's no reason you can't make your own first.
Follow the warsparrow install readme, then open warsparrow.cs and replace all instances of the word "Flying" with the word "Space". Now the warsparrow will work with our SpaceVehicle code.
Also, in "example\game.cs" change the code that says:
%player = new Player() {
dataBlock = PlayerBody;
client = %this;
};
to this
%player = new SpaceVehicle() {
datablock = WarSparrow;
client = %this;
};
Now our warsparrow will fly around like a space-ship... sort of. I will need to tweek the space vehicle movement stuff later, but for now it will suffice.
Here's a pic of our new space-ship next to a space-station I added into the level with the world builder to test the gravity stuff.

Instead of fiddle with lots of code internally, I have decided that because we want to keep gravity for everything except ships when we're in space, I'm just going to create a new vehicle from the flying vehicle code called SpaceVehicle. Any vehicle created with the SpaceVehicle datablock will have no gravity. This is cool because we can keep all the gravity stuff for when we're on planets or walking around space stations etc.
I am using the WarSparrow object available for purchase here at GG and I suggest you purchase it to continue. I will NOT include or distribute this part of the code to anyone so you HAVE to buy it if you want to follow what I'm doing here.
However, if you are knowledgeable in the creation of vehicles in TGE, there's no reason you can't make your own first.
Follow the warsparrow install readme, then open warsparrow.cs and replace all instances of the word "Flying" with the word "Space". Now the warsparrow will work with our SpaceVehicle code.
Also, in "example\game.cs" change the code that says:
%player = new Player() {
dataBlock = PlayerBody;
client = %this;
};
to this
%player = new SpaceVehicle() {
datablock = WarSparrow;
client = %this;
};
Now our warsparrow will fly around like a space-ship... sort of. I will need to tweek the space vehicle movement stuff later, but for now it will suffice.
Here's a pic of our new space-ship next to a space-station I added into the level with the world builder to test the gravity stuff.

Recent Blog Posts
| List: | 07/10/07 - Space Sim in the Torque Game Engine - Setting up the Gravity Mod 07/09/07 - Space Sim in the Torque Game Engine - Setting up TGE and Using Sky Spheres 07/04/07 - Space Sim in the Torque Game Engine - Introduction 07/02/07 - Creating Portals (doorways etc) in Constructor |
|---|
Submit your own resources!| James Laker (BurNinG) (Jul 10, 2007 at 11:20 GMT) |
| Johnny Hill (Jul 10, 2007 at 13:59 GMT) |
Here is a great site by Jongware that details the inner workings of how elite with a nods to the creator Braben how he pulled off the entire galaxy and all its little details.
Galaxy One
| James Laker (BurNinG) (Jul 10, 2007 at 14:06 GMT) |
But anyway... Do you as please, I guess.
| Rob Evans (Jul 10, 2007 at 14:14 GMT) |
| James Laker (BurNinG) (Jul 10, 2007 at 14:37 GMT) |
These kind of changes should go to the forums in my opinion. Then in your blog you give an overview off all the things you've done and link to them. This way the Blog entries dont get pushed out of view. Or I guess you could move it to your site, but then you wont be able to show any engine changes.
Dont get me wrong. Your work is great, and you have the enthusiasm, which is great to see. I've even learned something from your Polarizing Texture urrhm... supposed to resource ;) And I'll try it tonight.
When you get get stuck I'll even throw you some of my code ;-)
EDIT: Cool screenshot... I really should start playing with Constructor
Edited on Jul 10, 2007 14:38 GMT
| Eric Forhan (Jul 10, 2007 at 15:13 GMT) |
| Rob Evans (Jul 10, 2007 at 15:16 GMT) |
| mb (Jul 10, 2007 at 17:49 GMT) |
| Bobby Leighton (Jul 10, 2007 at 18:22 GMT) |
Cheers
| Rob Evans (Jul 10, 2007 at 20:20 GMT) |
| J Sears (Jul 11, 2007 at 00:59 GMT) |
| Chris Jorgensen (Jul 11, 2007 at 01:09 GMT) |
I'm not meaning to be jerky, I just wanted to relate to James in that I've noticed this trend with a few posters as well.
| Rob Evans (Jul 11, 2007 at 10:06 GMT) |
Anyway, I'm gonna be holding back on posts for a while if peeps are going to get upset about it. Just seems a bit silly to me... I didn't even know there was a "What's New" page until it was mentioned and I can't imagine ever using it.
| Rob Evans (Jul 11, 2007 at 10:37 GMT) |

Notice how the local flare overlaps in an obvious way?
Maybe I need a different flare graphic? Anyone got any examples they've done?
| James Laker (BurNinG) (Jul 11, 2007 at 12:42 GMT) |
I'm also not happy with the results... In fact the fxSunlight sucks and needs a rewrite imho.
Something like found in Eve would be nice... When in LOS it's big... and as it gets out of LOS it gets scaled down.
I guess the fxSunlight is suitable for FPS games (which TGE was designed for).
| Rob Evans (Jul 11, 2007 at 12:48 GMT) |

My only worry is the FPS dropping if checking LOS this many times...
| Rob Evans (Jul 11, 2007 at 12:52 GMT) |

| Rob Evans (Jul 11, 2007 at 16:09 GMT) |


If anyone is interested in how to make these sorts of backgrounds in Photoshop, I might make a tutorial.
Edited on Jul 11, 2007 16:12 GMT
| mb (Jul 11, 2007 at 21:41 GMT) |
| Maxim Lyulyukin (Jul 12, 2007 at 12:27 GMT) |
may be you will be intersted in this
www.garagegames.com/mg/forums/result.thread.php?qt=64330
| John Rockefeller (Jul 12, 2007 at 23:55 GMT) |
| Rob Evans (Jul 13, 2007 at 12:40 GMT) |
| Rob Evans (Jul 14, 2007 at 01:09 GMT) |
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=1328...
Edited on Jul 21, 2007 15:40 GMT
You must be a member and be logged in to either append comments or rate this resource.



Not Rated


