Handeling Planets

Ok so im trying to have planets in my game with buildings and terrain but not too sure how to go about it. I have a few problems. (using blueprints)

1)I have a sphere with a basic material. From a far if looks nice but as you get close it looks awful, how would i change the material. I know this can be done with lods but i dont want the whole planet to have the same material. Some parts may be icy while others parts are desert.

2)Mesh is also a simple sphere from a far but as you get loser i would like detailed mountains and so on. How would i go about this. If i use lods and make a high res planet the game would crash due to extreme poly count for all the plant. Would if be better to make one mesh for all the planet or break it up? Ive seen some videos of parts of the mesh vertices being loaded in but not too sure how to implement in unreal.

3)How do i deal with individual buildings on the planet. Do i just place them into the planet bp or something else??

Sorry for the long question. I have some ideas how to do this but im not sure if unreal engine was certain tools to deal with problems like this. Any help will be appreciated :slight_smile:

hmm… are you trying to make something like no man’s sky?

I’ve not tried, but having worked on a shipped AAA title with spherical planets before and having a basic idea of what’s involved, I think you’ll probably struggle to do this via Blueprint, and probably still struggle to do this in C++ with a unmodified version of the engine.

This is a little bit outside of my area of expertise (I’m more of a Gameplay guy than Engine/Graphics, so my knowledge in these other areas is a bit high-level and might not be 100% up to date with the state of the art), but I can say that to tackle a game like this my feeling is that the best way is probably to spend a significant amount of effort modifying the terrain system in native code to support spherical planets.

You might even need to rewrite the terrain system from scratch, depending on how feasible it looks to make the existing code support spherical planets… There’s generally a lot of technical investigation that goes on before making a massive change to an engine like this, to see where it’s better to reuse, and where it’s better to just ditch it and rewrite from scratch. Sometimes a system just has so many in-built assumptions about how it will be used, that it’d be quicker to start from scratch than to reuse what’s there.

Terrain is a much better fit for this kind of thing than a mesh, because terrain is designed for exactly this kind of thing, it’s split into chunks that are separately LODed, so that when you’re close to the terrain the area right around you is very high-detail, but the terrain in the distance is rendered and processed at a more coarse level of detail. Meshes are usually built on the assumption that it’s one object that’s either close to you and finely detailed, or far away from you and rendered at a more coarse level of detail.

Objects placed on the terrain (including buildings) would be their own separate Actors/Blueprints, and ideally you’d want to stream them in and out as you move through the world, otherwise you’re going to waste a ton of CPU time processing actors that are miles away from you, and filling up available memory with assets that don’t need to be loaded. Also if you try to put everything in one Blueprint, my gut feeling is that you’re likely to start bumping against various hard-limits in the Blueprint system (I don’t know of any limits specifically other than general performance issues, but generally speaking it’s something that happens when you try to use systems in ways they weren’t designed for. Are there hard limits on the number of nodes in a Blueprint graph for example?).

Material-wise, my knowledge is probably a bit behind the state of the art as I don’t really deal with graphics/art assets much, but my understanding is that generally most games will use a single material for the terrain and blend between different textures based on things like terrain height and slope, to achieve different terrain types.

Another big problem you’d likely encounter with this kind of game, is that with a large world you’ll almost certainly start bumping up against the limits of floating point accuracy. Basically, the distance between consecutive floating point numbers gets larger and larger, as the value gets larger. This can manifest in all kinds of problems (both gameplay and visual) as you get further and further away from (0, 0, 0) in your coordinate system. A lot of games with massive worlds like this, make changes to their engine to support custom coordinate systems to get around this.

Personally, I’d be tempted to try and fake a lot of this. If your game supports being in space, and being on a planet then you could potentially have the planets just be less detailed meshes while in space. When you enter the atmosphere, you could have some kind of transition sequence where you fog up the screen as you fly through the cloud layer, and use that to hide the fact that you’re streaming in another level with flat terrain. You’d have to pull off some trickery if you want the world to be circumnavigable though (especially considering that teleporting from one end of the terrain to the other will likely incur a significant time to load in all assets to a high level of detail)

kinda yhe, but i only want 3 or 4 planets that actually feel like they are inhabited with loads of stuff to do on each one.

First of all thank you very much for that long detailed reply.

Rewriting the source code is not an option for the time being as i am currently too novice. As for the terrain system in unreal engine, i will have to find some way to take advantage of it as it seems to be the only viable solution for the time being. Im planning to have the game online and really don’t like the idea of creating the illusion of entering a planet. Even though this is the core of developing game (find tricks to make something seem realistic) I really want it to feel like the player has the ultimate freedom to go and be anywhere with no restrictions.

I am currently trying to get the game done as fast as possible for testing to see if its worth making and actually a fun and unique game. This is the reason i am sticking to blueprint at the moment. To keep up the fast passed momentum. If i feel like its worth continuing after testing and surveying I think ill have to learn to edit the terrain system to my own criteria.

As for the floating points unreal has a very handy tool that keeps the world origin in at the same location as the player saving me from a lot of problems. Ive been told this feature doesn’t work online but ill have to cross that bridge when i come to it.

Again thank you for the advice :slight_smile: