A call for Garbage

Thinking about improving the Artwork in Vega Strike, or making your own Mod? Submit your question and ideas in this forum.

Moderator: pyramid

chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

A call for Garbage

Post by chuck_starchaser »

Quality garbage, though... :D

Seriously. I'm starting a Blender file of nothing but garbage and space salvage. Here's the background to this crappy project:

Many, many times there have been posters asking for "space dust" in Vegastrike to serve as speed reference, like in Privateer; and I've been rudely shooting down their requests. My arguments were:

A) There IS not much dust in space to speak of.

B) At the speeds you travel it would pass you so fast you wouldn't see it anyways.

C) A 6-32 hex nut would probably go through your ship before it impacts your retina.

D) There are no speed references in space, so if you want to play a space game, get used to it.


Anyhow, lately a few counterarguments popped up in my head out of the blue:

A) In the Fourth Millenium, after spacefaring for generations, and being engaged in space mining and combat, maybe there would indeed be tons of orbiting crap around most planets. Most of it would be on the plane of the ecliptic, and ship navigation routes would avoid the thick of it. Morover, there'd be specially high densities of garbage around space mines and stations, due to human activity. The gravitational force for for a space station is so small that garbage orbiting it would probably take years to complete a revolution around it. For practical purposes, it just floats there.

B) Most space stations being on the ecliptic plane, you would slow down when approaching one, to avoid getting damage from floating crap. So you'd actually fly slowly enough to see the crap.

C) The shields would definitely help deflect 6-32 hex nuts, and even crowbars. But you'd still want to slow down in case you run into an old fridge, or a piece of ship hull.

D) Having to slow down when approaching space stations would help us appreciate their size. If you see the station growing in size very slowly, but the crap is hitting your windshield like bullets, you'll get the idea that the station is huge.


Here's the plan: Programming-wise the garbage field would be a cube or sphere around your ship where garbage is randomly spawned far ahead and deleted far behind of you. As we approach a space station the density of the crap, and the size of individual pieces, is increased gradually. It would never get so dense as to see more than one item at a time up-close, though the random distribution might allow you to see 2 or more items close together once in a blue moon. Ideally you wouldn't see an item of one type twice in a trip, or even in two consecutive trips, so we need a lot of little things.

Graphics-wise, each piece of garbage would have a single lesser LOD being a simple tetrahedron (4 triangles), so we can start showing a piece of garbage from such a distance as it's sub-pixel in apparent size. Approaching a station from the distance would show like a subtle "halo" around it. I can do that with a shader, now that Ogre integration is imminent. As you get closer and enter that halo, we fade in a "fog" effect, simply by turning on depth fog, in OGL, which substitutes for crap too far away to see as individual items, or even dots.

Implementation-wise, I'm thinking of keeping all the garbage in one bfxm that includes, say, 200 small meshes, so we don't overwhelm the user's hard disk drive --seeking tiny files all over the place. Once the bfxm is in the videocard's memory, all the garbage we'll ever need is there. All the meshes would be unwrapped onto a single texture, 1k by 1k. No reflectivity, radiosity baking or bump-maps here, come on! :) The total triangle count ideally would be under 5k, so it doesn't load the graphics pipeline any more than having one extra fighter in a scene.I'm also thinking of having 4 categories of frequency and variety, versus size and potential damage to your ship:

1) Tiny Filler Crap:

Very numerous meshes, say 100, in this category, but unrecognizably small and simple shapes, squares, triangles, long rectangles, L-shaped things, half a cube (3 sides), etceteras. They'd be also randomly scaled on one axis or another, and randomly colored, upon spawning, so as to increase their apparent variety. They'd be the most common crap, as well, and would do nothing at all to your ship when you "hit it", or even make a sound; --i.e. purely graphical.
If they average 10 triangles each, these 100 meshes add to 1k triangles.
This category is excempted of having a lesser LOD, as their triangle count is way too small to justify it.

2) Special Tiny Crap:

These would be textured and not changed in color or size by spawning.
They'd be fewer in numbers, say 30 meshes, and would be shown much less frequently than the filler variety of crap.
A running shoe, a boot, a banged up helmet, paper cups, McDonald's styrofoam containers and burger boxes, brooms, spent munition shells, rusty mufflers, a mattress, a lawn chair, pink flamingos, whatever. If we keep the average tri-count to about 33, 33 triangles x 30 meshes = 1k tris. So, we're up to 2 k.

3) Not so tiny crap:

Seldom shows up but if you're speeding when it does it might take out a shield or even damage your armor; and if you're not speeding it might still make a sound when it hits your ship. Still pretty simple in terms of geometry, and not necessarily bigger, but surely more massive. Could include a fridge, an anvil, a warped I beam, an excavator shovel, a gas tank, radioactive and toxic waste barrels. A dozen such items at 83 tris average will take another 1k tris out of our budget. We've got 2k tris left to play with.

4) Space Salvage:

This category would number say 14 item types of 142 tris average, thus the remaining 2k tris. They should look like technical junk, that is, greeblish, representing the insides of destroyed ships. Unlike the other categories, they'd be targetable and have a nominal market value if tractored in. They might even include random assortments of spare parts if your ship is damaged and you have a repair bot. They'd serve another purpose too: To show behind holes left in the armor of ships when damaged in combat, so they really need to look like the stuff you'd see inside a ship: Framing, pipes, electrical boxes, tanks, whatever.

So, that's it: 5k tris.

Actually, we've gone a bit overbudget due to the LOD's for categories 2 through 4. 30 + 12 + 14 meshes = 56 meshes. 56 x 4 triangles per LOD comes to 224 tris, so the real grand-total is 5224 tris :D

To the above categories I'd add a Category 0 (zero) being a particle system to represent garbage too small to see in detail even when it hits your window.


Standards:

Mesh contributions to be 1 Meter per grid unit. Wavefront .obj. + .mtl.

Textures... 1 cm square pixels, typical. I'm thinking, if we were to divide a 1k by 1k texture into 64 squares, for simplicity (we have 56 textured meshes total), that's 8 rows x 8 columns. 1024/8=128, so each texture could be 128x128 on average, --some 64 x 64, some 256x256. Let's use a png with alpha channel, though, so we can put holes on the meshes using transparency, to increase the apparent complexity.

Conclusion: Asking for space dust to serve as speed reference remains a bad idea any way you look at it: Inconsistent with the reality of space, can't be "stationary" since there is no way to define the term --with respect to what?--; would fail to serve its intended purpose as our speeds are too high to see it; and the goal of having a speed reference in space is unwarranted. But garbage near space stations, space factories and mines, as well as ship leftovers are more justifiable. As we slow down to dock with a station we are traveling slow enough to see it. It is stationary relative to the station it orbits, and/or relative to the orbit it traces around the planet, which is roughly the same orbit we're on when approaching a station. And it provides us with a speed reference *when* we actually need one in order to appreciate sizes and scales: near our departure and destination points.

Politics and conspiracies:
In spite of continuous public education campaigns, space garbage continues to accumulate. Is the public really at fault, or the public sector?
Landfills on Earth are already overflowing in early 21st century; imagine in the timeframe of Vegastrike. With virtually free costs for lifting stuff to orbit due to fusion energy and space elevators, there's every incentive for local politicians and industry polluters to ship their crap up to geo and let go of it there, while whistling...

Comments and suggestions welcome before work begins.
Last edited by chuck_starchaser on Fri Nov 25, 2005 9:36 am, edited 2 times in total.
zaydana
Site Administrator
Site Administrator
Posts: 478
Joined: Thu Jan 02, 2003 10:05 am
Location: Perth, Western Australia
Contact:

Post by zaydana »

hmm, just one thing. You said, programming wise, there would be a certain area where things get spawned and removed depending on your velocity... maybe you shuld have a seperate area for each size of junk. Something makes me feel that the larger junk you will want to spawn earlier and destroy later.

Also, the other thing is you might want to make the size of the area where things get spawned/deleted dependant on the quality of the sensors in somebody's ship, for the targetable stuff anyhow. This would give the impression that a better radar picks up junk earlier :P
Culture20
Merchant
Merchant
Posts: 61
Joined: Wed May 05, 2004 2:34 am

Post by Culture20 »

Hmm... could an enterprising captain use some tractor beams to "mine" the garbage field, or perhaps accelerate it at an enemy?
CoffeeBot
Intrepid Venturer
Intrepid Venturer
Posts: 676
Joined: Wed Jul 06, 2005 5:25 am
Location: On the counter by the toaster
Contact:

Post by CoffeeBot »

Culture20 wrote:Hmm... could an enterprising captain use some tractor beams to "mine" the garbage field, or perhaps accelerate it at an enemy?
Probably so. One of the next steps is to make starship garbage that appears when a ship is destroyed. This way, you can salvage things from ships you've destroyed (as was mentioned in another recent thread) without having the lameness of actual, identifiable guns floating away from the point of destruction.

My thought concerning those would be to have the salvage act as a container, that until you get to a base and inspect it, you don't know what you've got. Larger ships would probably have the ability to inspect the salvage once it's aboard. Once it's inspected, you can remove the various parts, and whatever's left you can sell (cheaply) as scrap.

Ideally, I'd love to see the scrap models be created from the actual ship models, so that when you blow up that pesky hyena, you see identifiable pieces, like a wing and cockpit canopy, floating away. Of course, this would be a massive project in and of itself, and there may be technical/coding restrictions that prevent it from even happening in the first place (which may explain why Ive never seen it in a game, before)
hurleybird
Elite
Elite
Posts: 1671
Joined: Fri Jan 03, 2003 12:46 am
Location: Earth, Sol system.
Contact:

Post by hurleybird »

I think ideally you could expand this idea to include graveyards from old battles, or the occasional derelect.

I imagine that after a large battle, scavengers would come to try to salvage any wreckage, and they could be fairly competitive and protective of their finds as well!
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Sure, I remember fondly the ship graveyard level in Homeworld... Anyhow, there's nothing to stop us from adding identifiable ship type pieces, graveyards or derelicts; or from having one or more scavenger factions. But having a basic garbage code and dataset ought to be the first steps on the jurney. A "Garbage Framework".
Any thoughts on the format? Are the numbers right? Is 5K too many tris?, or am I being too cheap? Should we use 512 x 512 for the texture, instead? Is this going to be a nightmare to unwrap? Any modellers here willing to contribute? Any texturers willing to help? What about code? Klauss, your thoughts?
hurleybird
Elite
Elite
Posts: 1671
Joined: Fri Jan 03, 2003 12:46 am
Location: Earth, Sol system.
Contact:

Post by hurleybird »

Why not lod it and have 512 and 1024, and maybe even 2048 textures?

Lower detail settings only load lower lods while higher detail settings would only use higher lods, because of relativley short distance in this situation, there would be no need to load more than one lod for a particular detail setting.
CoffeeBot
Intrepid Venturer
Intrepid Venturer
Posts: 676
Joined: Wed Jul 06, 2005 5:25 am
Location: On the counter by the toaster
Contact:

Post by CoffeeBot »

I would think that for the generic "spawn around the ship" garbage, the number of tris should be fairly low, and the textures simple -- no one is really going to be taking a lot of time to look at them.

Salvage could be a bit higher, and derelicts could easily have the same number of tris as their "living" equivalents.

Frankly, I'd like to see people take over derelict stations and cap ships to use as hidden bases, but that's a different thread, isn't it?
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

hurleybird wrote:Why not lod it and have 512 and 1024, and maybe even 2048 textures?

Lower detail settings only load lower lods while higher detail settings would only use higher lods, because of relativley short distance in this situation, there would be no need to load more than one lod for a particular detail setting.
I think we have more leeway with tri-count than we do with texture. A 2040 texture has 4 megs of pixels, and each pixel is 4 bytes (Red, Green, Blue and Alpha). That's a whopping 16 megabytes. Less when compressed, but the videocard has to de-compress it when using it. So I think we could go 100% overbudget with the tris and never notice much of an impact, but high rez texturing could slow down refresh. At least that was my experience recently when I was texturing a ship. I was working on the master texture at 2048 and scaling it down to 1024 for in-game testing; then I decided to try it at full rez, and the refresh rate came down noticeably.

@CoffeeBot:
Very true: Salvage could be a lot higher in tri-count. And in fact, if it appears so rarely as it would, we might as well have a number of bfxm's dedicated to salvage pieces, in addition to garbage.bfxm. Having said that, I'd like to keep the salvage category as is. The two reasons being: (a) if there are large and complex pieces of salvage, there should also be small ones; and in larger quantities, as a matter of fact. And (b) the small pieces will be needed to put behind hull openings when ships get hit hard enough to lose pieces of hull. Those pieces of internals should be part of this garbage.bfxm, because that way they'll be in videocard memory already when they are needed.
hurleybird
Elite
Elite
Posts: 1671
Joined: Fri Jan 03, 2003 12:46 am
Location: Earth, Sol system.
Contact:

Post by hurleybird »

Chuck: Yeah, for 2048 (that texture is shared for every peice of garbage right?) I'm more thinking about future proofing than anything else, 1024 should be fine.
chuck_starchaser wrote:then I decided to try it at full rez, and the refresh rate came down noticeably.


Wow Chuck, that must have been one taxing texture! It even brought your monitor to its knees! I didn't know that was possible :lol:
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

You don't believe me? If that's the case I'd prefer you say so rather than use sarcasm. I really hate sarcasm; I think it's worse than calling someone names.
It was when I was working on the Demon for WCU, I posted about this before; you can find my earlier post with a search.
On the other hand, I have my antialiasing and anisotropy settings maxed out in the driver, overriding applications. If I didn't, probably it wouldn't be a problem. But then again many people will do so too. But basically what I was trying to say is textures impose a heavy cost in memory bandwidth due to their large sizes compared to geometry data. The way modern videocards work is you have a vertex shader pipeline, asynchronously feeding into a fragment (kind of "pixel") pipeline. The slower of the two will limit the performance of the other. The vertex pipeline transforms each vertex and computes per-vertex values. Then the pixel pipeline does the pixel by pixel painting with texturing and per-pixel lighting. But there are many more pixels than vertexes in a typical scene, and for each pixel you're reading typically a dozen texels for each of about 3 to 6 textures. Turns out that even if both pipelines have the muscle to deal with large textures, memory doesn't. When memory becomes the bottle-neck, the pipeline that's going to suffer the most is the fragment shader pipe.
hurleybird
Elite
Elite
Posts: 1671
Joined: Fri Jan 03, 2003 12:46 am
Location: Earth, Sol system.
Contact:

Post by hurleybird »

Heh... sorry chuck, I was just making fun. You mixed up refresh rate and FPS , refresh rate is measured in Hz and it is the amount of times your monitor blinks on and off per secound, which is completely different from frames per secound (the amount of frames you can draw per secound).

...Just as an educational side note for anyone who may be interested, any FPS thats above your refresh rate wont show, and can result in tearing, which is why there is an option called vertical sync, or vsnc. This attempts to lock your FPS and refresh rate in a 1:1 ratio.
Last edited by hurleybird on Sat Nov 26, 2005 11:10 pm, edited 1 time in total.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Damn! You're right; I know the difference between FPS and refresh; just wasn't paying attention to the word I used.
hurleybird
Elite
Elite
Posts: 1671
Joined: Fri Jan 03, 2003 12:46 am
Location: Earth, Sol system.
Contact:

Post by hurleybird »

OT, but I have an amazing eye for refresh rates. I can recognize refresh rates up to 150Hz. This is kind of a curse, because 85Hz is mildly annoying, and 60Hz just kills me. Right now I'm running 120Hz @ 1280 x 1024, but I love it when I go down to the lower resolutions and can get even better rates.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Wow! I notice up to 90.
BTW, there's something with the engine and refresh rate. I've my videocard settings in Windooze for 1280 x 1024, 85 Hz; and I setup Vegastrike for 1280 x 1024, but the refresh goes down to like 60 when ogl starts.

Garbage update: We've got a dead cat, contributed by CoffeeBot. It was my special request, and stands at like 500 tris. I'm thinking of making it a separate file; I'd like to use a special shader for hair for it. Might include a few other furry things in that file, such as dead rats.
hurleybird
Elite
Elite
Posts: 1671
Joined: Fri Jan 03, 2003 12:46 am
Location: Earth, Sol system.
Contact:

Post by hurleybird »

Thats not a problem with the engine. Defaulting to 60Hz is a problem with windows. Download refresh force to solve the problem (but make sure that 'hide modes this monitor cannot display' is enabled in your display properties.

On topic: Dead cats in space... brilliant :)
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Well, Easter cats :)

But the thing is, we'll have dead rats too, so there's a logical thread... :D
Only in the vecinity of space elevator stations at food producing planets.
Presumably the cats chase the rats (or was it the other way around?) into air-locks at the wrong time, sometimes...

You'll see one once in a blue moon, and probably won't even realize it's a dead cat unless you fly to it very slowly till it almost touches your windows. Even then, looks all puffed up due to the death by vaccum, which makes your body fluids boil and vaporize...

Thanks for the link.
hellcatv
Developer
Developer
Posts: 3980
Joined: Fri Jan 03, 2003 4:53 am
Location: Stanford, CA
Contact:

Post by hellcatv »

space cats aside, interesting ideas chuck--these could be used for other debris field hazards like our current asteroid fields
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
CoffeeBot
Intrepid Venturer
Intrepid Venturer
Posts: 676
Joined: Wed Jul 06, 2005 5:25 am
Location: On the counter by the toaster
Contact:

Post by CoffeeBot »

For some of the random junk, I think I may load up bryce and generate some rocks and other stuff that can be exported as .obj, then fix them in blender. I'll have more in regard to this tomorrow night...er...tonight? I don't know, anymore.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

Chuck, I think the lowliest crap category could just be billboards. They're too small to notice any three-dimensionality. Billboards are much more efficiently handled, because they can be drawn in a single batch, so you could have hundreds of them on-screen (tiny dots, ultimately) as fillup.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Yes, for billboards I was actually thinking of using a vertex shader to randomize a basic shape. In fact, we could reserve a strip of the texture to have, say, 32 billboard textures, so the vertex shader can not only randomize the dimensions, but also pick one of those 32 textures at random, as well as output a random hue for the fragment shader to modulate the texture by.

Here's something to get the ball rolling. A few boxes...

Image

The little one is a cigarette box.
Here's the file:
http://www.deeplayer.com/dan_w/garbage/boxes1.zip
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Here's a set of simple, shader-scalable gizmos, including square and triangular billboards:

Image

The vertex shader for these will first scale the shape by random factors along x, y, z; then add normals and UV coords automatically, then pick 1 out of 32 textures for it, and finally issue a random hue to modulate the texture by.

And the file:
http://www.deeplayer.com/dan_w/garbage/scalable1.zip

Alright, someone pick up the ball...
Ryder P. Moses
Daredevil Venturer
Daredevil Venturer
Posts: 593
Joined: Mon Sep 26, 2005 3:59 am

Post by Ryder P. Moses »

Hm...

Howabout multiple cargo pod types, which are also scattered around randomly amongst the space trash? Little fuel tanks and cardboard boxes and spare parts that translate to a "junk" item. Randomly spawned 'system' ones wouldn't have much of value in 'em, but they'd be there for collecting or just plain crashing into. That adds to the amount of trash, means ships leave more random bits floating around when they blow up, and gives garbage a more direct function as salvage material for those very desperate merchants to whom a drum of raw sewage represents a monetary asset.

Oh, and I'm sure I have a space trash set lying around, though I suspect it's probably more big high-poly chunks of dead warships than discarded soda cans. I'll see if I can't dig it out.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Yeah, cargo pods are a good idea, since they are supposed to be standardized and there should be many per ship. Lowers file size... Does Vegastrike have a standard cargo container? I know PrivRemake does...

As for the ship bits, it seems to me we'll be separating them: We'll have a few, low-poly ship internals bits in the standard garbage.bfxm file, that we can use to put behind holes in armor, as well as add to generic garbage; and then another file dedicated to ship pieces and salvage. Any garbage that isn't generic garbage should be on separate files. Dead rats and cats, for example, would only be found around food producing planets' space stations. So, on approaching one of those we'd have standard garbage plus food-specific garbage. On approaching a mining base, we'd have standard garbage plus rocks and gravel and extra dust. On approaching a factory, standard garbage plus pieces of heavy machinery, machine tools, hand tools and factory materials.
This way, we only need 2 bfxm files loaded to generate situation-specific garbage fields.

So, for generic garbage bfxm, to quote myself, we have...
I wrote:1) Tiny Filler Crap:

Very numerous meshes, say 100, in this category, but unrecognizably small and simple shapes, squares, triangles, long rectangles, L-shaped things, half a cube (3 sides), etceteras. They'd be also randomly scaled on one axis or another, and randomly colored, upon spawning, so as to increase their apparent variety. They'd be the most common crap, as well, and would do nothing at all to your ship when you "hit it", or even make a sound; --i.e. purely graphical.
If they average 10 triangles each, these 100 meshes add to 1k triangles.
This category is excempted of having a lesser LOD, as their triangle count is way too small to justify it.
Image
2) Special Tiny Crap:

These would be textured and not changed in color or size by spawning.
They'd be fewer in numbers, say 30 meshes, and would be shown much less frequently than the filler variety of crap.
A running shoe, a boot, a banged up helmet, paper cups, McDonald's styrofoam containers and burger boxes, brooms, spent munition shells, rusty mufflers, a mattress, a lawn chair, pink flamingos, whatever. If we keep the average tri-count to about 33, 33 triangles x 30 meshes = 1k tris. So, we're up to 2 k.
Image
3) Not so tiny crap:

Seldom shows up but if you're speeding when it does it might take out a shield or even damage your armor; and if you're not speeding it might still make a sound when it hits your ship. Still pretty simple in terms of geometry, and not necessarily bigger, but surely more massive. Could include a fridge, an anvil, a warped I beam, an excavator shovel, a gas tank, radioactive and toxic waste barrels. A dozen such items at 83 tris average will take another 1k tris out of our budget. We've got 2k tris left to play with.

4) Space Salvage:

This category would number say 14 item types of 142 tris average, thus the remaining 2k tris. They should look like technical junk, that is, greeblish, representing the insides of destroyed ships. Unlike the other categories, they'd be targetable and have a nominal market value if tractored in. They might even include random assortments of spare parts if your ship is damaged and you have a repair bot. They'd serve another purpose too: To show behind holes left in the armor of ships when damaged in combat, so they really need to look like the stuff you'd see inside a ship: Framing, pipes, electrical boxes, tanks, whatever.

Post Reply