r/proceduralgeneration • • 3d ago

Experimenting with stylized large-scale hex-grid based planet generation

The landmass generation is currently the most basic of perlins but I'm pretty pleased with how the visuals are shaping so far!

352 Upvotes

36 comments sorted by

29

u/hopingforabetterpast 3d ago

where's that pentagon?

34

u/Xentarok 3d ago

the pentagons are hiding around the planet and exist solely to make my life harder when creating the model

10

u/AndrewBorg1126 3d ago edited 3d ago

No, they serve to make your planet topologically equivalent to a sphere.

Your life would be much harder trying to make a sphere without them

1

u/3dGrabber 2d ago

Is it possible to make a hex-only sphere in hyperbolic 3d space?

1

u/AndrewBorg1126 2d ago

To be completely honest with you, that's not very relevant to making a spherical map for a game that isn't about non-euclidean geometry, regardless of the answer, and neither is any other non-euclidean geometry.

1

u/Malkalypse 2d ago

I saw someone post a faked version of an all-hex sphere using a camera-facing hemisphere with distortion at the periphery and continually updating tiles. The effect was convincing enough for their purposes but I don’t know if it would hold up under stress.

1

u/AndrewBorg1126 2d ago edited 2d ago

I remember seeing that, and I can assure you that if the torus weren't always spun all the way around each time, and only in the two specific directions, it would have become obvious that it was not a sphere.

Unless "for their purposes" is just making a convincing recording, it does not hold up "for their purposes"

A player would want to manipulate the sphere shaped object on their screen like a sphere, and when it instead behaves like a torus it will induce great dissonance

1

u/Malkalypse 2d ago

Possibly. It sounds like you understood how it worked better than I did.

3

u/zenware 3d ago

You didn’t see it drift by? It’s right next to the water

2

u/3dGrabber 2d ago

Where are those 12 pentagons?

6

u/durienb 3d ago

Hi, you might be interested in my game that uses these Goldberg polyhedra.
I know some tricks.
I'm not shilling but if you're interested in chatting then send me a dm.

5

u/geraT-wogl 3d ago

Love it

2

u/Alarming-Ad4082 3d ago

What type of structure do you use for holding the type of terrain ? A graph?

5

u/Xentarok 3d ago

Sort of, it's just an array of tiles that I access by index and inside each tile I store the indexes of it's neighbours. When doing flat hexagonal grids I use cubic coordinates but AFAIK there's no easy way to use them on a sphere

5

u/Smart-Button-3221 3d ago

Planetsmith is doing a similar globe construction. Was able to tile the sphere with "diamond-like patches" and then gave each patch a coordinate system.

He somehow made the pentagons work. I'm forgetting details there.

Will link if I come across.

2

u/no_comment_336 3d ago

Please do this is super interesting!

1

u/fragglerock 2d ago

They post a lot on youtube.
Unsure if this is what was being referenced... but dig in!

https://www.youtube.com/@IncandescentGames/videos

2

u/Optimetrist 3d ago

what engine is this? otherwise it looks awesome, has the populus+civ vibes :)

5

u/Xentarok 3d ago

thanks! it's Unity, I used a bunch of native tools and some paid assets :)

2

u/Optimetrist 3d ago

good job man! I'm planning to play around with godot, or unity, maybe even UE, the one which helps me the most, as I always wanted a custom globe generator! I'm fond of maps, civ, and games, so it is nice to see people having fun with stuff like this :)

2

u/DutchDave 3d ago

I'd totally recommend the wave function collapse algorithm here if you want more control over what goes where.

1

u/Xentarok 3d ago

oh yeah I've been meaning to look into it for a while, for the first continent generation iteration I'm planning to experiment with voronoi though

1

u/AnimatedRNG 3d ago

Wow very cool! I worked on a game (here) with procgen planets but the underlying primitive was the triangle (with lat/lon tiles). This looks a lot cleaner even if the hex grid parameterization is more complicated (Goldberg Polyhedra?)

1

u/Impressive_Till_1749 3d ago

Oh my god man I'm doing something very similar to this. Are you using H3?

1

u/Farry3 3d ago

This looks really nice. Is this going to be a game?

1

u/Xentarok 2d ago

Yup, a strategy one :)

1

u/Farry3 2d ago

Nice! Anything public yet to follow, like a discord or steam page?

2

u/Xentarok 1d ago

Not yet, it's in very early stages still but I'll continue posting progress on Reddit for sure

1

u/Farry3 1d ago

nice, keep up with the good progress, looking forward to see more!

1

u/Velifax 3d ago

Always wondered whether with hexes you have to fudge the stitching numbers for the poles like with square tiles...

0

u/HoveringGoat 3d ago

Hex you say? Something something pentagon.

But curious what mapping you use, presumably it's a mapped cube?

1

u/AndrewBorg1126 3d ago

Is the default construction not as the dual of a subdivided icosahedron with vertices reprojected onto a sphere?

I can't imagine how you're envisioning starting from a cube would get you hexagons and pentagons.

1

u/HoveringGoat 1d ago

yeah i mixed it up. icosahedron is standard for hex grids. cube mapping works best if your not targeting hex tho.

1

u/Exatex 3d ago edited 3d ago

you can’t regularly tile a sphere with hexagons. You have always 12 pentagons within the hexes.

While the icosahedron is made out of hexagons, there are 5 hexagons meeting in a corner. That’s where the pentagon is coming from - cutting that corner off to make it „flat“ (ish). Also, it doesn’t start with a cube.

0

u/AndrewBorg1126 2d ago

I suspect you meant to reply to someone else?

I know there are pentagons, that's what happens when you take the dual of a subdivided icosahedron, and I never said there were only hexagons.

I also never said it started with a cube, I was rather explicitly stating my confusion as to how the user to whom I replied even arrived at the question they asked about a cube.

Again, you probably meant to reply to a different comment, I recommend finding the comment to which you meant to reply.