Use vector algebra and remove duplication, refs #4845, #4805.
Unify the first createTerrain call with InitMap.
Move mountain constants and the information which height receives which
texture to the top.
This was SVN commit r20914.
The gamesetup will never be able to do something useful with it,
especially change it as an option, so it shouldn't be in the JSON file.
Fixes#4973.
This was SVN commit r20912.
Areas proportional to the map radius are easier to comprehend than areas
proportional to the square with the map diameter for sides.
This was SVN commit r20905.
The height is only a concern to the random map script, not the rmgen
library, nor the gamesetup, nor the simulation.
Reveals the actual initial elevation to the random map script author
without looking up the JSON file.
Group and rename all height constants of random maps below the template
names.
Rename waterHeight to heightSeaGround to prevent confusion with the
actual waterlevel.
Remove useless paintTerrainBasedOnHeight calls on African Plains and
Polar Sea.
This was SVN commit r20904.
Lets the random map script decide which baseTerrain and baseHeight it
wants to use before initializing the map,
rather than painting what is in the JSON file, then changing ones mind
and painting something else on top of it.
This cleaner heightmap initialization incidentally addresses the
uninitialized border of the heightmap in that commit (excluding the
Unknown).
This was SVN commit r20900.
Summary: Improve binary security by enabling a hardening linker flag.
Test Plan:
Patch already used on Debian.
Tested locally by @Gallaecio as well.
Reviewed By: LudovicRousseau
Trac Tickets: #4894
Differential Revision: https://code.wildfiregames.com/D1123
This was SVN commit r20896.
Use it to replace the hacky resetTerrain rmgen2 function from 6d52a71d4a
and initHeight from 280a797620.
Highlights that createArea is the primary tool of rmgen, rather than
nested for-loops over the mapsize.
Neglect that the heightmap grid is one tile larger than the tilemap grid
for now.
This was SVN commit r20894.
Since it is the only map with stronghold placement where the mines are
placed facing away from the team center, this code should be moved to a
library eventually, refs #3851.
This was SVN commit r20891.
This way random map scripts can do vector math and pass the result to
library functions that do further vector math on them and leave shorter
code, refs #4845.
Pass tilegrid coordinates rather than percent numbers to the playerbase
functions too, refs #4939.
Some more mapCenter calls, refs #4854.
This was SVN commit r20882.
This allows creation of paths that are not linear nor sine-shaped like
the PathPlacer, refs #892.
To mimic the per-tile path elevation randomization on Deep Forest, use a
SmoothElevationPainter and it's randomization argument from 77f28c5a56.
Use vector algebra and the mapCenter getter, refs #4845, #4854.
This was SVN commit r20879.