Commit Graph

18239 Commits

Author SHA1 Message Date
elexis 32210bc6cb Fix pigs and chicken inside the CC and mines on Deep Forest by not using the terrain-painting based approach of placing entities which is free of any collision checks.
Fixes #4830.

This was SVN commit r20906.
2018-01-18 17:59:07 +00:00
elexis bd7ce79966 Delete getMapArea, fractionToSize, sizeToFraction.
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.
2018-01-18 17:10:57 +00:00
elexis c5b7ecefa1 Delete BaseHeight property from random map JSON files and rmgen library, refs #6, #4973, 9ee44bd9b8, 0e0ed94926.
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.
2018-01-18 13:57:11 +00:00
elexis d40616c68e Fix Wild Lake in 442c9848b8.
This was SVN commit r20903.
2018-01-18 13:36:59 +00:00
elexis 6462653351 Delete placeTerrain which is just a proxy of createTerrain.
This was SVN commit r20902.
2018-01-17 23:51:28 +00:00
elexis a6c7b4de98 Simplify and inline createSimpleTerrain.
This was SVN commit r20901.
2018-01-17 23:36:11 +00:00
elexis 1ad10e5999 Merge InitMap, initTerrain and resetTerrain successors from 6d33c2eab7.
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.
2018-01-17 23:27:06 +00:00
mimo 583873103f petra: add a protection for mods without the expected metadata
This was SVN commit r20899.
2018-01-17 22:06:27 +00:00
elexis dfa618903b Rename random map Map to RandomMap, so that it doesn't overwrite the native JS Map object, fixes #4961.
This was SVN commit r20898.
2018-01-17 19:19:21 +00:00
elexis c21ca495f8 Fix a forgotton line in e9e983c2d4 and mess with a 1-tile workaround.
This was SVN commit r20897.
2018-01-17 19:12:22 +00:00
Gallaecio 4e96980d5a Build with the "read-only relocation" hardening linker flag
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.
2018-01-17 18:01:58 +00:00
elexis d9f5b2a40e Remove mysterious lake area factor "lSize" from random map scripts in a9b963c3a5 and copies. Fixes #4958.
Just use diskArea of a ratio of the map diameter everywhere, so numbers
remain proportional and directly comparable.

This was SVN commit r20895.
2018-01-17 17:18:43 +00:00
elexis 6d33c2eab7 Implement MapBoundsPlacer that returns all points on the tilemap.
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.
2018-01-17 03:34:09 +00:00
elexis 46564c6a8e Remove remaining unneeded null constraints that could have been noticed in 376d8b3d1e.
This was SVN commit r20893.
2018-01-17 03:09:23 +00:00
elexis 4263fae6c2 Don't call it centerOfMap, center, mid, centerX, centerZ, fractionToTiles(0.5), Math.round(fractionToTiles(0.5)), mapSize / 2, mapSize * 0.5, but just mapCenter everywhere and get it from the library.
Fixes #4854, refs #4845.

This was SVN commit r20892.
2018-01-17 01:55:45 +00:00
elexis 1f7913a93f Cleanup Island Stronghold starting resources code using vector algebra, mapcenter getter, distributePointsOnCircle, refs #4845, #4854.
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.
2018-01-17 00:51:25 +00:00
Stan cf79693860 Fix incorrect variants showing up as death and run shouldn't have any frequency.
Noticed by Alexandermb

This was SVN commit r20890.
2018-01-17 00:25:58 +00:00
elexis 448a560350 Move map specific biome constants to the scope setting that biome in that map, refs #4954.
Only Gulf of Bothnia didn't have it grouped yet.

This was SVN commit r20889.
2018-01-16 20:55:00 +00:00
elexis 713d816855 Use paintRiver on Latium, refs #4805, 7d0cc59136.
This was SVN commit r20888.
2018-01-16 17:38:03 +00:00
elexis 31e412b94e Remove redundant no-map-preview sprite found in D817.
This was SVN commit r20887.
2018-01-16 15:18:15 +00:00
elexis 960f2d7c31 Enable players to open the lobby as a dialog in the gamesetup, running games and the summary screen.
Differential Revision: https://code.wildfiregames.com/D817
Patch By: fpre / ffffffff
Fixes #4106

This was SVN commit r20886.
2018-01-16 15:05:16 +00:00
mimo 2d04f3d1e9 fix 30f0e80dae
This was SVN commit r20885.
2018-01-16 08:29:10 +00:00
elexis 28ff1c053e Via Augusta skirmish map by Bigtiger, fixes #4934.
This was SVN commit r20883.
2018-01-16 05:36:05 +00:00
elexis 442c9848b8 Merge all playerX and playerZ arrays into one array of Vector2D items.
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.
2018-01-16 04:39:31 +00:00
elexis f8eae16390 Fix two wrong tileclasses c74bd3425f and adapt Fortress floor area to D900.
This was SVN commit r20881.
2018-01-16 04:29:06 +00:00
elexis 463f7f1ee3 Remove unused function following f5375cbcb9. Implement it using vectors if used again (#4845).
This was SVN commit r20880.
2018-01-16 04:17:06 +00:00
elexis cbcbd19e0b Extract a RandomPathPlacer prototype from Deep Forest (83422923aa) and Schwarzwald (49194819f6) duplication, refs #4805, #4804.
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.
2018-01-16 04:12:23 +00:00
temple 7d172a9b1d Consider that the point could be inside the goal area in some PathGoal functions
Reviewed By: wraitii
Comments By: mimo
Differential Revision: https://code.wildfiregames.com/D1089
This was SVN commit r20878.
2018-01-16 02:15:04 +00:00
temple 033489480a Stop formation when ordered to stop
Differential Revision: https://code.wildfiregames.com/D999
Reviewed By: wraitii
Fixes #3565

This was SVN commit r20877.
2018-01-16 00:55:58 +00:00
temple 1ef2e709fe Gather near dropsite rather than current position after finishing construction
Summary:
{F316877}

Often we'll have a large group of units that we want to move to a new
location, but if we do that by having them building a dropsite, then if
the building's finished before everyone gets there, units still en route
will start gathering near their current position instead of near the new
location.

Test Plan: Agree.

Reviewers: wraitii

Reviewed By: wraitii
Subscribers: wraitii, Vulcan

Differential Revision: https://code.wildfiregames.com/D1162
This was SVN commit r20876.
2018-01-16 00:13:31 +00:00
mimo 30f0e80dae Cleanup of GetEntityState
Reviewed By: elexis
Trac Tickets: #4322

Differential Revision: https://code.wildfiregames.com/D1223
This was SVN commit r20875.
2018-01-15 21:27:30 +00:00
elexis 36400458bf Add randomAngle helper function to abbreviate calls.
This was SVN commit r20874.
2018-01-15 14:20:57 +00:00
elexis 5c605cf218 Allow the JS GUI to find out if the lobby client is currently disconnected.
Differential Revision: https://code.wildfiregames.com/D1224
Patch By: fpre / ffffffff
Refs #4106, D817

This was SVN commit r20872.
2018-01-15 04:30:33 +00:00
elexis e9e983c2d4 paintRiver cleanup.
Pass vectors, refs #4845.
Pass tile sizes rather than percent numbers of the map, refs #4939.
Replace some water- and land-functions with more common
createArea+RectPlacer and paintTerrainBasedOnHeight calls.

Implement getMapBounds to make references easier to read, refs #4854
(and thus less error-prone, refs db9a52b94a).
Move height constants to the top of the files.

Fix Aegean Sea, English Channel and Danubius fadeWidth off by factor of
2 in 7d0cc59136.
Fix forgotton clWater in unknown_common of c74bd3425f and move that
createUnknownObjects call to common.

This was SVN commit r20871.
2018-01-15 04:02:00 +00:00
Stan 31284bac83 Make every cape of the game behave.
Move some capes to more explicit names of their functions
Correct some inversions inside the inheritance

Fix capes for chariots and elephants, it wouldn't work because the death
variants were not specified,
and instead of keeping the order like Parent : None Child 1 : Death 1
Child1Prop : Death1 it would randomly
select the animations hereby breaking the chain, and therefore the anim.



Differential Revision: https://code.wildfiregames.com/D1213
Patch By : s0600204
Completition by : Stan
Reviewed by : Stan

This was SVN commit r20870.
2018-01-14 22:51:07 +00:00
elexis b982e7f510 Fix build on armhf with gcc 7.
The abs caused a compiler error in that environment, because wchar_t is
unsigned on armhf, subtracting signed from unsigned results in unsigned
and std::abs does not define an unsigned variant.

Differential Revision: https://code.wildfiregames.com/D1122
Patch By: Peter Michael Green
Uploaded By: Ludovic
This was SVN commit r20869.
2018-01-14 21:18:37 +00:00
elexis 8ede017904 Don't crash while in the lobby when receiving an error IQ stanza without an error payload, refs d7121f4f55.
Differential Revision: https://code.wildfiregames.com/D1222
Patch By: Dunedan
This was SVN commit r20868.
2018-01-14 17:48:24 +00:00
Stan e132c26a0f Fix a typo I made in the neckguard.
This was SVN commit r20867.
2018-01-14 11:15:58 +00:00
elexis c74bd3425f Nomad mode on all random map scripts (except Survival of the Fittest), fixes #3591.
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.
2018-01-14 00:59:06 +00:00
s0600204 7dfa4bda24 Pass an orientation angle on Fortress random map when placing fortresses
Should resolve current concern raised with 7aae697bc5.
(Until something better is done wrt default args and/or not having them,
or whatever.)

Refs D900, 7aae697bc5, #2944

This was SVN commit r20865.
2018-01-13 23:26:13 +00:00
elexis b180ad3e5d Remove distributeEntitiesByHeight / derivateEntitiesByHeight from 7471a0db63 / 49194819f6.
Fix collisions of mines with trees and berries on Schwarzwald.

It can't achieve anything that a createArea or createObjectGroups call
with a HeightConstraint (6278f75a1f) or HeightPlacer (49194819f6,
24f02d97eb) can't achieve too,
while it can't perform many crucial tasks like testing for arbitrary
Constraints, using custom shapes determined by a Placer or limiting the
amount of entities,
thus the unconventional code is redundant, refs #4805, #3764.

This was SVN commit r20864.
2018-01-13 22:42:14 +00:00
elexis d2e1af5270 Make the RectPlacer more permissive by not returning early if a coordinate is out of bounds.
Have some workarounds to mark tileclasses get rekt by this Placer.
Fix Hyrcanian Shores clHighlands class being painted on the entire
landarea rather than only the bottom 25% following 7d0cc59136.

This was SVN commit r20863.
2018-01-13 22:24:29 +00:00
elexis 6278f75a1f Add rmgen HeightConstraint to allow placing entities in a given height range.
This was SVN commit r20862.
2018-01-13 22:13:03 +00:00
elexis 495f83663e Extend the rmgen AndConstraint to be more permissive and receive falsy values or a Constraint to remove some Constraint conversion duplication, refs #4805.
This was SVN commit r20861.
2018-01-13 22:11:06 +00:00
elexis e8dea23cc4 Cleanup createArea calls on Deep Forest as in 376d8b3d1e.
This was SVN commit r20860.
2018-01-13 22:06:01 +00:00
elexis 55cdc8f639 Cleanup createArea calls on Neareastern Badlands as in 376d8b3d1e.
Use a separate tileclass for the oasis.
Use the mapCenter getter, refs #4854 and move important height and
radius constants to the top.

This was SVN commit r20859.
2018-01-13 22:01:59 +00:00
elexis d015b68f18 Fix unreachable trees on Oasis, fixes #4937.
Use constants instead of convoluting magic numbers
Use vector algebra and distributePointsOnCircle to determine the
locations of animals in the oasis, refs #4845.

This was SVN commit r20858.
2018-01-13 21:50:25 +00:00
elexis e58e60f75a Simplify island generation on Islands.
This was SVN commit r20857.
2018-01-13 21:42:46 +00:00
elexis 36afe80b27 Use vector algebra for the unconventional playerbase resources on Belgian Uplands, refs #4845.
Add an extra scope since that block will become conditional on nomad
maps, refs #3591.

This was SVN commit r20856.
2018-01-13 21:31:20 +00:00
elexis f8cc18589d Simplify the water-tileclass marking on Cycladic Archipelago and Corsica vs Sardinia using paintTileClassBasedOnHeight.
This was SVN commit r20855.
2018-01-13 21:26:59 +00:00