Previous Blog Next Blog
Prev/Next Blog
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:GarageGames Blog feedor 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.


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 ResourceSubmit your own resources!

James Laker (BurNinG)   (Jul 10, 2007 at 11:20 GMT)
You should maybe start posting this in the Discussion forums, instead of using the Blog area.

Johnny Hill   (Jul 10, 2007 at 13:59 GMT)
Well at least give a explanation :) Rob just can't show or (post) any actually code changes in the public blog, but since he just posting the results of his changes and showing off the progress of his work then whats the problem.

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)
I'm just saying that flooding the the blogs with every change he makes is not "good manners". A sensible thing would be creating threads and linking to them all from one Blog entry discribing what he has completed and what he's working on. Give an overall view.

But anyway... Do you as please, I guess.

Rob Evans   (Jul 10, 2007 at 14:14 GMT)
I don't want to upset anyone... I just thought the blog system was the most appropriate place for this stuff. Should I just move this over to my own site and link to it from here? What's the general code of conduct on this sort of thing? Is there somewhere that peeps are being flooded with my changes?

James Laker (BurNinG)   (Jul 10, 2007 at 14:37 GMT)
There's no code of conduct really. I would think that people that blog want people to see it for day or 2.

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)
I don't see anything wrong with this .plan.

Rob Evans   (Jul 10, 2007 at 15:16 GMT)
@James - Yeah constructor is so easy and quick... by far the most useful tool for TGE! I can't understand how peeps got on without it! Wait till I post the next screenshot... it's gonna have a planet... :o)

mb   (Jul 10, 2007 at 17:49 GMT)
I started making a spacesim the same way using the gravity mod and sky sphere resources. I have a space vehicle code (only script side) that works fairly well and changes the keybinds while your flying and has the explosions built in when you shoot them. If you want a copy let me know. This is just what I was doing but I didn't have any graphic artists helping out so it didn't go too far. I did make some basic asteroid objects (not the best looking) also if you want some temporary props... you can make them explode also.

Bobby Leighton   (Jul 10, 2007 at 18:22 GMT)
Blogs are supposed to be a form of an online LOG, or personal journal. At least that what they started out as, then as some people thought it would be a good way to share their thoughts with people that were interested in what they write, they made lots of them public accessible. Since then Blogs have become common at almost all sites, there should nothing wrong really with keeping track of your progress here, in your own Blog, does text really take up that much room?
Cheers

Rob Evans   (Jul 10, 2007 at 20:20 GMT)
@mb - I would totally be interested in both the space vehicle code and your asteroids! Not only from a technical point of view but also to use in my game! That would be totally awsome! My address is mira_001@yahoo.com. Cheers!

J Sears   (Jul 11, 2007 at 00:59 GMT)
people are very sensitive with blog postings on this site even though they never are forced to open someone's blog

Chris Jorgensen   (Jul 11, 2007 at 01:09 GMT)
I think if you're blogging daily on GG, then perhaps it should be in the forum. I don't know how other people use it, but I guess I expect it to be for a "big" update. For example, my blogs come months apart. So when I look in the "What's new" on the community page, I get a little disappointed when I see it's the same few frequent bloggers' next minor updates. Plus, we all want exposure for our "big news" and if someone floods that little "What's new" box with a bunch of tiny posts, then our exposure time gets minimized.

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)
LOL... I think the comments on this blog post are getting a little off-topic... perhaps someone should open a forum post... oh the irony! :o)

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)
Does anyone know how I can get the sun flare to look better here?



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)
Hey... try using different textures for Local and Remote bitmaps. Local being for Lensflare and Remote being the "Sun/Star" texture.

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)
Yeah, I've been thinking about changing the sunlight code. I've had a quick look and came to the same conclusion but the only way I could think of to make the local texture scale based upon LOS was to use a load of LOS points around the center to determine the scale size. Like this:



My only worry is the FPS dropping if checking LOS this many times...

Rob Evans   (Jul 11, 2007 at 12:52 GMT)
I've reduced the alpha on the local png to 69% and changed the blendmode to 3... the results look better but it's still not as cool as EVE LOL - like I'll ever be able to make eve-like graphics anyway!



Rob Evans   (Jul 11, 2007 at 16:09 GMT)
New nebula background screeny for anyone that's interested.





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)
I like the nebula look :)

Maxim Lyulyukin   (Jul 12, 2007 at 12:27 GMT)
nice start..
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)
I would LOVE to read those tutorials. I am very interested in how you made that space background!!

Rob Evans   (Jul 13, 2007 at 12:40 GMT)
OK, I'll write a resource on it and drop a link in here in a minute... keep in mind that I'm not a professional artist and wouldn't even say I'm worthy of being called a novice so there may be much better ways of doing / making what I've done :o)

Rob Evans   (Jul 14, 2007 at 01:09 GMT)
Here's the link to the resource I've just written to make these sorts of nebula backgrounds...

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.