Fixes unreachable small stone mines inside large stone mines.
Fixes#4338.
Differential Revision: https://code.wildfiregames.com/D189
Credit rapidelectron for working out the two main issues (refs
63e77de94e) and providing a similar patch.
This was SVN commit r21283.
ChainPlacer, ClumpPlacer, SimpleObject receive the vectors that are in
place everywhere already, refs #4845.
Add public setCenterPosition to CenteredPlacer and Group rather than
writing private properties of the prototypes.
ChainPlacer and ClumpPlacer simplifications, deduplication and renames,
refs #4805.
Replace placeObject global with RandomMap placeEntity members, refs
#4804.
Split to placeEntityPassable / placeEntityAnywhere, as well as
validTilePassable / validTileAnywhere to more cleanly distinguish actor
and casual entity placement.
No more does SimpleObject create Entity instances and register entityIDs
if they are never placed.
Removes the map global reference from the Entity constructor, refs
#4964.
By definition of what is passed to the engine, an Entity has an ID and
position, so keep it impossible to create Entities without IDs.
Implement randomPositionOnTile so that there aren't different
implementations thereof, including unintented ones as in
ardennes_forest.js in 2f7610160f.
On Caledonian Meadows, remove unused pathplacing code, to be superseded
by #4368.
On Schwarzwald, delete unused startLocations following b180ad3e5d.
On Latium, replace complicated duplicated hardcoded fish location
computation with a simple HeightConstraint, refs #4960.
This was SVN commit r21069.
The reference to the global should not be hidden behind a proxy function
and
object orientation is preferable over procedural code in general.
This was SVN commit r20996.
Support non-integer values and remove some unneeded floor / rounds.
Use more vector math in Caledonian Meadows, Oasis and Wild Lake, refs
#4845.
This was SVN commit r20971.
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.
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.
Fine-tune random map scripts if nomad mode is enabled by omitting gaia
attackers and vast voids.
Fix nomad units on the Unknown sometimes being stuck on mountains or
tiny islands, refs #3140.
Discussed with: bb
This was SVN commit r20866.
Unifies 54 variants of the rmgen playerbase code, fixes#4805.
Add retry loops to prevent collisions of starting resources, fixes#4600
and
resources placed outside of the map area, fixes#4796.
Lays the foundation to test for collisions with Iberian walls, refs
#2192 and
allows to rearrange the starting resources on all random maps without
being confronted with code.
Delete remains of misc.js, leaving the rmgen files sorted by logic,
fixes#4804.
Concludes what was started in 5f1736cbd4, f98100bdaf, specifically the
82 rmgen commits starting f2550705d3, 376d8b3d1e.
Uses vector algebra, refs #4845.
Removes many Math proxy calls, refs #4933.
Removes 35 unused elevation and 24 unused cliffRadius variables,
demonstrating the copy&paste antipattern.
Reduce iberian-wall hardcoding to one line, refs #4940.
This was SVN commit r20815.
Use vector algebra to simplify it and the according maps, refs #4845.
Remove stepSize parameter as long as the non-interpolated heightmap grid
is tested.
This was SVN commit r20775.
Remove ocean duplication on Pyrenean Sierra, fix sign of the removed
lololo variable and simplify the player angle equation, refs #4805,
a796800bb1.
Use mapCenter getter from #4854 on Gulf Of Bothnia, Pyrenean Sierra and
the Unknown gulf variant.
This was SVN commit r20703.
This allows replacing the common code with a library call in only one or
two hunks each.
On Archipelago move the random resources closer to the playerbase to
make the map more enjoyable.
Use default/skirmish templates for the docks on Islands/Migration and
the market on Polar Sea while at it.
Abort map generation if the dock placement failed.
Remove clForest dummy variable on Polar Sea following the removal of
references to map defined tileclasses in the library following
822e37f70c.
This was SVN commit r20476.
cleaning up the createForests function.
Remove g_numStragglerTrees and clForest references from the rmgen
library.
Compute the number of forest- and straggler trees in a new function
instead of hiding it and obstructing the placement code.
Remove unused numMultiplier argument.
Replace duplication of these three functions with calls to them, refs
#4805.
Remove duplicate random biome JSON constants of the Islands, Migration
and Snowflake Searocks map.
There is significant partial createForests duplication that should be
unified eventually.
This was SVN commit r20406.
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.
Proposed library and directoryname agreed with FeXoR.
Make the rmgen/ biome agnostic by moving the biome constants in
createForests to the randombiome globals.
Don't pass a non-randombiome constant in gulf of bothnia to the
createForests function that expected a randombiome constant, refs
e17dd1ac12, accepted by Grugnas.
Remove unused trivial unrecommended randomizeBiome function,
make Biomes autocompletable in the gamesetup chat, refs D852.
This was SVN commit r20127.
Fix numeric biome indices in unknown_land, unknown_nomad and
island_stronghold.
Differential Revision: https://code.wildfiregames.com/D873
Patch By: Grugnas
This was SVN commit r20117.