Commit Graph

17818 Commits

Author SHA1 Message Date
elexis e596ef6011 Extend the random map river algorithm (7d0cc59136) to allow arbitrary start and end points.
Reverse engineer and cleanup obfuscated Rivers map code, refs
a9b963c3a5.
Use vector algebra to replace magic equations and express geometric
intend.
Fix seed typo by removing river curve duplicate.

On the Rivers map, use areAllies directly instead of copying the
diplomacies to a 2D array called isRiver.
Use modulo operator instead of an if-statement with duplication to
determine the neighbor of the last player, refs 9272153ee7.

This was SVN commit r20429.
2017-11-09 19:08:31 +00:00
elexis b3dbcc457b Add Vector3D crossproduct and Vector2D perpendicular function.
Describe geometric features of the two cross- and dot-product functions.

This was SVN commit r20428.
2017-11-09 19:04:39 +00:00
LordGood 8ee600b979 Carthaginian range, workshop, elephant stable, mauryan stable, babylonian defense tower
This was SVN commit r20427.
2017-11-08 22:24:51 +00:00
Stan a35da35c33 "Remove History string wrongly re-added in previous commit and height tag, which is inherited from the parent template"
This was SVN commit r20426.
2017-11-08 22:00:11 +00:00
Stan 28b2bd9d03 New Brittonic storehouse + compressed blendfile with packed textures
Reviewed by LordGood & Enrique

This was SVN commit r20425.
2017-11-08 21:31:54 +00:00
vladislavbelov aa6617f431 Removes a buffer_zone from the game speed dropdown, introduced in 16de5c75ac
This was SVN commit r20423.
2017-11-07 23:13:42 +00:00
mimo 34557b5bb8 petra: few tunings
This was SVN commit r20422.
2017-11-07 19:11:06 +00:00
mimo dcdc89056f remove town_phase from crannog techs as this tech is required to build the crannog, and that gives a weird structree
This was SVN commit r20421.
2017-11-07 17:36:45 +00:00
elexis efd9b3e212 Obliterate Unknown (0d0bc32736), Unknown Land (25682da568) and Unknown Nomad (7f8adcf8cb) triplication of doom, fixes #4317.
Refactor by moving from procedural programming to functional
programming.
Fix the horrendous shoreline performance bug on "Continent" of Unknown
as in 49721cff33 by dropping the historic differences between the maps.

Remove misleading player coordinate computation when generating the
terrain on Unknown Nomad, because the players are spawned elsewhere
then.
Remove names like md, mdd1 and mdd2 with different connotations in every
landscape type.
Remove six more paintRiver copies in the "Edge Seas" variant as in
7d0cc59136.
Remove createShoreJaggedness and createExtensionsOrIslands duplication
within this triplication.
Remove heightmap initialization octuplication by adding initHeight.
Remove horizontal/vertical duplication by using logical operators.
Remove Painters redundant with the paintTerrainBasedOnHeight calls,
pointless comments and cleanup createArea calls as in 376d8b3d1e.
Remove some forest helper duplication as in ac8f4f49fc.
Remove references to Math proxies and use the prototype functions
directly.
Remove whitespace issues.

Describe remaining calls with human-readable log messages.
Always spawn enough treasures for a CC (instead of sometimes only giving
enough for a dock), refs 5dd3cbb254.
Generate "Mainland" variant with the same probability as the other
landscape types.
Generate "Central Sea" variant on Unknown Land too by forcing an Isthmus
then.
Don't split players on Unknown Nomad on the "Rivers And Lake" variation,
because the resource imbalance is too drastic.
Consistently call markPlayerArea before terrain generation on non-Nomad
maps.

Differential Revision: https://code.wildfiregames.com/D252
This was SVN commit r20420.
2017-11-07 17:11:51 +00:00
elexis 280a797620 Fix reference error in cfdd37f6d9 by computing that value independent from prior code.
This was SVN commit r20419.
2017-11-07 16:20:43 +00:00
Stan 680186478e New Brittonic range + compressed blendfile with packed textures
Reviewed by LordGood

This was SVN commit r20418.
2017-11-06 22:40:03 +00:00
elexis 75c479d3cb Unify Caledonian Meadows and Wild Lake player location duplication from ca654e3f79 / 8d4af29faf, refs #4805.
Move getOrderOfPointsForShortestClosePath from library.js to math.js,
refs #4804 and name it sortPointsShortestCycle.

This was SVN commit r20417.
2017-11-06 13:51:43 +00:00
elexis 6fb6a65fc5 Move rmgen player location functions from library.js to player.js, refs #4804.
Doesn't change the code besides abstracting distributePointsOnCircle and
attempting to improve the documentation, refs #4831.

This was SVN commit r20416.
2017-11-06 13:40:10 +00:00
elexis df14c914e6 Move starting player entity rmgen functions from misc.js to a new player.js, refs #4804.
Remove two duplicates of the starting entity placement code in the
Fortress map of 208e642089 and placeCivDefaultEntities of 9c3e94acfd by
just making the distance an argument, refs #4805.

Equally to the starting cavalry, don't spawn special units like dogs or
worker elephants on Fortress twice, but only the women and Infantry.
Consider the weird kwargs iberWalls argument of placeCivDefaultEntities
from 9c3e94acfd deprecated and just make the orientation a regular
optional argument.
Rename createStartingPlayerEntities to placeStartingEntities.

This was SVN commit r20415.
2017-11-06 12:17:56 +00:00
Stan a10b8e16c2 New Brittonic stable + compressed blendfile with packed textures
Reviewed by LordGood

This was SVN commit r20414.
2017-11-05 22:51:58 +00:00
mimo 567c485d92 petra: fix 86b9159609 (typo and deserialization)
This was SVN commit r20413.
2017-11-05 21:08:37 +00:00
elexis b1e8036f35 Cleanup gate locking GUI code of 013ab4bda7.
Differential Revision: https://code.wildfiregames.com/D1004
Patch By: temple
Remove any unneeded complexity to compute the button states.
The entity state of selected gates was changed, so fix the read-only
errors following 9cb0a60d73, refs #4257.

This was SVN commit r20412.
2017-11-05 16:59:09 +00:00
elexis 6a890127f6 Unify 5 copies of the tributary river placement code, refs #4805.
This was SVN commit r20411.
2017-11-05 15:51:40 +00:00
elexis cfdd37f6d9 Move landscape generation functions from misc.js to gaia_terrain.js, refs #4804.
Rename passageMaker to createShallowsPassage to avoid confusion with
straightPassageMaker aka PassMaker from Corsica & Sardinia and Pyrenean
Sierra.
Remove TILE_CENTERED_HEIGHT_MAP operations in that function from
3c6bce057e that don't do anything.
Add infinite loop protection to getTIPIADBON.
Remove unneeded parentheses, braces, redundancy, whitespace issues, use
early return and merge consecutive if-statements with a logical or in
these functions.

This was SVN commit r20410.
2017-11-05 13:56:21 +00:00
mimo 86b9159609 petra: revisit the management of constructions for better performances and cleaner implementation
This was SVN commit r20409.
2017-11-05 13:56:16 +00:00
elexis 4562bc998c Fix wrong dock owner (off-by-1) in Migration in 376d8b3d1e, fixes #4837.
This was SVN commit r20408.
2017-11-05 11:06:26 +00:00
elexis ac8f4f49fc Delete the remains of rmgen/utilityfunctions.js, refs #4804 by
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.
2017-11-04 13:04:54 +00:00
elexis 822e37f70c Remove references from the random mapgen library to terrain globals of maps.
Maps should not be required to define all these globals and use them
with the connotation implied by these utilities.

Split utilityfunctions.js to gaia_entities.js and gaia_terrain.js to
make it more transparent what files contain, refs #4804.
Document these functions #4831.

Refactor stoneMine placing and use for...of loops.
Fix Extinct Volcano call.
Forest utilities will be handled separately.

This was SVN commit r20405.
2017-11-04 11:17:23 +00:00
fatherbushido 17b50a2aa7 Remove duplicated builder list.
Patch By: Nescio
Differential Revision: https://code.wildfiregames.com/D1008
This was SVN commit r20404.
2017-11-03 17:23:44 +00:00
fatherbushido 22d1481cf5 Template organization: move some structures from other/ to structures/
Patch By: Nescio
Differential Revision: https://code.wildfiregames.com/D1002
This was SVN commit r20403.
2017-11-03 11:00:07 +00:00
fatherbushido 4104bf6ce0 Fix a typo.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D1005
This was SVN commit r20402.
2017-11-03 10:22:27 +00:00
elexis 886096e215 Use @file JSDoc tag for the rmgen library, so that these comments are distinguished from block tags about globals, refs #4831.
Cleanup Area class.

This was SVN commit r20400.
2017-11-02 17:35:19 +00:00
mimo 2ead236afe petra: allow elephant stables for all civs, and some internal cleanups
This was SVN commit r20399.
2017-11-02 16:16:11 +00:00
mimo bff1f33bfd template organization: elephant stables
Patch by: Nescio
Reviewed By: mimo
Differential Revision: https://code.wildfiregames.com/D1001
This was SVN commit r20398.
2017-11-02 15:58:19 +00:00
elexis 63e77de94e Use only one coordinate system for locations in the rmgen system.
Thereby fix the distance check of the SimpleObject, refs #4338, D189 and
remove the CELL_SIZE engine constant magic number, refs #4034.

Differential Revision: https://code.wildfiregames.com/D996
Thanks a lot to rapidelectron and temple who independently discovered
this!

This was SVN commit r20396.
2017-11-01 22:59:27 +00:00
elexis 1f36686e6c Move checkIfIntersect and distanceOfPointFromLine from misc.js to math.js (because the latter should only contain terrain and entity placement utilities), refs #4804.
Delete unused getGradient and move getAngle from library.js to math.js.

This was SVN commit r20395.
2017-11-01 22:30:03 +00:00
elexis c7fee7f04f Remove wrong tension comment from a482f7bc1e and mention that this functon can compute a cardinal spline.
Keep the Catmull-Rom spline comment as ambiguous as the definitions we
found.

Differential Revision: https://code.wildfiregames.com/D1003
Reviewed By: fatherbushido
This was SVN commit r20394.
2017-11-01 16:02:08 +00:00
fatherbushido de1bb8a766 Move out of world promoted, packed and upgraded entity as they are not destroyed immediately. So they don't interact with the 'physical' world. Refs #4595.
Differential Revision: https://code.wildfiregames.com/D590
Reviewed By: wraitii
This was SVN commit r20393.
2017-11-01 14:55:18 +00:00
mimo 502ebdbe42 Adapt trade gain normalization to map size (increased on small maps and decreased on large maps), and slow down the increase of the gain at very large distances.
Reviewed By: Grugnas
Differential Revision: https://code.wildfiregames.com/D879
This was SVN commit r20391.
2017-10-31 17:52:08 +00:00
mimo bbac905de8 petra cleanup
This was SVN commit r20390.
2017-10-31 17:43:28 +00:00
mimo 4b0709c00c petra: allows stables and siege workshops build orders for all civs
This was SVN commit r20389.
2017-10-31 17:24:56 +00:00
elexis f41a9bb2c4 rmgen cleanup.
Remove PointXZ class which is essentially a subset of Vector2D, refs
#4834, #4804.
Remove Point3D which is unused and the same as Vector3D without the math
features, refs #4805.

This was SVN commit r20388.
2017-10-31 14:11:09 +00:00
elexis cdb8bd2100 rmgen cleanup.
Remove placeTerrain, and createObjectGroup from Map, because that class
should only have getters and setters, refs #4804.
Unify it with the global functions of the same name.
Let Map.createArea only construct and register the Area object with the
Map, but do the place and painter logic in the global function.

This was SVN commit r20387.
2017-10-31 13:42:56 +00:00
elexis cba0022560 rmgen cleanup.
Remove initTerrain from Map, because that class should only have getters
and setters, refs #4804.
Unify it with the global initTerrain function.
Remove some redundant calls to that.

This was SVN commit r20386.
2017-10-31 13:06:15 +00:00
elexis a19aaed550 Move catafalque relic templates from the "other" directory to the regular units directory.
Differential Revision: https://code.wildfiregames.com/D994
Refs #4770, D152, D269
Patch By: Nescio
Some comments by fatherbushido

This was SVN commit r20385.
2017-10-31 11:44:24 +00:00
elexis a482f7bc1e Extend the cubicInterpolation function to consume a tension argument allowing to modulate the smoothness of the interpolation.
Thereby unify the chordal Catmull-Rom spline interpolation of the
ClumpPlacer (C++ bd53b14f58, JS 0e0ed94926),
the copy of that in the PathPlacer (bc805bd357, refs #892) and
the centripetal Catmull-Rom spline of the bicubicInterpolation function
from 93aefe0787, refs #4218
and don't claim the latter to be a uniform Catmull-Rom spline.

Reviewed in part by fatherbushido, discussed in 93aefe0787.

This was SVN commit r20383.
2017-10-30 20:43:01 +00:00
vladislavbelov 71a5ebe1c9 Adds a missed initialisation in 7e239f38a3.
This was SVN commit r20382.
2017-10-30 19:32:16 +00:00
Itms 7d1f56e617 Migrate to premake5, fixes #3729.
Make pyrogenesis and tests depend on Collada, fixes #404.

This commit includes custom modules for CxxTest and pkg-config support
that can be improved upon in the future. It also includes all necessary
changes to the build scripts, but the new premake5 features are not
fully exploited yet.

With this change, premake5 becomes the default, but CI scripts on Unix
will continue using premake4 for a while, in order to avoid regressions.

Includes code by zsol.
Reviewed by: wraitii, leper
Differential Revision: https://code.wildfiregames.com/D72
This was SVN commit r20381.
2017-10-30 13:52:05 +00:00
vladislavbelov 7e239f38a3 Adds a wireframe mode to the water rendering.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D769
This was SVN commit r20378.
2017-10-30 00:02:29 +00:00
vladislavbelov 38d09ce35c Adds a perspective matrix, refracts a matrix projection setup to prepare for an isometric view.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D971
This was SVN commit r20377.
2017-10-29 23:41:59 +00:00
elexis cd1b40f295 Consistently use utf8 instead of iso-8859-1 encoding in XML files.
Differential Revision: https://code.wildfiregames.com/D622
Reviewed By: Dunedan
This was SVN commit r20376.
2017-10-29 17:18:32 +00:00
elexis 2374c0bc10 New unit selection textures for the healer and mods/future usage.
Differential Revision: https://code.wildfiregames.com/D889
Patch By: Nescio
Reviewed By: wowgetoffyourcellphone
This was SVN commit r20374.
2017-10-29 14:10:38 +00:00
fatherbushido c4cf9efad0 Add a unit test to EntityLimits component. Refs 1f10d2a711.
Differential Revision: https://code.wildfiregames.com/D987
This was SVN commit r20373.
2017-10-29 08:06:45 +00:00
fatherbushido 1f10d2a711 Fix an issue with upgrade and entity limits.
Reviewed by: wraitii
Differential Revision: https://code.wildfiregames.com/D960
This was SVN commit r20372.
2017-10-29 08:03:43 +00:00
elexis f5b978f5c2 Document the rmgen Map class, refs #4831
(excluding the height handling which needs revision and functions that
should be relocated).

This was SVN commit r20371.
2017-10-29 06:25:06 +00:00