Lighting and Physics in Space

Started by
19 comments, last by DanG 21 years, 11 months ago
I''ve decided to create a 3D fighter game based in space, like an early Star Wars, where you stay in space and don''t get near land of any sort. The problem is i''m not sure how physics should work in this setting. There isn''t any up and down direction, and you should be able to just sit and not move. So the physics comes in trying to figure the coasting and turning radius and so forth. What kind of physics would work in this, what would they be based on? Secondly, What is the Lighting situation in space? Some of the planes might have lights attached, but what is global lighting calculations and such coming from? What makes the space effect look real? If you have anything else you would like to say on this subject, I am an enthusiastic listener. He who said money was the root of all evil knew little of the nature of money and less about the nature of man.
Ambassador: Mr. Bush are you stoned or just really, REALLY dumb?Pres. Bush - I assure you I am not stoned.
Advertisement
Physics in space is simple Newtonian mechanics - just keep track of position and velocity for each space ship, and then accelerate the ships by applying forces to them.

If you want to get more complicated, you can try simulating rotation taking into account torque and rotational inertia as well.

For lighting, you either can have a global amount of ambient light that you use for every ship, or you can take whatever your background is going to be and accumulate it into a diffuse lighting cubemap, which you could then use to do a pretty convincing radiosity effect. This paper has some information about diffuse lighting cubemaps: http://developer.nvidia.com/docs/IO/2643/ATT/gdc2002_hdr.pdf
Look for the part about image based lighting.

j
structural integrity / pilot mush factor

thats going to be the dominate theme in a space fighter sim. see if you crunch the numbers without some sort of inertia *changing* technology there isnt a space dog fight cause the pilot is mushhhh in the cockpick. ya you can pick up an unlimited velocity but you cant fricken slow down /accelerate in another direction. why? cause objects at rest tend to stay at rest and objects in motion tend to stay in motion. whats this mean? it means that even though the ultra powerful ships thrusters have changed the velocity vector of the ship you still have to change the velocity of the pilot. the pilot can only take soooo much velocity changing at once =).... after that its blackouts / mushhhhh

but thats good. cause that gives you game license. gravity and inertia appear to be the same thing. they may well be. we gave up that question since newton were revisiting it nowadays. but the implication is artificial gravity implies artificial inertia. that means nooo pilot mush.

But that does let you say the artificial gravity field can only work "so well" whats that mean to you? means turning radius for space crafts relative to how well the inertia damp field works. that means DOG FIGHTS! ya!

but it can also mean creative: push the evenlope if you dare game elements. pilot blackouts if you try to accelerate to hard (read turn). or damage causing flux in the damp field giving a fluctating turning radius (because of the pilot muuuush factor). You could also invent tech limitations that drive good game play.. like a rate over time you can use lots of inertia dampening now (read very tight turning/acclerations) but youll have to give up some later becuase of "goasdks effect" (made up).

Nearly all space sims build in ''friction'' so that you just don''t keep accelerating forever. It makes for unreal physics but at least you can throttle back maximum velocities.

In Elite and Frontiers the physics was real, but combat was reduced to lining up on each other from 600 klicks and then accelerating hard and firing your lasers, combined approaching velocites would some times exceed 10 klicks per sec.

Do yourself a favour, add friction.

Off the top of my head you could modify F=m/a to become F=(m*(1+log(v)))/a.

Okay thats strght out of thin air, but what it will do is you to require greate and greater force to accelerate your ship at higher velocites.

just my 2 cents

D.V.

Carpe Diem
D.V.Carpe Diem
How the ships maneuver and how friction is applied contributes not only to the playability but the fun factor as well. A little slide and strafe ability might not be a bad idea, either. Independence War 2 implemented that style.

For lighting, a nearby star that sends global light in a single direction should light things up well enough - even more than one star shining at different intensities from different directions might make things interesting.

Oh, and try to make your energy shots act as light sources for the nearby objects. It might make the dogfights a little more exciting. Try guided weapons like missiles, too!
It's not what you're taught, it's what you learn.
inertia dampening as a limiter to acceleration also gives resource management game elements.

it accounts for being able to acclerate faster to go forward then you can to turn. but lets say you the player can control that prior to battle.

i mean basically you have to put the sci-fi back into space combat to even have a dog fight so that really gives you license as the game designer to do what ever you want.

even with the friction whos to say that its not related to the technology required to make this all happen. i mean if a gravity/inertia field is required in the first place to even have space combat whos to say that doesnt also have a tendency to bring the effected objects to rest? and whos to say thats not affected by velocity? so i agree with the spirit of the above.

your wide open here. add what you need for fun.

My attitude is there is [virtually] no friction in space, but I just got the latest auto-braking retros, w/ programmable braking action in the absence of thrust.

So it behaves somewhat like friction, but is simply an auto-reverse-thrust (energy-consuming!) that enables easy movement in for example the confines of a space dock.

I would use a bit less of it in a dog-fight scenario, and totally disable it for long flights.


Otherwise the physics seems pretty standard.

zin

zintel.com - 3d graphics & more or less
zintel.com - 3d graphics & more or less
I realize the fact that space fights are pure sci-fi, but i don''t want to implement the complex physics of earthly (gracitational) flight.

After looking into examples i think the physics effect i''m looking for is somewhat like that seen in Descent II. The difference is that Descent II is optimized for rapid quick movements in an indoors environment, but some things are like what i want.

What i see the game as is a first person fighter flying fast, doing dogfights and attacking giant ships (50 times larger). For a dog fight i need a wind resistant style friction, the faster you go the more strongly it slows you. It also needs to be able to bring you to a stop over a medium distance. I think a fractional quadratic friction factor would do this. Also i want turns to be like they are in real planes, you have to be moving forward to turn. Also the faster you go the smaller the turn degree, the bigger the radius. I''m not really sure how to do this. I think that i could have a double that represents the maximum turn degree at the current speed, and this could be applied to controlling the turn in any direction. I think i could use this to caclulate total G''s ecpierienced by the pilot, so i could implement effects like temporary black outs on extreme turns (i saw this in a fighter sim).

How does my system for controlling turn look to you? Do you have any other comments? Also i''m still open to suggestions on the lighting.







He who said money was the root of all evil knew little of the nature of money and less about the nature of man.
Ambassador: Mr. Bush are you stoned or just really, REALLY dumb?Pres. Bush - I assure you I am not stoned.
doing it like its done in real physics.

if your moving along a (0,5,0) per a second velocity and you want to be going (0,6,0) per second you accelerate right?

but also if you want to be going (2.5,2.5,0) per a second in velocity you accelerate.

any change of the velocity vector is an acceleration. Turning is accelerating.

Point your thinking? implimenting an acceleration vector gives you the turning radius effect you want.

for example lets say i want to change my velocit of (0,6,0) to (3,3,0) in a curved manner over 6 seconds. a turn. to do that an acceleration vector of (.5,-.5,0). is needed. note that you can control how tight people can turn by just limiting the magnitude of the acceleration vector. higher magnitudes make for tighter turns. lower magnitudes make for wider turns.
note that if at time 0 your position vector is:
(0,0,0) 0 time
(.5,5.5)p (.5,5.5)v
(1.5,10.5)p (1,5)v
(3,15)p (1.5, 4.5)v
(5,19)p (2,4)v
(7.5,22.5)p (2.5, 3.5)v
(10.5,25.5)p (3,3) v

a curve through space caused by a constant accleration. complex behavior from simple rules. oh btw did you ever hear my conclusion that the universe was the greatest demonstration of the power of ALife known. oh wait now you did.

actual space number crunching uses concepts related to the above + a concept of "jerk" jerk is the speed at which acceleration is changing / can change. which if applied to the above makes an even more curvy curve.



oh you asked how do i make a turn tight when they are slow and a turn wide when they are fast? acceleration vector has that effect.


lets say your max accleration magnitude is 4. .

now lets say your velocity vector is (0,20) straight out. but you want to turn 45 degrees to make your velocity (10,10). well the fastest you could do it is 13ish seconds.

now lets suppose your velocity vector is (0,10) but you want to turn 45 degrees to (5,5) well the fastest you could do it with the same acceleration is 3.5 seconds.

the first will show a big turn with the same small accleration. the second will show a smaller turn.

the math does get harder with a frictional force. but you dont need to actually solved the frictional + velocity + acceleration + jerk equation till you want to predict things. the the frictional addition will cause you to crunch some numbers to get an accurate interpolation. course most things use a "lets ignore the fact that hes accelerating / decelerating due to friction" and just interpolate based on his current velocity. thats easy.





This topic is closed to new replies.

Advertisement