Announcement

Collapse
No announcement yet.

Community Planet Creation: Research/Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Community Planet Creation: Research/Help

    Hello,

    I'm here to ask how to create a planet. Not the casual "How do I do this." more of a "Can you help me research how to do this?"

    Before I explain any further I must explain what I mean.

    I've done months of digging for a way to create a planet in Unreal Engine. Yet most tutorials/plugins are outdated, or people only show off the planet. No-one really explains how to create one. I love a challenge so I must say. I know this will be very very challenging, many people go through this process and seem to give up. I won't. I want to make a planet that LOOKS to scale but actually isn't. For example, something that is from Elite Dangerous or Star Citizen. Something like this:

    The player must be-able to land on it and fly away from it. They must be-able to freely land anywhere. This will be a adventure in itself and that's fine by me. I am dedicated. If the community can help then I will try to upload it to the market for free to help other aspiring game developers. What I plan on doing is either researching some code I can use or find a program that can help (up to date for U.E. 4.24+). That part will be a challenge.

    If you say it is not possible, trust me it is. Dedication is required to make it possible. Even if we get the terrain, it will still be possible.

    If you already have a solution then just say it. At least an up-to-date solution.

    This isn't a solo project. If you want to help go ahead and read below.

     
    Spoiler

    #2
    Can you help me research how to do this?
    I can help get you started by pointing to other people's WIP.
    But that's about it, as overall it requires custom engine work.
    The landscape / terrain system as it stands won't help much.

    ...And sadly...

    Epic has absolutely no interest in this area at all whatsoever.
    I've asked for years, any chance I get, every rep I speak with.
    It'd be a game changer to have this tech, but still a challenge.
    Maybe that's why no one has made a 'product', just a 'demo'.

    There's Double-Precision, long distance rendering / Gravity...
    Z-fighting performance. So many diverse problems to solve...
    And even after that, you still must find ways to Populate it all.


    https://forums.unrealengine.com/deve...64#post1668664

    https://forums.unrealengine.com/comm...dural-universe

    https://forums.unrealengine.com/comm...e-eden-project

    Seems you know this thread already but anyway here goes:
    https://forums.unrealengine.com/comm...net-generation
    Last edited by UnrealEnterprise; 01-12-2020, 05:58 PM.

    Comment


      #3
      Originally posted by ClavosTech View Post
      Epic has absolutely no interest in this area at all whatsoever.
      I've asked for years, any chance I get, every rep I speak with.
      It'd be a game changer to have this tech, but still a challenge.
      Maybe that's why no one has made a 'product', just a 'demo'.

      There's Double-Precision, long distance rendering / Gravity...
      Z-fighting performance. So many diverse problems to solve...
      And even after that, you still must find ways to Populate it all.
      [/URL]
      That is really unfortunate. I don't mind doing labor and research for quite some time.
      I'm just getting tired of going in circles. I do plan on making a program to help this
      situation. I have yet to learn how to "Modify" U.E. So that is more of a side mission.
      I could just start with that but my coding skills aren't peaked. I will do further research
      through both planet creation and plugin creation.

      If it's obvious how to make plugins for U.E. then I may have just missed it. I wish for
      anyone else that may be interested to help. All I can do now is continue my research.

      My goal is to make this a plugin not a demo. Again help will be nice.

      Thanks a lot.
      -ATLAS ∞

      Comment


        #4
        I'm just getting tired of going in circles....
        All I can do now is continue my research.
        No doubt, this is like the holy grail of game dev. Outside of custom engines (Outerra etc) and a few games (NMS / Star Citizen / Dual Universe / Elite-D / KSP etc), who else has this tech? However, a warning from IOFlow Studios (Eden) always hits home to me. To paraphrase: Even after achieving the monumental task of planets, you still have to populate it all.... Because of that I no longer think it makes sense to try and actually create something on that scale. Look at how Star Citizen is struggling to actually get to the finish line etc.

        What would make more sense is some way to create the feeling of a planet and particularly the descent / ascent from the surface through atmosphere to space etc. And then be able to recreate that with different parameters and different colony settlements etc. So create 'a fake procedural' world etc. Just one that captures the illusion well enough. Because actually, if the tech was available in UE4 today, if might become quite tiring after a while doing flyovers across endless planets, as most of it is going to be sea and endless terrain with few real focal points of interest.

        But if you can get that part down credibly, you can create the illusion of planetary terrain. After all, this is what TV and Film have been doing for decades. Drawing in the viewer just enough to buy into the illusion of planets as reality. Anyway, why not chat with some of the devs behind the projects above via PM / Discord. Many are approachable and enjoy chatting about their work. It might give you some starting points. But its a hard problem to solve, that's for sure. Few have managed to get even close to faking it. But lots have tried etc....
        Last edited by UnrealEnterprise; 01-20-2020, 02:25 PM.

        Comment


          #5
          Forgot about a few other interesting procedural planet projects, there's also this and this.......
          Last edited by UnrealEnterprise; 02-13-2020, 11:45 AM.

          Comment


            #6
            ClavosTech "But if you can get that part down credibly" - yes, because we have all literally ascended to the stars a billion times and know exactly how that is supposed to go in a credible way XP

            I'll be posting my ideas in a bit. Just need to refine what I'm saying vs what I know the engine can/already does.

            In short however single player should be possible with engine modification - MP basically no. UE4 doesn't cater to peer 2 peer anyway, a server cannot hold tiles required for a landmass needed for a planet (earth is what, 501m km^2). I suppose on a listen server, maybe, if you Force all other players to be around whoever the listen server player is so that you don't overload the system.

            So, I think before moving forward you need to define if you want to make this a MP ordeal, or a SP ordeal. That choice will likely dictate nearly everything else about the project.

            Comment


              #7
              MostHost LA
              Originally posted by MostHost LA View Post
              In short however single player should be possible with engine modification...
              The thread isn't really asking what's possible. We know its possible. The amazingly work from the devs linked above confirm that it is. The question is, can you or anyone else help make it a reality?


              Originally posted by MostHost LA View Post
              ClavosTech "But if you can get that part down credibly" - yes, because we have all literally ascended to the stars a billion times and know exactly how that is supposed to go in a credible way XP
              By credibly, I just meant this versus this....

              BTW: I'm bumping this thread to keep it going, because I think its an important feature that's drifted away into oblivion. But overall, I do not have any of the skills necessary to make it happen. I'd just love to see it happen ... That said, I think the landing and takeoff parts are more important than circumnavigating around what will probably be mostly desolate planets. But just getting the takeoff / landing working (perhaps dithering between gigantic meshes and voxel terrain etc), would still bring credibility to the challenge. That would mean not dealing with whole planets, just a limited number of planetary sections or tiles where 'colonies' have landed etc. Whole populated planets aren't really practical or necessary anyway, as its too tricky to populate them all with interesting things. In that scenario, multiplayer is possible...
              Last edited by UnrealEnterprise; 02-07-2020, 03:09 AM.

              Comment


                #8
                As per the OP's request, the planets should be walk-able and customizable.
                To me that would mean replicating earth. In fact, if you can replicate earth, replicating Mars would be a walk in the park.
                Replicating it to scale is/may be impossible.

                To put scale in perspective, if you wanted to replicate the solar system to scale on a piece of paper with earth being the tip of a pencil, you'd need a square paper of about 432m (approximate orbit of pluto with a 4inch wide sun).

                It's pretty demanding to begin with, but unreal units being what they are you would hit issues making any calculation past the max the variable types can hold.

                My main question to OP is: Are you wanting to fly around the planet like an airplane, or not?
                The answer to that actually determines if you can use the UE4 landscape system or if something better should be built specifically for this. (not like the landscape system works anyway right? :P)

                Comment


                  #9
                  Originally posted by MostHost LA View Post
                  As per the OP's request, the planets should be walk-able and customizable.... To me that would mean replicating earth. In fact, if you can replicate earth, replicating Mars would be a walk in the park. Replicating it to scale is/may be impossible.
                  That's why I think its too impractical and makes more sense to have some kind of procedural tile system. You pick a fixed trajectory descent down to a planet and land into a tiled area and that's the level. There's no custom gravity needed in that scenario, just dithering of planet mesh to voxel terrain (for space to atmosphere to ground rendering). Otherwise, there's no way to replicate reality without NMS organic algos or better. That doesn't mean the OP really expects to fly around the whole planet. But if they do, there are solutions to increase a tiled level beyond voxels, from infinite spawning of procedural meshes, to WC / level streaming / teleport tricks. If none of that works, you could still use the old resource trick: if there's nothing around to craft you can't go on, so the craft runs out of fuel etc (which is not very satisfying obviously).

                  Originally posted by MostHost LA View Post
                  My main question to OP is: Are you wanting to fly around the planet like an airplane, or not?
                  The answer to that actually determines if you can use the UE4 landscape system or if something better should be built specifically for this. (not like the landscape system works anyway right? :P)
                  For a tile system to work there are limitations like not being able to freely fly around the planet in the atmosphere for starters (unless you cripple the gameplay by running out of fuel or add bad weather or other artificial limit)... So that's where not having an actual planet falls down. It just depends on whether you can live with conventional 'rocket realism' or not. For example, when a spaceship takes off, it quickly goes into rocket booster mode and takes a fixed trajectory out of the earth's gravity with multiple stages of separation. That's how most earth based spaceships work (apart from Virgin's). Its completely different to how commercial planes fly. Rockets go straight up for the most part. On the way back, they choose a re-entry trajectory to avoid burn up, and then parachute down. The retired space shuttle did partially glide, but it wasn't like it switched to flying through the atmosphere like a jet-powered-airplane. In short, spaceships don't have aerodynamic flight characteristics, and planes don't have rocket modules for space travel. So in reality, flying like a plane through the atmosphere in a spaceship is out (except in ultra-futuristic video games).

                  Originally posted by MostHost LA View Post
                  To put scale in perspective, if you wanted to replicate the solar system to scale on a piece of paper with earth being the tip of a pencil, you'd need a square paper of about 432m (approximate orbit of pluto with a 4inch wide sun).
                  For the larger challenge of solar systems to galaxies, a little realism may help again. The gap between planets is normally so vast that any other planets that are visible can be faked with just distant meshes. So again the core limitation is getting the ascent / descent to space to look 'credible', and then just deal with planets one at a time, by procedurally faking each one, and then procedurally creating tiled landing sites. This would also help deal with the larger headache of large worlds and origin rebasing. The spaceship is made to appear to travel, but the world stays at (0.0.0), as does each spawned tile. This is what TV & Film have been doing for decades.
                  Last edited by UnrealEnterprise; 02-12-2020, 06:31 AM.

                  Comment


                    #10
                    Quick update bump:

                    1.
                    TitaniumAG
                    Procedural Planet Generation
                    I'm planning to release a project but only when it reaches a certain standard. The current system has an underlying issue that creates holes. The system needs to hit the drawing board again because I believe I'm missing something.

                    2. MaximeDupart
                    Procedural Planet - MultiThreading LOD
                    My planet tech is heavily inspired by Star Citizen... I'm not excluding the option to sale this system on the marketplace in the future.ETA: Within 6 months

                    3. Rockam
                    This Procedural Terrain Generator is available to buy today....
                    Last edited by UnrealEnterprise; 03-08-2020, 08:00 AM.

                    Comment


                      #11
                      ClavosTech Video from last #screenshotSaturday - Biom painting. A bit more recent than the video you linked ^^..
                      This planet is around 300km radius.

                      Last edited by MaximeDupart; 03-08-2020, 01:39 AM.
                      LinkedIn | Link custom Shaders | Atmosphere Modelisation & Procedural Planets | Distance Matching Locomotion | Nvidia GameWorks builds - 4.19.2 : VXGI2.0, Blast, HairWorks, Flow - Plugins: VictoryBP

                      Comment


                        #12
                        Thanks MaximeDupart!

                        Comment


                          #13
                          Hello people.

                          I don't have anything near that biome-stuff that was posted, but I can probably help with a few things to get you started.
                          I have never touched game-developement before this, so what I do is probably not the best way, keep that in mind.
                          This is all also really freaking hard to explain in a single post, so it's gonna be hard to read.

                          First off, this is what I have at the moment:

                          This planet is bigger than Jupiter. I set its radius to 70.000 km, but because my "noise-generator" has a few flaws, it's actually about 5-10% bigger or something.

                          The last thing I was working on was trying to add UE's SkyAtmosphere, but since my planets are so huge, there are issues. Here on a 100km radius planet:


                          Anyway, where to begin.. Research!
                          My plan was to make it possible to travel from the surface of a planet all the way to the surface of a planet in another galaxy.
                          I know this is possible because of the videos from the magnificent dexyfex
                          I also learned a lot from that blog.
                          There are several websites and posts and videos out there doing different and similar things.
                          Sebastian Lague has some really interesting and extremely well-made tutorials for making planets in Unity. The logic is applicable in UE4.

                          Anyway..
                          When creating an entire universe, there are A LOT of things to consider. Everything should be based on noise and a seed. But first, your universe should be split into different kinds of "worlds".
                          For instance, my plan was to make these:
                          1. PlanetWorld
                          2. SolarWorld
                          3. GalaxyWorld
                          4. UniverseWorld
                          So when you're in "UniverseWorld" (empty space between galaxies) and look at the nearby galaxies, these galaxies are pretty much static. They individually move relative to you, so you can fly past them, but the stars in each galaxy are just grouped into one single texture.
                          When you move close to one of these galaxies, you enter a GalaxyWorld. Each star in that galaxy will now become individually static. Now, all the external galaxies are collected on a "SkyBox", and won't move relative to you.
                          Technically, the static galaxy you approached will be destroyed, and replaced by this new GalaxyWorld's own star-meshes.
                          When you move close to a star in your galaxy, you enter SolarWorld. The other stars in the galaxy will become the static "SkyBox". But now you can see the planets as small meshes.
                          When you move close to a planet, you enter PlanetWorld. The other planets in the solar system are now textures on the skybox (either combined with the other skybox, or individual). But not necessarily actual meshes.
                          The planet-mesh you approached is deleted and replaced by a complex mesh, consisting of several meshes, that increase in resolution when you move closer.

                          To keep track of which world you're in, when to transition, and where to spawn the different worlds' objects, you need a single WorldController. In fact, that's the only thing I have in my "level" before clicking play.

                          Click image for larger version  Name:	ue.png Views:	0 Size:	104.7 KB ID:	1752186

                          This WorldController keeps track of your position in the universe. Each "world" needs its own coordinate-system, and you'd have to convert between them.

                          To be honest, I never got further than creating the PlanetWorld, so I don't have a solar system etc.
                          I don't even know if any of that logic would work. dexyfex could probably answer if this is somewhat the way it was done for Galaxia.


                          Before we talk about creating the planet, you need to know about floating point precision, and the errors it creates.
                          Let's say you want to spawn a planet in your UE4 editor, and you want it to be 70.000 km in radius like the one I showed above (which in UE-units(centimeter) is 7000000000). Then let's say you want to spawn a rock on the surface. This is problematic.
                          If your planet is spawned at world zero (x:0, y: 0, z: 0), then your rock would have a coordinate/translation of e.g (x:7000000000, y:0, z:0). That number is too high!
                          It's hard to explain, but since we're dealing with such huge numbers with angles and vectors etc, the higher the number, the lower the precision.
                          It's something like, for every "10 to the power of X" you move away from world zero, the same amout of precision is lost.
                          I.E, the higher the number, the fewer the decimal points are possible.
                          In your UE-editor, just try to put anything at x:7000000000 and look at it. Here's what that looks like.

                          Click image for larger version  Name:	precision.png Views:	0 Size:	301.8 KB ID:	1752187

                          The above sphere is at 0,0,0. The one below is at x:7000000000.
                          The spehere looks allright, and I can move it nicely in y and z. But if I try to add 1 to X, it doesn't move at all. It resets to the same.
                          If you try to move it to 7000010000, it snaps to 7000010240. It's just.. not good enough.
                          So basically, you can't spawn a planet mesh at world zero and expect to be able to have anything on the surface. Everything would move in huge steps. Including the player.


                          How did I solve this?
                          First off, world rebasing. When I move more than 4km in any direction, I tell the UWorld to "rebase", so that my position is now the new world origin, and UE moves all the other actors.
                          This way, anything spawned near me, always has good precision. That's important. If I spawn a rock next to me, it will be near (0,0,0). If I move 100km, the world rebases several times, and if I spawn a new rock next to me again, that one would also be near 0,0,0.
                          The old rock, which would now be at -10000000 (if it still existed) probably has precision issues, but it doesn't matter because it's so far away, you can't tell.

                          Every time I rebase the world (every 4km) I also need to add these ~4km to my own "private" coordinate systems so that I always know where I am, and where the planet is (because neither of us are at exactly world zero).


                          THE PLANET

                          Generating an entire planet as one object with a fixed "resolution" is not practical (nor possible). You need to split it up into several meshes with several LODs, which automatically increase/decrease in resolution based on distance from player.
                          To create mesh in runtime, I'm using RuntimeMeshComponent.
                          To handle the LOD-system, I've created what's called a quadtree. It's basically just a node structure.

                          Basically I "visualize" my planet as six planes in the form of a 2x2x2 cube. That seems to be the most common way to do this, since a normal "sphere" has issues with the poles, and icosahedrons are nightmares for textures.
                          My "Planet instance" stores a "PlanetSetting"-struct which contains stuff like its radius and its noise-generator (stuff based on the seed etc.)
                          The planet also stores six QuadTree-nodes, which I'll explain later. These specific nodes represent each side in the cube. The root nodes. All these nodes store 4 vertices (corners) on the cube. (e.g (-1, 1, 1), (1, 1, -1) etc)
                          Each tick (or so) I tell each of these six nodes to generate their mesh, based on their four vertices in the cube.
                          When a node generates its mesh, it calculates a range of vertices between its four corners (e.g 64x64 vertices). At the same time, it calculates where on a SPHERE relative to sphere center all these vertices should be, using some fancy math. Now we have a spherical smooth planet.
                          Then I ask a noise-generator to get a "heightMultiplier" for each of these coordinates and multiply that, to get the terrain. (e.g 1.00005 for one vertex, 1.00014 for the next etc.). Now we have mountains. For noise, I'm using FastNoise.
                          Then I add the planet's offset from world center to each vertex, so that I can spawn this mesh relative to world center instead of planet center. That's important.
                          All the above math must be done with DOUBLES instead of floats, to avoid the precision error.
                          When all these calculations are done, I can convert the numbers to float, and spawn it in the world.
                          Sorry, this is really tricky to explain..


                          So what's with the QuadTree?
                          Well, whenever I ask a Node to generate its mesh, it can also say "hey, you are too close to me". So instead of generating its own mesh, it can divide itself into FOUR children.
                          The existing mesh (if any) will be destroyed, and the node now has four children nodes. Which are exactly the same kind of object as the previous one. It's a recursive thing.
                          So it creates four children, and then tell all of them to generate their meshes.
                          And if I get too close to one of these children, it creates four children of its own. Etc. etc.

                          So when I tell the original six nodes to generate their meshes on every tick, some of them might say "I'll tell my children to generate mesh instead".
                          You still need to go through the entire node tree like this every time, because if you move far enough away, the "parent" must be able to say "Hey, I won't ask my children, but they already exist, so I will kill my children and create my own mesh".
                          There is a lot of information about quad trees out there if this was confusing.

                          QuadTrees + world rebasing + private coordinate system, means that I can spawn the new child-node-terrains closer to my player. Meaning that when I'm on the surface, each vertex of the terrain has a value of less than 4 kilometers, because it's relative to the dynamic world center, instead of being relative to the planet center which is several thousand kilometers away.

                          What I'm explaining now is just the idea. There are LOTS of other stuff that needs to be considered. Calculating the normals is a real pain.
                          Especially because you want normals to be smooth between different nodes, so you need to either completely change my approach so you can send in a bigger area than your targeted mesh-area, or calculate surrounding external vertices based on internal vertices.
                          And then there's tangents, UV/textures etc.
                          And the calculations for all vertices per mesh must be done asynchronously, by use of multi threading, so the game thread isn't overflowed and cause lagging.
                          It's a lot of work. Good luck.

                          This took way too long to write. And I even wrote it twice, because during the first writing I pressed ctrl+z to remove the last few letters, but it actually removed everything after the first youtube-link. yay..

                          Anyway.. I have practically given up on my own project.
                          I started before I had a base idea for the actual game, and now I'm sitting here with a planet, without knowing what to do with it. And I'm back to my real-life-job, so I have a lot less time to spend on this. So I'll probably not get much further than this..


                          Edit: Oh, and the gravity is done by using (and slightly modifying) the free Directional Gravity plugin.
                          Last edited by Stiian; 05-01-2020, 08:30 AM.

                          Comment


                            #14
                            Great write up Stiian, sounds pretty similar to my setup... well done, it took me several years to get to that point!

                            I've been out of it for a while too, but this whole isolation thing has somehow bought it to the surface again.

                            Here's pretty much where I'm up to:


                            Don't be fooled by the basic mountains, the underlying system I'm testing here is super sneaky powerful for a bunch of tricky reasons

                            Having said that, the lod popping is awful so for the next month or two my main focus will be crawling through my code and scrubbing it to the bone, then implementing a new LOD technique with much better (and smoother) density.

                            Comment


                              #15
                              Thanks Stiian and ioFlow Studios

                              Thanks also to SebHillaire/Epic for the new Sky-Atmosphere system.
                              Looking forward to experimenting with the tech demo when its released.
                              And if something more comes out of this... How amazing would that be.

                              Comment

                              Working...
                              X