2
\$\begingroup\$

So to preface this question, I have done a lot of research on this, but most of it has proven unhelpful, possibly because I'm not sure the proper way to phrase what it is that I'm trying to ask, so I might make this a little long-winded to get my point across.

The basic idea that I am trying to explore is a small planet that can be navigated by the player, but I also want this planet to be similar, but different for each playthrough (hence the procedural-generation tag). At first, I looked into doing this by simply creating a sphere which has it's own type of gravity (doesn't have to be too realistic), but research proved that this had many (too many) obstacles to overcome. Making the gravity work on this sphere would have been complicated, but doable, but then I read that the terrain tools wouldn't work properly and that could be a problem. The last issue that I saw for this, which makes me think that this idea is dead is how strenuous this might be for the systems, since I want the planet to be fairly full of interesting things to explore.

This led me to the idea of a modular system of tiles (if I'm using that term correctly), where I could procedurally generate these tiles, and align them in a spherical shape. I could instantiate and destroy the tiles as needed to preserve system resources, and would make the procedural generation aspect of this easier for me as well (at least I think it will). The problem I see with this model is how to make square (or any other shaped tiles) form a sphere.

I am attempting to build this in UE4. If this is impossible, or at least prohibitively difficult, to do in the engine, then I rather find out now before I get too far along in the project. And any help or resources on how I can do this if possible will be greatly appreciated.

\$\endgroup\$
3
  • 3
    \$\begingroup\$ It sounds to me like your real problem here is analysis paralysis. You consider and discard solutions that have successfully shipped multiple games, mostly on the grounds that they might be hard or expensive. You're unlikely to find a solution for this that is "easy" or "cheap", but when has that ever stopped a game developer? ;) I think you need to start by committing to one method — even if it might later turn out to be terrible — and at least try to prototype it. That will quickly show you which problems are real, and which ones were just imaginary. Then we can help you solve the real ones. \$\endgroup\$
    – DMGregory
    Oct 8, 2019 at 21:45
  • \$\begingroup\$ @DMGregory I think that you're correct here. I'm not sure where would be the best place to start, and that was definitely part of my issue. I'm not necessarily looking for an "easy" solution, since I was confident that this would be a somewhat difficult feat, regardless of how I went about it, but I do have a fairly short deadline for how long it can take me to figure out, since it's partially for a school project as well as a personal one. \$\endgroup\$
    – DrB
    Oct 9, 2019 at 14:00
  • \$\begingroup\$ So do the quickest and dirtiest thing that might work, and run with it. You said you were thinking of square tiles? Maybe run with that. If you're not sure how to arrange them in a sphere, post a question that asks "How do I build a sphere out of square tiles?" You'll get more focused, actionable, useful answers if you commit to a direction and dig into the precise steps you need help with, rather than asking others to make up your mind for you. \$\endgroup\$
    – DMGregory
    Oct 9, 2019 at 14:42

1 Answer 1

1
\$\begingroup\$

I haven't touched UE4 in a while but I'm gonna tell you how I'd tackle it. I would create 3D fractional brownian motion (fbm is iterative octaves of the 3D noise) and add it to the equation of a sphere, I would do it in a vertex shader. Here is something similar I wrote in a pixel shader, note that the noise here is 2D which could be troublesome in your case, but the algorithm is similar:

float map( vec3 p )
{

    // Equation of a sphere.
    float sphere = length( p + vec3( 0, 150, 0 ) ) - 150.0
    // Fractional Brownian Motion.
    floar f = fbm( p.xz );

    return sphere + f;

}

You could even look for texture based noise for speed. Then you would have to run a Marching Cubes implementation to get a mesh or you could even import the mesh from a modeling software and run the fbm to displace the vertexes so that you already have the topology to skip the Marching Cubes. That's if you really need a sphere but you could substitute the sphere equation for a plane and the 3D noise for a 2D one for a 2.5D heightmap, that is much easier to couple with the UE4 terrain system, if I remember correctly it can create terrains from heightmaps.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .