News Liste Plan B: Terraform
So, in the meantime, I would like to rewrite here an old post from twitter (2019!) that was explaining the hexagonal generation I've developped for Plan B. Here it is:
How to create a sphere made of hexagons? Hexagons of similar size and orientation?
The most common way to do that is to start from a regular icosahedron (solid of 20 of equilateral triangles), then subdiving each triangle (sphere tessellation). Each triangle vertex becomes an hexagon, as you can see in this pic (credits https://twitter.com/AndyGainey ; I'll come back to him):
Here is a sphere with 5 subdivisions (~10,000 hexagons). It's very nice, that's what I initially planned to use... but it's actually bad for a game. Not because of the 12 hidden pentagons, but because of the non-uniformity of the size, shape and orientation of the hexagons.
Here is what you can see at different positions of the sphere ; north pole being on top. Hexagons are of various shape, size, and orientation ; the result would be awful when you scroll in the game, very disturbant.
There are other ways to do this sphere tessellation, like the very interesting Healpix, which garantees the same size for each area, but have non-uniform shape, and squares instead of triangles/hexagons. https://healpix.sourceforge.io http://montage.ipac.caltech.edu/docs/HEALPix/
A very special and incredibly imaginative solution is the one of
@AndyGainey, explained in detail here: http://experilous.com/1/blog/post/procedural-planet-generation
To avoid avoid pentagones and predictable irregularities, he decided to do the total opposite: going full irregularity.
When irregularity (in size, shape and number of edges) is everywhere and random, the surface actually becomes regular - homogeneous in its irregularity. Really brillant, but not what I need for my game, as I really want regular hexagons.
So, what I do is that I divide the sphere in vertical "slices". Inside each slice, the triangles/hexagons are set in perfectly horizontal rows, and are (almost) pefectly equilateral. The non-uniformity is grouped in the links between slice.
One big advantage is that the more hexagons there are, the more regular it becomes. And for my game, I'll have a lot, lot of hexagons. Here is the sphere with a few thousands ones.
And here is a portion of the surface, with a few millions of hexagons. Can you spot the irregular shapes ? Not easy ! They should definitely not be a problem when playing on this field.
The "Icosahedron tessellation" method produces only 12 pentagons. With my method I get much more: 720 for a sphere of 14000 hexagons (5%). But the more hexagons, the better the ratio is. For 10 millions of hexagons, only 0.2% are pentagons or heptagons.
I have calculated the variation in the triangles edge lengths (are hexagons are uniform in shape and size ?): I get a coefficient of variation of 6.5% for the icosahedron tessellation ; but only 1.6% with my method.
The best advantage of my solution is about the orientation of the hexagons (are they "horizontal" ? I check the angles of the triangles edges). I get a coefficient of variation of only 3.8%, compared to the 55% with the icosahedron tessellation!
Here it is. 5 years later, i have no regret using this system, i still can't think of a more suited one. Although, i can say now that i definitely underestimated the technical complexity of using this system in a full game, to properly manage the slices borders.
If I had had more time, i would have loved to research further in this matter. Maybe find a way to avoid the slices. Or something else.
If any of you know of some interesting research about it, i'd be very interested to know about it!
Release:15.02.2023
Genre:
Strategie
Entwickler:
Gaddy Games
Vertrieb:keine Infos
Engine:keine Infos
Kopierschutz:keine Infos
Franchise:keine Infos
Einzelspieler
Mehrspieler
Koop