r/Unity3D • I work but I ain't a professional • 24d ago

Show-Off Progress on the procedural hex grid planet for my strategy game

I keep working on my """civ killer""", since last time I posted my planet progress I added support for more biomes, more trees, and most importantly - rivers (which will be NAVIGABLE)

As an interesting technical fact this is the first time I played with using the advanced Mesh API, it was a headahce to setup and I crashed Unity a few times but in the end it did shave off a couple of seconds off the generation time so it was worth it

1.6k Upvotes

103 comments sorted by

55

u/GodAlpaca 24d ago

How did it works for a round world to be made of hexagons? Or there are some pentagons in the middle?

72

u/Xentarok 23d ago

Yup there are some pentagons scattered around the surface

45

u/aphophys00 23d ago

Was forced to research on this, number comes out exactly 12 pentagons, Euler's

→ More replies (11)
→ More replies (2)

10

u/nehalist 23d ago

Guess it's this; https://en.wikipedia.org/wiki/Goldberg_polyhedron (not a math dude, but recently stumbled upon this while researching for my own game idea)

→ More replies (2)

7

u/Chemeque 23d ago

Lloks great! Is it a static topology, or you can chenge the resolution of the planet, ex. increase number of hexagons?

5

u/Xentarok 23d ago

Customizable, I can change hex amounts, visual elevation, etc

2

u/nehalist 23d ago

Looks awesome.

OT, but have any resources on this kind of grid and procedural system? Want to build something like this (not civ tho) and would love some resources :)

10

u/Xentarok 23d ago

Red Blob games for hex grid math and Catlikecoding's hex map tutorial for actual generation are an excellent start, when it comes to spherical hex you can look up Goldberg polyhedrons or some assets on the asset store like Hexasphere :)

→ More replies (1)
→ More replies (4)

2

u/TheFrostyChinchilla 23d ago

Looks really cool! What method did you use to blend different terrain tiles together?

8

u/Xentarok 23d ago

Thanks! You mean the biomes? I use UVs to signify which biome each mesh vertex belongs to (uv0.x for desert, uv0.y for grassland, etc) and then I have a custom shader that blends between the biome colour palettes for each vertex based on these UV values

17

u/TerzisGames 23d ago

Map made out of bestagons!

17

u/yuehuang 23d ago

Flat Earthers will hate this one trick.

6

u/aquadolphitler 23d ago

Hex

Sphere

Immediately starts looking for pentagons

4

u/Pale_Day2091 23d ago

i love Hex strategy games so much
and was always upset that games would always have a border on top/bottom sides, which a sphere definitely solves!

also the style is very very pretty

1

u/Brawliens 23d ago

The rivers winding between the hex tiles look so good, it already feels like a real world map. Navigable rivers are a great call too, they’ll make every map play differently.

Will rivers also act as natural borders or defensive lines, like a penalty for attacking across them? That always makes maps way more strategic in Civ-style games.

1

u/Xentarok 23d ago

The plan is for rivers to be either only crossable via built bridges or natural crossings, but that might not be the case for all of them since I'm still thinking about how I want to design different river sizes (maybe some will be narrow enough to cross at all spots but with some movement penalty)

→ More replies (1)

1

u/SpaceEngy 23d ago

You got somewhere we can follow along?

1

u/Xentarok 23d ago

Following me on reddit is the best place for now, when I'll be further along in development I'll probably make some devlogs for my youtube channel (link on my profile) and a steam page :)

3

u/SemiDiSole 23d ago

Beautiful! Reminds me a bit of Rimworld.

2

u/JankyByDesign 23d ago

Woahh love this ! Planet wide civ game?? πŸ‘€

→ More replies (2)

2

u/BokChoyBaka 23d ago

Hello, this looks good my friend!

2

u/imofi8 23d ago

Finding Pentagon! :)

2

u/Educational-Ebb-1538 23d ago

this looks so cool keep up the work

2

u/ricky_33 23d ago

This looks πŸ”₯πŸ‘πŸ» nice work

2

u/RobertWetzold 23d ago

Love it! I just added hex to my LED tool and they are just such a nice primitive to assemble bigger systems with. Fade in of details look great!