The idea of a 3D map for Dominance is not a new one. In fact, work was done in 2009 to create a 3D map generator for Dominance that resulted in entity(Ther)’s master’s thesisÂ “Optimization of SQL procedures for accomplishing complex functions in real time” which is just a fancy name for “Reducing the bloody Dominance lag and calculating vision on a 3D map“. Naturally, entity(Huitz) had something to contribute, notably an application for generating height maps from the 3D map database as well as a crucial piece of code called ARCTANHUITZ that defines how soft the transitions between Vornoi diagrams must be.
For example, a generated height map could be represented into terrain like this:
Note that this particular height map is some 1024 pixels long, and we will map those pixels to hexes at 1=1, so in V1/2 terms this map would be some 10000×10000 pixels large.
If you are interested in the exact algorithm behind this, it’s actually rather simple:
- dsa = diamond square algorithm (blank map)
- vorn = vornoi diagrams (blank map)
- noise = random.noise (blank map)
- final map = blur(0.7*dsa + 0.2*vorn + 0.1*noise)
The DSA gives (always) rough terrain – a relatively fine mountainous imitation. Vornoi is overlaid to give it a splash of otherworldly-ness. Now, if we decide that, for a whiteness range of 0-250 (height maps represent height in shades of gray), everything from 80-125 should be made 125 (creating flat terrain), and everything below 80 should be -1 (represented by water for example), we can approach a nicer result:
Of course this is very far from the final product, but for my current needs this will serve – as the goal is to properly map the pixels to hexes, place some objects, and attempt to display a small portion of the map in the browser.