Page 1 of 2

Space Flight/Combat Tech Demo #1.2

Posted: Wed Jul 16, 2008 3:47 pm
by empirepro
Download 1.0: http://www.mediafire.com/?pneg3mb4dlm
Download 1.2: http://www.mediafire.com/?x2bdjmxyfxr

This is a personal space flight/combat Tech demo. Code from this tech demo will be used in future games.

Tech Demo 1.2 Notes

In this release of the tech demo I have removed the space station, Nuclear Power planet, and Ship Hanger. I have been working on the dynamic Solar System. So far I have test spheres for the first 6 Planets plus the sun. Each planet is a child of the sun and rotate around the sun at different speeds. Please let me know what you like and dislike about the solar system!

Problems: I did run into some problems. When you are out by Earth and beyond you can barely see the sun is there some way to make the sun more visible and if so how would you go about doing it? The 2nd problem I ran into is that when you are out by earth and the farthest 3 planets the camera shakes really badly how can this be corrected?

Sun
Distance from the sun: 0
Scale: 100x normal sphere

Mercury
Distance from the sun: 4,000F
Scale: 5x normal sphere

Venus
Distance from the sun: 8,000F
Scale: 7x normal sphere

Earth
Distance from the sun: 12,000F
Scale: 10x normal sphere

Mars
Distance from the sun: 16,000F
Scale: 7x normal sphere

Jupiter
Distance from the sun: 20,000F
Scale: 20x normal sphere

Saturn
Distance from the sun: 24,000F
Scale: 7x normal sphere (Not changed to represent Saturn's true size)


Instructions:

Arrow Keys - Turn left, right, up, down
W Key - Increase speed
S Key - full stop
F Key - Fire lasers
Mouse - Aim

Finished:

Space flight
Lasers (does nothing at the moment accept fire)

Future release:

Full combat system
Combat AI
Particle system
Physics
Network
Sound

Posted: Wed Jul 16, 2008 4:12 pm
by JP
Around 750fps OGL on my work PC.

The controls seem a bit weird... you just have to quickly tap W to get a manageable speed, anything more and you fly off really fast.

Also it seems that when i get close to an object i get a big speed burst...

The draw distance is also painfully small so at the start you can't actually see anything until you get closer to it.

Not a bad start to a project though, good luck with the future :)

Posted: Wed Jul 16, 2008 7:44 pm
by patricklucas
I start at about 1700fps (DX9). When I can see the various ships and such, it drops to 200, and when I fly out where I can't see anything but stars, I get 3000+. :p

However, I noticed that you don't tie the accel speed into the framerate or anything... therefore, because I start at 1700fps, the slightest touch of W sends me ultrafast - I have to tap then hit S to see the other ships. :p

Posted: Wed Jul 16, 2008 8:06 pm
by empirepro
Yeah after JP talked about that I changed it for atleast right now so that theres just a set speed when you press w instead of increasing speed.

Re: Space Flight/Combat Tech Demo #1

Posted: Wed Jul 16, 2008 8:25 pm
by rogerborg
empirepro wrote:Please let me know what your Frame rates are. Thanks!
I call Hoare's dictum on that.

Posted: Wed Jul 16, 2008 8:56 pm
by patricklucas
It's hard to read that wiki... My mind keeps tripping on the lack of spaces in intrawiki links. :p

Posted: Fri Jul 18, 2008 2:47 am
by empirepro
I have released Tech Demo 1.2 Please let me know what I can do to improve the solar system! Also please try to check out the 2 problems I came up with and see if you can give me a solution to them! Thanks!

Posted: Fri Jul 18, 2008 7:43 am
by JP
shaking could be due to floating point problem maybe, if you're actually 24,000 units out i dunno if that causes problems, seems like that's been mentioned before.

you could search the forum for people's solar system projects that have been done before, they've talked about issues like this and getting nice scales as you can't achieve true to life scales and distances in an application.

there's probably not much you can do about making the sun more visible, is it just too small? you could put a glowing halo around it to try and make it more visible i suppose...

Re: Space Flight/Combat Tech Demo #1.2

Posted: Fri Jul 18, 2008 7:45 am
by rogerborg
empirepro wrote:Finished:
Space flight
Lasers (does nothing at the moment accept fire)
That's a peculiar definition of "finished". :?

Sorry, it was unusable for me. It looks like you're using framerate dependent movement, i.e. the faster it runs, the faster things move.

What you'll want to do is to make all of your movement framerate independent. The faster the game is running, the smaller your movements should be.

A common way to do this is to calculate a frame delta time, and multiply your movements by this, e.g.:

Code: Select all

const u32 now = device->getTimer()->getTime();
const f32 frameDelta = (now - then) / 1000.f;
then = now;
// And multiply all of your motions by frameDelta
Note that up to 1.4.1, getTime() on Windows has a problem with its resolution - I'd recommend using the SVN trunk.

Re: Space Flight/Combat Tech Demo #1.2

Posted: Mon Aug 04, 2008 4:03 pm
by Repgahroll
rogerborg wrote: A common way to do this is to calculate a frame delta time, and multiply your movements by this, e.g.:

Code: Select all

const u32 now = device->getTimer()->getTime();
const f32 frameDelta = (now - then) / 1000.f;
then = now;
// And multiply all of your motions by frameDelta
Wow man! Very simple and useful solution!!

Thanks a LOT! :D :D

Re: Space Flight/Combat Tech Demo #1.2

Posted: Mon Aug 04, 2008 7:17 pm
by frostysnowman
rogerborg wrote:
empirepro wrote:Finished:
Space flight
Lasers (does nothing at the moment accept fire)
That's a peculiar definition of "finished". :?

Sorry, it was unusable for me. It looks like you're using framerate dependent movement, i.e. the faster it runs, the faster things move.

What you'll want to do is to make all of your movement framerate independent. The faster the game is running, the smaller your movements should be.

A common way to do this is to calculate a frame delta time, and multiply your movements by this, e.g.:

Code: Select all

const u32 now = device->getTimer()->getTime();
const f32 frameDelta = (now - then) / 1000.f;
then = now;
// And multiply all of your motions by frameDelta
Note that up to 1.4.1, getTime() on Windows has a problem with its resolution - I'd recommend using the SVN trunk.
Sorry for this offtopic questions, but I thought that getTime() was not real time and was incremented everytime smgr->beginScene() was called and that getRealTime() was from the actual system clock- so what's the difference between the two?

Posted: Tue Aug 05, 2008 4:53 pm
by christianclavet
Hi, empirepro

This demo have a good potential to be a fun game.

Can you check to allow a more FARZ value on your camera? Some planets seem to be cropped. (View Frustum culling) Increasing the value of the ZFAR on the camera should have them fully rendered.

This could lower the frame rate on some machine because since you'll view farther away, and you have more objects in that view, there will be much more to render. For the moment, there isnt much so I don't think it will be a problem.

Later, one solution would be to replace some very far objects with BILLBOARDS (as planets) or lower detailed objects (stations, ships). (LOD implementation)

Rogerborg is right about the way you render your current animation controller on your camera, it's frame based and not time based, this caused the game on my computer, to move the ship at incontrolable speed (Like moving to warp each time I press the forward button). Forward movement is too fast to control.

frostysnowman, this is not important, because what is needed is the DELTA time (time difference from one frame to the other) This way the camera movement will have a time reference. (Made the same mistake on my FPS rig when I first made it)

Posted: Wed Aug 06, 2008 2:27 am
by frostysnowman
christianclavet, unfortunately I already know the worth of time based movement and what I was asking was what the difference was. It's a simple question, and I think it matters.

Posted: Wed Aug 06, 2008 7:36 am
by rogerborg
Heck, don't take my word for it; you have the source available.

Posted: Wed Aug 06, 2008 8:00 am
by frostysnowman
There's a lot going on in Timer with handling the time and I couldn't get how it worked so I was hoping for someone who knew the inner workings of Irrlicht well could give an answer. Maybe we can leave it at. Or we could battle to the death with witty comments. It's your choice. ;)

@empirepro, your demo is pretty cool, but other than what others have already mentioned maybe you could use a spaceship 3d model, like one from this page? Unfortunately a lot of them are only available in 3ds Max format, but there's probably one there you could use.