1
0
forked from 0ad/0ad
Commit Graph

17996 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
bbac905de8 petra cleanup
This was SVN commit r20390.
2017-10-31 17:43:28 +00:00
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
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
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
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
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
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
71a5ebe1c9 Adds a missed initialisation in 7e239f38a3.
This was SVN commit r20382.
2017-10-30 19:32:16 +00:00
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
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
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
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
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
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
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
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
5c0c11b20a Construct the final object containing the random map data in ExportMap passed to the engine in place instead of scattering that in multiple functions of multiple files.
Remove camera centering in that function because it contradicts the
modifiability of the camera global (besides being broken and only coming
into play if there are no player entities).

This was SVN commit r20370.
2017-10-29 05:29:04 +00:00
7b93690c76 Fix few typos found with the Debian lintian tool.
Differential Revision: https://code.wildfiregames.com/D973
Differential Revision: https://code.wildfiregames.com/D974
Differential Revision: https://code.wildfiregames.com/D975
Patch By: LudovicRousseau
Reviewed By: Dunedan, bb
This was SVN commit r20369.
2017-10-28 22:34:57 +00:00
3647200e8f Remove min/max mapsize constants from the rmgen library, refs #4034.
The removed values were in fact arbitrary GUI numbers no map script
should confuse with engine limits.

To not make it my words, quoting FeXoR from #4034:
"I agree removing MIN_MAP_SIZE and MAX_MAP_SIZE and make the parameters
of scaleByMapSize optional with the default being 128 to 512."

This was SVN commit r20368.
2017-10-28 17:37:09 +00:00
bb
c72d2b6dc0 Allow attack and attack_impact sounds for multiple attacks
Add "melee", "ranged" etc. to the template tag name,
Allow and use specific sounds for slaughter,
Rearrange the templates a bit, and so add missing sounds.


Reviewed By: fatherbushido
Differential Revision: https://code.wildfiregames.com/D757
This was SVN commit r20367.
2017-10-28 16:52:37 +00:00
b856281197 Alpha 12 version of Premake 5, including prebuilt binary for Windows.
Directly taken from https://premake.github.io/.

Refs #3729.

This was SVN commit r20366.
2017-10-28 16:10:49 +00:00
e87517be69 Add our script for building patches with Jenkins to version control.
Refs #4419.
Reviewed By: leper, elexis
Differential Revision: https://code.wildfiregames.com/D18
This was SVN commit r20365.
2017-10-28 15:54:44 +00:00
7e0d19cd7a Linting with Coala.
This new script and the associated configuration files lint our source
code (JS and C++). This will be extended in the future, refs #4833.

Reviewed By: Imarok
Differential Revision: https://code.wildfiregames.com/D213
This was SVN commit r20364.
2017-10-28 15:30:37 +00:00
1033e105f0 Tweak a bit citizen cavalry costs. Follow the same infantry vs cavalry policy as for champs and heros. Motivations are: infantry vs cavalry consistency (from the abstract unit role point of view), preventing some unbalances, enforcing a more realistic infantry vs cavalry ratio in game.
Accepted by: Nescio, Grugnas
Differential Revision: https://code.wildfiregames.com/D983
This was SVN commit r20363.
2017-10-28 10:33:01 +00:00
f5375cbcb9 Delete _kali's Alpha 21 maps since it is not certain that they are not derived works, refs D957, 33e3e6c2ab, 34c26767ca, f61f051d74, c70975b116, a68881dd0f, 64b1da0ddf, 127ca4e177, #4226.
Keep now unused, yet unalteredly useful paintHeightmap JS function
(until CMapReader::LoadRandomMap can load PMP files, refs #4816),
bicubicInterpolation and randomPlayerPlacementAt.

This was SVN commit r20362.
2017-10-27 19:26:46 +00:00
24f02d97eb Move the HeightPlacer from the Schwarzwald map (49194819f6) to the placer library, refs #4804.
Remove the unneeded NullConstraint check.

This was SVN commit r20361.
2017-10-27 15:32:22 +00:00
6677f2bfe1 Rename placer.js to placer_centered.js and pathplacer.js to placer_noncentered.js, refs #4804.
Document the difference between the two types of classes, refs #4831.
Move RectPlacer (as of 7d0cc59136 unreferenced but possibly useful)to
placer_noncentered.js and remove three redundant checks there.

This was SVN commit r20360.
2017-10-27 12:40:30 +00:00
93b2211d17 Move SimpleObject and RandomObject from placers.js to a new file, because they aren't Placers, refs #4804.
Define what an Object is, refs #4831.
Remove RandomObject duplication from c02818ceea by just calling the
SimpleObject with a random template, refs #4805.

Remove the tautologous (!fail) check and replace needless multilevel
fail-check nesting with two && operators.
Move default parameters from the function body to the function header
and rename resultObjs to entities.
Throw errors instead of printing something if min > max.

This was SVN commit r20357.
2017-10-26 23:51:54 +00:00
c136848b74 Fix lineendings of new files and the ones in source/ that didn't receive the eol property yet.
To confirm, use svn diff -r 20355:20356 -x "-w --ignore-eol-style"
--ignore-properties  | less

This was SVN commit r20356.
2017-10-26 17:03:29 +00:00
f6c2ea6b0e Move SimpleGroup and RandomGroup from placers.js to a new file, because they aren't Placers, refs #4804.
Document what a Group is, refs #4831.
Remove duplicate place function by calling the SimpleGroup from the
RandomGroup, refs #4805.
Move the default parameters from the function body to the function
header, remove duplicate CELL_SIZE division, pointless comment and use
let instead of var.

This was SVN commit r20355.
2017-10-26 16:47:07 +00:00
77f28c5a56 Remove SemiRandomElevationPainter from Pyrenean Sierra, which is a painful straight copy of the SmoothElevationPainter introduced in a796800bb1, refs #4805.
It should have been added to the painters file instead of to the map if
a copy was acceptable.
Add the only simple capability it added (an unnoticeable random
elevation difference to each vertex) to the SmoothElevationPainter to
make it universally accessible.
That painter also had a bug, because it replaced the roughness with 5 if
0 was given.

This was SVN commit r20354.
2017-10-26 13:50:28 +00:00
8d49497671 Replace SmoothElevationPainter 8/9 weights with 1, so that the elevation of a heightmap grid vertex is exactly the average of the new elevation and the average of the existing elevation of the 9 vertices that are the current vertex or adjacent to it.
Doesn't change the result perceptibly while removing otherwise
incomprehensible magic numbers from 61387e95b2.
The equations are so similar that one might expect that the averaging
was the intended algorithm.

This was SVN commit r20353.
2017-10-26 13:25:51 +00:00
40289e4a1a band-aid for a couple spartan building's garrison points. actual fixes still needed
This was SVN commit r20352.
2017-10-26 13:16:50 +00:00
21ea4c3173 Do not use the spread operator in the AI euclidian distance helper function which made it 200 times slower, as reported.
(The spread operator is not faster in sm45 according to my test.)

Differential Revision: https://code.wildfiregames.com/D980
Refs 6590f301c2.
Not accepted by anyone.

This was SVN commit r20351.
2017-10-26 12:56:51 +00:00
ed0fb223b2 Unify duplicate Breadth-First-Search traversing of the LayeredPainter and SmoothElevationPainter in a new helper function, refs #4805, making it much more comprehensible what each part does.
Document the two classes, the new function and every step of their
execution, refs #4831.
Unify SmoothElevationPainter height computation duplication, remove
pointless comments, use array functions and the prefix increment
operator.

This was SVN commit r20350.
2017-10-26 12:37:02 +00:00
007748d9b3 Move ElevationPainter and SmoothElevationPainter constants above the SmoothElevationPainter, refs #4804 and define them, refs #4831.
Remove two unneeded variables and reduce the performance by some
milliseconds by using for...of loops, the destructing assignment and
inlining the unified DX/DZ array.
Fix a wrong comment in the BorderTileClassConstraint of 86d3cdf2d5.

Differential Revision: https://code.wildfiregames.com/D984
Not accepted by anyone

This was SVN commit r20349.
2017-10-26 11:51:54 +00:00
cb6c571c2d Fix bottom corners alignment in Modern dialog
Reviewed By: elexis, vladislavbelov
Differential Revision: https://code.wildfiregames.com/D982
This was SVN commit r20348.
2017-10-25 20:53:40 +00:00
7c89acc2ed Add rmgen Painter definitions, refs #4831.
Move the least complex rmgen painters (TileClassPainter,
TileClassPainter, MultiPainter, TerrainPainter) to the top of the
painters file, refs #4804.
Group the TerrainPainter with the LayeredPainter which both draw a
texture on the terrain contrary to the others.
Use for-of loops and remove unneeded variables.
(Diff split for auditability.)

This was SVN commit r20347.
2017-10-25 13:56:46 +00:00