#[Help] I'm trying to implement a Civ5 hex terrain

1 messages · Page 1 of 1 (latest)

upper zodiac
#

I'm trying to implement a civ5 hex terrain. I can use the unity terrain and generate the heightmap by stamping height textures on calculated hexagon positions.

My question is in regards on how they link the hexagons. In civ5, if you have a isolated hex (1 piece island), the coast region is smaller than a land hexagon (2 or 3 hexes).

What technique they use to fill the gap ?

#

As you can see, the radius of coastal hex are smaller than the land ones.
I could stamp a linking mask texture between hexes. Like this:

#

I could also create in a compute shader a texture using some kind of metaball:

#

If you guys have any idea how they did in civ5/humankind or any regards in which path is better, please help me by discussing it 🙂

hollow tinsel
#

the metal ball looks nice. try to set its radius to be proportional to the number of neighbors it has, plus some noise.

#

you can try increasing the blend too so that it appears less narrowed

#

i don't know how they do it in civ5, but what it looks like is

#
  1. draw the hex grid. apply some heuristics, like the length of hex borders that are adjacent to water are shorter
  2. whever it overlaps voronoi cells, use those.
  3. apply another round of costal noise
upper zodiac
#

Here's using a mask and blending some gradient noise:

#

I've researched the civ5 case, they use various chunks of grid terrain (with tesselation) with heightmap and colormap they generate on the fly

#

(i checked ingame with dev tools, we can turn wireframe on)

hollow tinsel
#

i feel like there are a lot of good approaches

#

you should investigate cellular noise

#

my suggestion is to prototype this in after effects or substance designer first

#

because it's all heuristics

upper zodiac
#

in humankind, they use some kind of stamping too, i've seen a video they talking how they generate the textures in houdine first and apply ingame

#

I'll check it too

#

Thanks btw 🙂

hollow tinsel
#

there are tesselation approaches for terrain in unity hdrp

#

you can certainly try to achieve this with vfx graph and shader graph i.e. "all on gpu"

#

with an input graphics buffer of the logical grid / other cpu solved things like adjacency

#

unity terrain suffers from many of the problems they had to solve

#

i don't know if anyone at unity has touched the terrain code in ages though lol

upper zodiac
#

Its really bad, creating terrain data on the fly, deleting and creating again on editor, generates tons of errors in editor

hollow tinsel
#

i think it will be a huge distraction to try to implement your own tesselation

#

versus say generating the height map

#

which is where you are planning to go

#

i am validating your approach

upper zodiac
#

But i can generate the heightmap and use the terrain system

hollow tinsel
#

yes

upper zodiac
#

the main problem i see is defining the connections, how should i do it in a way that looks good

#

generating the heightmap and colormap. Using in the terrain or generating a simple grid mesh would not be a problem