Start unifying the euclidian distance functions instead of adding yet
another helper function to the random map script library after this
diff.
Differential Revision: https://code.wildfiregames.com/D969
Math.square accepted by mimo
Includes changes proposed by bb, fatherbushido
This was SVN commit r20328.
The island generation code was copied once for
* the small mapsize and 2 players
* the small mapsize and 3 players
* the small mapsize and 4 players
* the small mapsize and more than 4 players
* the medium mapsize and up to 4 players
* the medium mapsize and more than 4 players
* the normal mapsize and up to 5 players
* the normal mapsize and up to 7 players
* the normal mapsize and 8 players
* the large mapsize and up to 5 players
* the large mapsize and more than 5 players
Within each of these copies there were three copies of the island
createArea+placer+painters call and
about 10 unreadable island connection setter copies.
Support mapgenerations with only one player.
Cleanup createAreas calls as in 376d8b3d1e and broken indentation.
Fix missing forests due to a missing parentheses in the forest count of
that commit.
This was SVN commit r20308.
The code for the other island was copied in a varying order with only
the values changed to 1 - x.
Unite the island, subisland, creeks, beaches, main relief, first
plateau, second plateau and passagess code under a single loop to
display the logical relation
instead of scattering many paragraphs and executing unrelated (starting
base) code in between.
Cleanup affected createArea calls as in 376d8b3d1e.
This was SVN commit r20306.
Just for the record (as all of that is going to be deleted soon), add
the missing variable declarations that were hoisted from an unrelated
loop prior to 45bb3d2a43.
This was SVN commit r20302.
Inline the placer, terrainPainter, elevationPainter, group and sizes
helper variables that are used only once.
Thus do not hoist variable declarations from unrelated scopes.
Remove few dozens of painters that are overpainted by the
paintBasedOnTerrainHeight call afterwards.
Remove 334 noisy misaligned code comments (// terrains // widths //
blend radius and // some variation).
Label the createArea calls so that the reader knows what they do.
Remove unbenefitial Math.PI/8 grass min/max angle limitation.
Use height variables for the SmoothElevationPainter calls so that levels
can be modified more easily.
Use Math prototype functions instead of the unfortunate rmgen proxies.
Does not touch starting base code, Unknown maps, Snowflake Searocks and
Corsica & Sardinia which need special treatment.
This was SVN commit r20301.
Unify clCorsica, clSardinia to clIsland and the duplicate resource
placement calls using that.
Move and simplify the logic determining which texture to paint depending
on height and slope to a function getCosricaSardiniaTerrain.
Inline the createTerrain to greatly increase readability while possibly
reducing performance slightly.
Fix whitespace of createObjectGroup calls.
This was SVN commit r20296.
The new math library file will contain five more math helpers used by
random maps, refs #4804.
These functions are agnostic of random map vocabulary, so could possibly
be moved to or unified with globalscripts.
Cleanup and label obscure createArea calls in this map, unify duplicate
magic numbers, refs #4805.
Remove three useless LayeredPainter calls that are overwritten by the
paintTerrainBasedOnHeight tShore and tWater calls afterwards.
This was SVN commit r20295.
Do not return a string in getRandomDeviation when we need a floating
point number.
Simplify the equation and do not round arbitrarily.
This was SVN commit r20285.
Let validT take the responsability to account for the actually valid
region of map tiles instead of each caller.
Fixes#4814, refs #4636, #4796
This was SVN commit r20283.
Delete the function altogether and create that simple array that is only
used in addForests just there.
Delete addForests calls from Ngorngoro that don't do anything.
This was SVN commit r20280.
Rename initBiome to initForestFloor, getTeams to getTeamsArray.
Unifying duplicate coordinate computation and inlining unneeded
createArea helper variables in Lions Den.
This was SVN commit r20278.