Download

Does anybody have any experience with procedural planet generation?

Hello,

i have a neat Idea for a game, which would som sort of procedural planet generation, like Planetary Anihilation has.
Here is what i need:

  • LOD implementation, so the generated planet can be seen from far away and close up and increase/decrease detail
  • generated surface terrain with hills oceans etc
  • generated materials
  • atmosphere

Does anybody have an idea how to do something like this or can point me in a direction?

I think it’s best to start with some resources:

  • LOD implementation: acko.net: making worlds introduction
    • Simple description: A cube where each face is a Quad-Tree
  • Generated Surface Terrain: The usual suspect here is Simplex(/Perlin) Noise however that’s tricky to get right.
    • I’m also super-impressed by the Map Generator 2.0 from the forums, I think it could make an amazing basis for this stuff!
  • Generated Materials: this one is going to be quite UE4 specific in some regards, in the past I haven’t generated the materials procedurally only textures and other components that are used by a predefined material.
  • Atmosphere: You probably want to Google for “Atmospheric Scattering o’neil”.

I’m not aware of anyone trying this with UE4 yet though I have been tempted myself.

A note of caution however is that whilst you should be able to generate some big objects in UE4 you will run into precision issues as you try to get upto planetary scales. Even Earth-like scales will exceed the limits of floating point precision quite quickly.
These are not insurmountable however and there are various techniques to get around them.

These are some link to think about the topic:
unity-notes-on-rendering-the-big-and-the-small
custom-world-coordinate-system-changing-space-world
genesis engine coordinate systems
confused-very-large-environments
A Real-Time Procedural Universe, Part Three: Matters of Scale

However, that’s a lot to think about all in one go :smiley:

My advice would be to start with the quadtree-cube, just get something rendering in UE4, nothing fancy just an auto-LOD cube. You can worry about the size of it later!

Good luck.

Hi,

thank you very much. That should be a great point of scale.

Regarding scale: I dont have the intention to make planets really to scale. I am thinking more of a scale like Planetary Annihilation has. Simplified, small planets, which should make the whole process much less complicated.

So I read the first article from acko. Very interesting read, but very theoretical and no code samples or stuf like this. Could you hint me into a direction on UE4 specifics, how I would approach the rendering ? Like mapping the cubemap onto a sphere etc. He also says that he uses the GPU directly to do all of this. As far as i understand, this should probably be done with shaders right? If so, how can i implement my own shader in UE4? Isnt this what matrials do?

Wow. This stuff seems to be very complex. Hope I can handle it. I would really love to get this to work, since I have a very great idea for a game which relies on it :slight_smile:

It’s a real shame he never continued that series as it was fascinating watching him take the whole process apart like that.

However he did release the source code, you’ll need Ogre to get that up and running to try it out.

For UE4 … That’s going to take some thought! I’m an Editor coder not so much a rendering guy :wink:

Lets start with the “QuadCube”:
You’re going to need a custom procedural mesh, there’s a Procedural Mesh Generation wiki entry about creating your own objects to generate geometry from code/data.
There’s also a forum discussion about how to actually use it :slight_smile:

So before you do anything else, start by getting that example working, and then modifying that working example to generate a simple cube from code because that’s really the basis of everything that comes later.

If you want you can take a look at some old code I did that uses a QuadTree, it depends on the GLFW 2.7.6 and GLM 0.9.3.4 libraries (I haven’t updated it a year or two).

Break down the work into smaller pieces, ask for help when you’ve tried a few things and got good questions to ask, and you’ll figure it all out in the end.

It just takes time :slight_smile:

Andy

Again, thank you so much. You guys working for epic who roam arround the forums are a real tteat to the community. Can’t thank you enough for your time.

I will definitly try these things out over the weekend and will come back with further questions.

Hey AJ! So although this thread is over a year old now, it still interests me, does there happen to be any threads with the same topic? As I can not find any. Thanks!

I got this one here: https://forums.unrealengine.com/showthread.php?85084-The-Eden-Project