Jump to content

  • Log In with Google      Sign In   
  • Create Account


Space game graphics with Depth perception


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
20 replies to this topic

#1 FromShadow   Members   -  Reputation: 145

Like
0Likes
Like

Posted 07 November 2012 - 02:23 PM

Hi everyone,

so I'm working on a third person space shooter in XNA. The idea is to immerse the player in large scale battles with ships of different sizes and shapes, ranging from small interceptors to huge battle stations. So far i've primarily worked on the engine and i'm pretty happy with the results.

For the graphics, I have only a Sky box, (very) basic ship models with diffuse lighting and some basic fog.
My goal is to have a nice star background and to give the player a good perception of the other ship's 3D position/trajectory.

So my question is, what do I need for that?
Should I just add loads of fog? If so, what color should it have? white fog looks ugly when it's blended over my dark skybox. black fog works betters but all it does is smooth out my far clipping plane.
Many space games seem to have static "stardust" that doesnt move so the player has a sense of his motion. But I can't spawn millions of particles all over space, and generating them around the player seems costly too.
Also, games like Eve:Online don't look like they have skyboxes. distant stars seem to be light sources and have lense/flare effects, does that mean I need a full 3D galaxy model?

appreciating any insight!

 

 

Attached Thumbnails

  • Space 2012-11-07 20-51-15-14.png
  • Space 2012-11-07 20-51-23-06.png


Sponsor:

#2 BagelHero   Members   -  Reputation: 1389

Like
1Likes
Like

Posted 07 November 2012 - 03:23 PM

Right now I can't help but thinking straight black is a bad idea. Perhaps a very dark tone of blue/purple might be better? If you offset the tone from pure black, then it might be possible for fog to work in a lighter tone; eg Black-Purple with Purple-Orange haze (Random example; I don't suggest actually using that).

In relation to the ships position/trajectory, it would probably help to give them a good silhouette. If you can identify the class of ship from a distance you'll probably be able to tell what direction they're facing. Harder to sort out in the non-final stages, I suppose.
In terms of speed and distance, Perhaps some sort of "landmark" stars and planets might help somewhat?

That said, I'm working with a knowledge of 2D works, not effects, and it may not help at all. I'd like to help more, but I can't pretend to know what I don't, haha. I do hope someone can help you though!

Edited by BagelHero, 07 November 2012 - 03:24 PM.


#3 Tobl   Members   -  Reputation: 363

Like
1Likes
Like

Posted 07 November 2012 - 04:00 PM

Hello,

Some guys a semester below me at my university just finished this for a little sideproject
Starry Sky
The fog is basically just a continuous stream of circles, coloured according to a certain scheme, getting larger and more transparent with time until they disappear. If you're really interested in implementation, I could get you their email-adresses, but for now, maybe it's just good for a little inspiration.

bw,
Tobl

Edited by Tobl, 07 November 2012 - 04:01 PM.

Think my post was helpful? Want to thank me? Nothing easier than that: I sure am are a sucker for reputation, so just give it a little keycode 38 if you like. ^^

#4 FromShadow   Members   -  Reputation: 145

Like
0Likes
Like

Posted 07 November 2012 - 04:53 PM

Right now I can't help but thinking straight black is a bad idea. Perhaps a very dark tone of blue/purple might be better? If you offset the tone from pure black, then it might be possible for fog to work in a lighter tone; eg Black-Purple with Purple-Orange haze (Random example; I don't suggest actually using that).


Sounds good, I just tried making the skybox translucent and putting different colors underneath. blueish tones really look better than black.

In terms of speed and distance, Perhaps some sort of "landmark" stars and planets might help somewhat?


What I am wondering is wether you add those landmarks as 3D objects, or do I blend them into my skybox?
While I can't go for top-notch graphics (I'm doing this for fun), I wonder how game devs go about this.

Some guys a semester below me at my university just finished this for a little sideproject
Starry Sky
The fog is basically just a continuous stream of circles, coloured according to a certain scheme, getting larger and more transparent with time until they disappear. If you're really interested in implementation, I could get you their email-adresses, but for now, maybe it's just good for a little inspiration.

Cool project, maybe one could do something similar in 3D with a particle engine. Maybe not for large-scale fog, but it could produce some nice engine trails, I imagine. Hope I can go about that later. Posted Image

#5 3Ddreamer   Crossbones+   -  Reputation: 3103

Like
1Likes
Like

Posted 08 November 2012 - 11:19 PM

Hi,

A few space stations or outposts would be cool and add depth perception, I feel. How about an asteroid belt for positional reference? Real outer space has some bright objects like red giant stars, nebulae, novas, and super novas. These could be made sprites or stationary textures and would look okay if the wall of the skybox is far enough from the viewer.


Clinton

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software.  The better the workflow pipeline, then the greater the potential output for a quality game.  Completing projects is the last but finest order.

 

by Clinton, 3Ddreamer


#6 phil_t   Crossbones+   -  Reputation: 3234

Like
0Likes
Like

Posted 09 November 2012 - 10:36 PM

Many space games seem to have static "stardust" that doesnt move so the player has a sense of his motion. But I can't spawn millions of particles all over space, and generating them around the player seems costly too.


I actually think this could be a good solution to create the illusion of movement as your travel through it. You certainly don't need millions - a few thousand should do, and be cheap performance-wise.

You can use an infinitely repeating cube of particles that "scrolls" with the camera like is commonly done for precipitation (see "Dynamic Weather Effects" in Shader X7 for an example of this).

#7 Waterlimon   Crossbones+   -  Reputation: 2435

Like
1Likes
Like

Posted 10 November 2012 - 05:34 AM

You could also add some "virtual" information added by some ship computer which could approximate distances, directions and velocities with transparent lines/grids/whatever looks cool

Like if you are traveling fast it might make it look like you are going in a tube of sparsely placed virtual circles (the aster they come the higher speed)


o3o


#8 FromShadow   Members   -  Reputation: 145

Like
0Likes
Like

Posted 11 November 2012 - 06:02 AM

Thanks guys, you have been really helpful. I'm getting a copy of ShaderX7 from amazon.
Also adding some Heads Up Display of ship information is a great idea and would be cool and helpful at once.

Edit: I added a particle engine now and I found engine trails to work really good for that "3D-feel". Trying to add star dust now.

Edited by FromShadow, 13 November 2012 - 02:31 PM.


#9 Norman Barrows   Crossbones+   -  Reputation: 1991

Like
2Likes
Like

Posted 16 November 2012 - 01:35 PM

lack of visual orientation cues (which way am i headed, and which way is up?) are your problem.

been there - done that.

i've done both faster-than-light and sub-light flight simulators. the best method will depend on the speed of the ships, but for both methods:

1. fog:
lose the fog. there's no fog in space, and fog is cheating. it should be possible to draw everything to scale all the way down to one pixel in size before you hit the far plane (except maybe the skybox). as i recall, the solution there is to do a first pass where you draw the skybox, then a second pass where you draw everything that's supposed to be inside it. that way the skybox is always in back, and the ships, planets, etc are in front of it. as i recall, a very large far clip plane was required for both games, perhaps something on the order of 10000 units, vs the more typical 1000 (assuming a near plane of 1). once you're done, you might toss in some fog or AA to soften it a bit. but higher rez sharper graphics with dramatic lighting are what you really want in a space sim. hi rez realtime raytracing is the holy grail of space sim graphics.

2. skybox:
put stars on the skybox. animated skybox textures can be used to make all the stars in the sky twinkle.


3. visual orientation cues:
to aid in orienting the player (very important in a space fighter sim), draw distant galaxies just inside the skybox in the 6 cardinal directions (up, dn, left, rt, fwd, back). you can also add additional distant galaxy graphics to "fill out" empty areas of the sky. (warning: distant galaxy graphics are cool and addictive, its easy to go overboard). you can also use animated textures to do distant sparkling stars etc, instead of distant galaxies. each of these unique stationary distant objects acts as a landmark to help the player get their bearings. if the battle occurs near a spaceport, planet, asteroid belt or other "terrain object" in space, draw that too.

4. lighting and shadows:
don't forget lighting. lighting is everything in a space scene. lots of diffuse, very little ambient. lots of well defined shadows. its should look sharp, and harsh, and stark, not soft, fuzzy, and foggy. although difficult to do, realistic shadows will do wonders to provide visual orientation cues.

5. if your ships are supposed to be travelling faster than light:
use a particle system of streaming stars around the ship. 100 particles in a box area in front of the camera should do it. this gives you the star trek streaming stars effect. i used this method to good effect in my star trek flight simulator (SIMTrek / SIMSpace). the particles are actually lines with a head and a tail, whose length is a function of the light speed (faster = longer tail). put stars on the skybox. the motion of the stars as you move and turn gives an excellent sensation of movement.

6. if your ships are travelling at sub-light speed:
throw in the odd streaming small asteroid (al la wing commander) to enhance the feel of forward motion. this again is a particle system, but maybe only 10 or 20 particles, drawn as asteroid billboards or models. i used this method (skybox, distant galaxies, starbases, planets, etc - but no animated textures) to good effect in my space fighter simulator (Gamma Wing).

once you have all that you can add nebulous clouds etc with translucency, either as an inner skybox layer (moves with the camera) or as objects that you fly past / though.

as mentioned in other replies, a HUD helps for those players comfortable flying on "Instrument Flight Reference".

as you've also noticed by now, those flames coming out the engine cones help a lot. don't forget to animate them! <g>

Good luck, keep at it, looks cool.

Norm Barrows
Rockland Software Productions

Norm Barrows

Rockland Software Productions

"Building PC games since 1988"

 

rocklandsoftware.net

 


#10 3Ddreamer   Crossbones+   -  Reputation: 3103

Like
0Likes
Like

Posted 16 November 2012 - 06:16 PM

fog:
lose the fog. there's no fog in space, and fog is cheating.
I agree totally.


2. skybox:
put stars on the skybox. animated skybox textures can be used to make all the stars in the sky twinkle.
I disagree totally with the twinkling. Stars only twinkle if there is atmosphere or maybe a "space dust" cloud dense enough to cause it when the ship is moving.


Posted Image


Clinton

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software.  The better the workflow pipeline, then the greater the potential output for a quality game.  Completing projects is the last but finest order.

 

by Clinton, 3Ddreamer


#11 Norman Barrows   Crossbones+   -  Reputation: 1991

Like
0Likes
Like

Posted 18 November 2012 - 09:19 PM

"stars only twinkle if there's atmosphere"

good point.

ok, lose the animated skybox in deep space scenes.

that means fewer textures, a good thing.

Norm Barrows

Rockland Software Productions

"Building PC games since 1988"

 

rocklandsoftware.net

 


#12 3Ddreamer   Crossbones+   -  Reputation: 3103

Like
0Likes
Like

Posted 18 November 2012 - 09:46 PM

As for stars, using pixel shading can increase performance over using a skybox, if only stars are needed in the distance.



Clinton

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software.  The better the workflow pipeline, then the greater the potential output for a quality game.  Completing projects is the last but finest order.

 

by Clinton, 3Ddreamer


#13 Prinz Eugn   Crossbones+   -  Reputation: 3560

Like
2Likes
Like

Posted 19 November 2012 - 03:41 PM

For visual orientation, you could use a Milky Way effect (which also happens to be perfectly realistic). It would be big cloudy band 360 around the player to give them a sense of what's "level". You could then put a galactic core on one end, thin it out on the other to give a sense of direction, and do something like Norman Barrows was saying and put (for example) a brightly colored nebula 'above', and a pure white-ish galaxy in the distance 'below'.

-Mark the Artist

Digital Art and Technical Design
Developer Journal


#14 FromShadow   Members   -  Reputation: 145

Like
3Likes
Like

Posted 25 December 2012 - 02:54 PM

Thanks for the answers. I see now that fog really was the wrong approach.
I have worked on the suggestions and thought I'd share the results:
  • I had a hard time drawing a Skybox myself, mostly due to parallax errors in the corners and my inability to mask the transitions at the edges. For anyone searching, try Spacespace (http://alexcpeterson.com/spacescape). It does the job beatifully and I'm glad I stumbled on this. For the time being, I could get away with a single rendering pass, since there are no distant objects and the skybox is 10000 big, as suggested.

  • The Skybox helped with orientation in a relative manner, like you can tell which way you are turning/looking. But what I needed was an absolute reference point, so I followed Prinz Eugn's advice and added a milky way band all arround one axis (It's actually tilted, but there is no way to notice, which I'm pretty happy about). The galaxy is additively blended over the background which works great.

  • The galactic core on the side of the sky box further helps with orientation. I made it really bright and added directional lighting. sharp lighting really is the way to go, I more than doubled the intensity and it looks good. smile.png

  • HUD: For now I added a line for each ship to indicate its current target. There is a lot to be done, like showing the estimated flight path (which should be curved rather than straight). Right now it is a wirefrime line, but I would want it to be a translucent and add a subtle glow effect.

  • Particles: Added a threaded particle system. This makes things come to life, I added basic explosions and engine trails, but they are really ugly because I can't draw ;). I am working on that "star dust" thing right now, which will be hard because I cannot reposition particles right now to implement an infinite scrolling cube, only spawn new particles.
I attached a few screenshots.

Attached Thumbnails

  • Space 2012-12-25 20-51-01-41.png
  • Space 2012-12-25 20-51-25-01.png
  • Space 2012-12-25 21-00-47-53.png
  • Space 2012-12-25 21-08-27-45.png

Edited by FromShadow, 25 December 2012 - 02:57 PM.


#15 3Ddreamer   Crossbones+   -  Reputation: 3103

Like
1Likes
Like

Posted 26 December 2012 - 05:24 PM

Oh, I feel that you are on the right track!  It is really coming together.smile.png  

 

Be careful of "feature creep".  The star seems a bit too bright for my liking, but maybe that's only my opinion.  Many objects in the field of view will lose some people, but I actually like the challenge.

 

The choice of colors is wonderful!  Keep up the good work!


Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software.  The better the workflow pipeline, then the greater the potential output for a quality game.  Completing projects is the last but finest order.

 

by Clinton, 3Ddreamer


#16 Norman Barrows   Crossbones+   -  Reputation: 1991

Like
1Likes
Like

Posted 13 February 2013 - 05:59 PM

HUD: For now I added a line for each ship to indicate its current target. There is a lot to be done, like showing the estimated flight path (which should be curved rather than straight). Right now it is a wirefrime line, but I would want it to be a translucent and add a subtle glow effect.

Particles: Added a threaded particle system. This makes things come to life, I added basic explosions and engine trails, but they are really ugly because I can't draw ;). I am working on that "star dust" thing right now, which will be hard because I cannot reposition particles right now to implement an infinite scrolling cube, only spawn new particles.

 

Looks beautiful!

 

You're definitely getting there.

 

 The stars do look a smidge on the bright side, as mentioned elsewhere.

 

I myself like the busy screen, reminiscent of scenes from star wars. More action than the player can track can help with immersion. Although too much can lead to confusion and then frustration. 

 

For the HUD, have you considered the horizontal and vertical onscreen compass displays used in early HUDs on fighter aircraft? With a big giant compass down the left side reading 10 degrees up pitch and another one across the top reading a heading of 270, its hard not to tell which way you're going.

 

re: particles:

I assume you mean you have yet to implement moving particles and only have stationary types. 

if so, and you keep different types of particles in the same array (linked list etc) with a type field (rock, explosion, etc), then the moving cube is easy to implement using your current array. define a new type: moving_particle (or whatever). create  100 or so at random locations in a cube around the ship. each frame, call a routine that moves the moving_particles towards the back of the ship by an amount based on the speed of the ship by changing the x/y/z position. when they reach the back of the cube, generate a new random position at the front face of the cube. in a left hand coordinate system in object space this would be moving them in the -z direction, then regenerating them at the positive z face of the cube, at a random x,y location on that face. This is probably the best way to implement it, in object space. when it comes time to draw, you have a nice cubic particle field surrounding the ship already specified in object space coordinates. for each particle, simply apply the ship's world transform to move it out to the ship's position and orientation, then draw as usual.

 

for drifting space dust, you may want to consider alpha blended billboards or some other technique that lets you represent more than one chunk of dust with a single particle to keep the overhead of the particle system down. but try it first and see. Like Michael Abrash said at the '96 Gamedev conference lecture on the Quake engine, computers are really good at doing the same simple thing (like moving a particle) lots of times in a row really really fast. the problem is that graphics cards are not good at drawing large numbers of batches of just a few dynamic triangles per batch, which is exactly what games do and need. vidcards are good at the opposite, drawing a few batches of a vary large numbers of static triangles. So 10,000 particles may be doable, but not drawable. OTOH, I've gotten pretty good results on the infamous "10,000 blades of grass" challenge in my current project on a baseline PC with just an on-board graphics chip, so the horsepower may be out there to go stardust crazy. Note however that i'm definitely not using one triangle per blade of grass, something more like 2500 triangles to draw 500 meshes with grass blade textures, and yes, they do move! 

 

stardust - grass blades.  swaying - drifting.  same idea - different texture.

 

 

can't wait to see the next round of screenshots!


Norm Barrows

Rockland Software Productions

"Building PC games since 1988"

 

rocklandsoftware.net

 


#17 BCullis   Crossbones+   -  Reputation: 1813

Like
1Likes
Like

Posted 14 February 2013 - 11:51 AM

I don't have anything to add, I just wanted to mention how gorgeous the new screenshots look with that skybox thrown in.  That's some great stuff right there.


Hazard Pay :: FPS/RTS in SharpDX
DeviantArt :: Because right-brain needs love too

#18 Norman Barrows   Crossbones+   -  Reputation: 1991

Like
0Likes
Like

Posted 15 February 2013 - 08:46 AM

for each particle, simply apply the ship's world transform to move it out to the ship's position and orientation, then draw as usual.

 

actually, i think you want to translate to ship position, but NOT rotate to ship orientation. that way when you turn, the particles don't turn with you.

or maybe not, have to think about that. been a long time since i did this effect. but it is possible to get a ship that flies and turns through a star field (space dust, whatever) just like in Star Trek.

 

anyone else out there remember how to do this?


Norm Barrows

Rockland Software Productions

"Building PC games since 1988"

 

rocklandsoftware.net

 


#19 Norman Barrows   Crossbones+   -  Reputation: 1991

Like
0Likes
Like

Posted 15 February 2013 - 08:53 AM

I don't have anything to add, I just wanted to mention how gorgeous the new screenshots look with that skybox thrown in.  That's some great stuff right there.

 

 

actually i think its the dramatic lighting the really makes the difference.

 

the skybox is to die for (although the flare is strong).

 

but imagine the foreground from the first screen shots with the new skybox. its the lighting that makes the real difference, although you don't notice it unless you think about it. Lighting is everything. I used to do raytracing before i got into realtime 3D. I'm still waiting for a realtime raytracer graphics engine.


Norm Barrows

Rockland Software Productions

"Building PC games since 1988"

 

rocklandsoftware.net

 


#20 BCullis   Crossbones+   -  Reputation: 1813

Like
0Likes
Like

Posted 15 February 2013 - 09:28 AM

I don't have anything to add, I just wanted to mention how gorgeous the new screenshots look with that skybox thrown in.  That's some great stuff right there.

 

 

actually i think its the dramatic lighting the really makes the difference.

 

the skybox is to die for (although the flare is strong).

 

but imagine the foreground from the first screen shots with the new skybox. its the lighting that makes the real difference, although you don't notice it unless you think about it. Lighting is everything. I used to do raytracing before i got into realtime 3D. I'm still waiting for a realtime raytracer graphics engine.

You're right, I didn't notice it because it just "looks right".  But those shots from "beneath" the shaded side really highlight what you're talking about.
Either way, bravo OP!


Hazard Pay :: FPS/RTS in SharpDX
DeviantArt :: Because right-brain needs love too




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS