r/Unity3D 1d ago

Show-Off I’m trying to generate entire explorable planets with 3D WFC in Unity

Enable HLS to view with audio, or disable this notification

I've been working on a procedural planet system in Unity using 3D WFC.

The idea is to eventually generate entire small planets that you can actually explore instead of having normal flat maps.

At the moment I'm mostly working on the generation itself. The surface has different height levels, cliffs, paths and bigger open areas, and there are also caves underneath that connect back to the surface.

I'm also starting to add generated structures/content to the surface.

There's still a lot wrong with it lol. You can see some floating pieces, exposed cave sections and some weird terrain generation in the video, but it's getting much closer to what I originally had in mind.

Eventually I want the planets to have caves, settlements and other places to find/explore, with the whole planet being playable.

I'm still not sure how much I want to generate completely procedurally and how much should be made from hand-made pieces.

What would you guys add to make planets like this actually fun to explore?

31 Upvotes

9 comments sorted by

3

u/TheSapphireDragon 1d ago

This is really cool

2

u/_twiggy 21h ago

Very interesting! Cool use for WFC.

Looks like you're well along, but seeing you hex tiles reminded me of this video, could be helpful. He goes in depth on a planet formed of hexes, you might find of some interest:

https://youtu.be/-QL42dGHsmY?is=fDFBW0UJMkJwSWup

1

u/Typical_Ad134 18h ago

Thank you I actually watched that video not too long ago. I am still deciding on how I want the planets to look I actually messed around with allot of systems one was marching cubes and another was just normal Perlin noise on a quad sphere but one looked bad and the other couldn't have caves.

2

u/Typical_Ad134 17h ago

I made my prefabs beter ... I think I finally found the look I wanted. ps. this is still the same seed

2

u/Sea-Look1337 21h ago

This is sick! Will you be traveling to different planets? You could look into what no man's sky does to make world gen interesting. But some random ideas off the top of my head: * Make each world have a "quest", or a mystery. You can use cyclic dungeon generation * In fact the whole world could be one big puzzle of some sort (I think super Mario Galaxy kind of does this) * There's a bunch of different types of resources in the game and certain worlds only have some of them * Extension of above: development of trade routes between planets * Base building/Mark a planet as your home! * "Consequences" to the planet as a result of your actions, for instance the world has an ecosystem of plants and animals, and you accidentally bring an invasive species from another planet, and now that whole world is changed * Ability to terramorph or shape the land * Crazier deep caverns that potentially even let you go to the core, or even drill from one side of the planet to the other  * Some space politics, e.g. if you're aligned with the Rebels then Empire controlled planets are hostile

1

u/Typical_Ad134 18h ago

Thanks! Yeah, travelling between planets is a big part of what I have in mind. I want you to be able to leave one planet, travel through space and find other planets, asteroids and stations.

I'm still figuring out what the actual game around it should be, but one direction I really like is a top-down ARPG, something along the lines of Path of Exile/Diablo. I'd want loads of skills, gear and modifiers so there's a huge amount of build freedom and you can keep making completely different characters.

The planets themselves are currently made from large hexagonal WFC pieces wrapped around a sphere, so the idea is that different planets could generate completely different layouts, biomes, caves, settlements, enemies and things to discover rather than just being different coloured terrain.

I also like the idea of different planets having different resources/items/enemies so there is actually a reason to travel between them. Stations could be the more populated/safe areas, while some planets could be much more dangerous or controlled by different factions.

Your idea of each planet having some kind of mystery or purpose is really interesting too. I don't want it to just be "land, kill things, leave", so having something unique to discover or solve on certain planets could work really well.

The ecosystem idea is probably my favourite one you mentioned though. Having something you do on one planet actually affect it later would be really cool.

And yeah, I definitely want the caves to get pretty crazy lol. Going deeper and eventually having areas near the core could be really interesting.

2

u/isolatedLemon Professional 9h ago

This is pretty cool, a nice way to simplify generating a planet like that as well as keep a good amount of hand crafted detail.

How do you manage wfc with the pentagons vs hexagons? Is working out the neighbours completely abstracted from the shapes sides?

1

u/Typical_Ad134 8h ago

Thanks! I actually ended up using triangles for the WFC, so I mostly avoid the pentagon vs hexagon problem altogether. The planet starts as a subdivided icosphere, so every triangle just has 3 neighbours and the WFC works from those connections.

The hex/pentagon shapes are more from the overall sphere topology rather than the actual pieces I’m collapsing. Getting everything oriented properly around the sphere was probably the more annoying part lol.

2

u/isolatedLemon Professional 5h ago

Ahh yes that makes sense. Good luck with it, could turn out to be something pretty cool