Planet Thoughts
Forum » Fragmented Galaxy / Game News » Planet Thoughts
Started by: Craig MacomberCraig Macomber
On: 1232953626|%e %b %Y, %H:%M %Z|agohover
Number of posts: 9
rss icon RSS: New posts
Planet Thoughts
Craig MacomberCraig Macomber 1232953626|%e %b %Y, %H:%M %Z|agohover

I have been thinking about planet graphics. I had a plan, and it was pretty good. I had made the decision to try and do planets in our current engine, which basically means no normal/bump maps and no shaders. Because of this I decided that we would have to do texturing on the CPU. I designed a system of hierarchical layers that would allow detail across all scales (from continents to grass). This system is powerful, and not fractal to implement in a shader on the GPU which we couldn't use anyway. It would be a matter of zoom and wait for texture detail.

I still like that system, but today I realized that if we were to use a graphics engine where we have much more control over the GPU (like OpenGL), I could implement the same system, but much faster, and better.

First of all, the reason it can not be done in a shader is that when you zoom in, there are so many possible layers. In reality, very few will ever be used at once, but the pixel shader can not take advantage of the hierarchical nature to eliminate almost all of them. Also, even the amount of layers is use will be so large, and the amount of computation per sample in each layer so larger that it simply would never be close to fast enough.

Solution: Suppose we were to have an already textured planet. Once you zoom in, you get to the point where there is no detail left from the texture. At this zoom, suppose you implemented the appropriate sub layers (trees in the forests, dunes in the deserts) in shaders. They would add in the detail!

Now, you zoom in further, and its time for the shader's sub layers. We use the GPU to convert the current shaders into textures which we draw on top of the old lower detail ones, and generate new shaders for the sub layers (branches on the trees or what ever).

This allows per pixel detail at all zoom levels, and keeps the speed up. There is simply 1 shader drawing a few layers over 1 texture. That should be fast! Getting the GPU to generate the textures that will be combined will be somewhat hard, but apparently it's possible. Also, it would allow high quality effects like per layer bump mapping with proper lighting!

The slightly easier version is so skip the detail shaders and just use generated textures (generate them to higher detail). This would probably be done first, and detail shaders would be added if needed.

Also, the mesh height data could be generated on the GPU as height map textures which would speed stuff up a lot in that department. (Yep, that means fast detailed mesh with fast detailed textures with good lighting!)

What this means to you: If we go forward with this, it will mean some delays in the short run, but planets will look much better, and so will everything else (because of a better graphics engine)

I should note that I have never done anything like this, so it's all very speculative.

Basic design:
Planet%20Gfx%20Flow.png

last edited on 1232953818|%e %b %Y, %H:%M %Z|agohover by Craig Macomber + show more
unfold Planet Thoughts by Craig MacomberCraig Macomber, 1232953626|%e %b %Y, %H:%M %Z|agohover
Re: Planet Thoughts
Crazy CCrazy C 1233000886|%e %b %Y, %H:%M %Z|agohover

I like this idea, the game will run as smoothly as possible while still keeping an element of realism. Also, I think this may have been mentioned before, but what if the game randomly generated a small amount planets and other objects when 10 or more users joined, basically expanding the galaxy so that it's unlikely that any player could run out of planets and extra terrestrial objects to explore and exploit. Although, I suppose the flaw of this system might be it will not be easy to program and it will require a decent amount of server power, but it would be really cool.

unfold Re: Planet Thoughts by Crazy CCrazy C, 1233000886|%e %b %Y, %H:%M %Z|agohover
Re: Planet Thoughts
Craig MacomberCraig Macomber 1233003838|%e %b %Y, %H:%M %Z|agohover

The number of systems, and planets per system are simply set by a few constants. Thus adding systems and planets would be easy (really easy, just change the number). It would not do it in a very realistic way, but it would work from a game play perspective.

unfold Re: Planet Thoughts by Craig MacomberCraig Macomber, 1233003838|%e %b %Y, %H:%M %Z|agohover
Re: Planet Thoughts
tbg10101tbg10101 1233210801|%e %b %Y, %H:%M %Z|agohover

Looks nice!

Off topic:
Take a look at this: http://en.wikipedia.org/wiki/Kardashev_scale
We could rate players advanced-ness with this but using resources instead of energy.

last edited on 1233210820|%e %b %Y, %H:%M %Z|agohover by tbg10101 + show more
unfold Re: Planet Thoughts by tbg10101tbg10101, 1233210801|%e %b %Y, %H:%M %Z|agohover
Re: Planet Thoughts
PhenocaPhenoca 1236572953|%e %b %Y, %H:%M %Z|agohover

Now, you zoom in further, and its time for the shader's sub layers. We use the GPU to convert the current shaders into textures which we draw on top of the old lower detail ones, and generate new shaders for the sub layers (branches on the trees or what ever).

I do not understand the above quote. It seems very complicated (especially the "Texture Maker Operator"). So each planet starts with one layer, but as you zoom-in, the GPU makes each shader create new sublayers? Or… It creates new shaders, which function to add detail on top of the current texture(s)? I also note that pixel shaders are also called "fragment shaders" (as in Fragmented Galaxy) which is amusing.

what if the game randomly generated a small amount planets and other objects when 10 or more users joined

I agree. The game, Astro Wars does this, and it seems to work well. The number of planets could be scaled to the expansion soft-caps, and the percentage of newbies who play to achieve those caps.

@tbg10101: Yes, resources per unit time are a good measure of a nation's score. Should score be based on the weighted average of resource-use during the past seven days?

unfold Re: Planet Thoughts by PhenocaPhenoca, 1236572953|%e %b %Y, %H:%M %Z|agohover
Re: Planet Thoughts
Craig MacomberCraig Macomber 1236575056|%e %b %Y, %H:%M %Z|agohover

You got it about right. Basically the idea is to generate textures using shaders, then when you zoom in, overlay detail textures generated with shaders.

unfold Re: Planet Thoughts by Craig MacomberCraig Macomber, 1236575056|%e %b %Y, %H:%M %Z|agohover
Re: Planet Thoughts
tbg10101tbg10101 1236700949|%e %b %Y, %H:%M %Z|agohover

Should score be based on the weighted average of resource-use during the past seven days?

I don't think so. It should be based on the players maximum harvesting capacity.

what if the game randomly generated a small amount planets and other objects when 10 or more users joined

Add systems at the edge of the galaxy "un-mapped" so that a user has to go there before they are mapped out.

We are still mainly working on the ground combat, correct?

unfold Re: Planet Thoughts by tbg10101tbg10101, 1236700949|%e %b %Y, %H:%M %Z|agohover
Re: Planet Thoughts
PhenocaPhenoca 1239906347|%e %b %Y, %H:%M %Z|agohover

Yes, I believe that the main focus is ground combat. I'd also like to download and give feedback on the "Help Viewer" you made.

the pixel shader can not take advantage of the hierarchical nature to eliminate almost all of them[…] it simply would never be close to fast enough.

Thanks. I was confused as to why the shader did not work well.

There is simply 1 shader drawing a few layers over 1 texture.

Won't it be hard to get the layer to match the texture?
Why does bump mapping need to be applied to each layer?

The height for each layer or for all the meshes?

unfold Re: Planet Thoughts by PhenocaPhenoca, 1239906347|%e %b %Y, %H:%M %Z|agohover
Re: Planet Thoughts
Craig MacomberCraig Macomber 1239952490|%e %b %Y, %H:%M %Z|agohover

Won't it be hard to get the layer to match the texture?

The layers are the textures, so there is no matching to do.

Why does bump mapping need to be applied to each layer?

Because each layer represents something that has its own surface. You don't want to light the ground below the trees with the tree's bump map for example.

The height for each layer or for all the meshes?

I'm not sure what you are asking there.

unfold Re: Planet Thoughts by Craig MacomberCraig Macomber, 1239952490|%e %b %Y, %H:%M %Z|agohover
New post
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License