1
0
forked from mirrors/0ad
Commit Graph

11622 Commits

Author SHA1 Message Date
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
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
elexis 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
elexis 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
fatherbushido 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
elexis 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
elexis 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
elexis 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
elexis 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
elexis 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
elexis 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
elexis 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
elexis 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
LordGood 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
elexis 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
elexis 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
elexis 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
vladislavbelov 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
elexis 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
fatherbushido 6c9c9f728f Missing added files in 266ddfa8da. Noticed by Imarok.
This was SVN commit r20346.
2017-10-25 09:30:05 +00:00
fatherbushido 266ddfa8da Display fruit tree as fruit and not as wood on the minimap. Rework a bit inheritence of fruit tree and of wood bushes. The noticeable change is that fruit tree block movement as other trees.
Patch by: Temple
Differential Revision: https://code.wildfiregames.com/D845
This was SVN commit r20345.
2017-10-25 08:05:53 +00:00
LordGood c5ccdccfc4 seleucid elephant stable and carthaginian regular stable. fixed persian hay cart
This was SVN commit r20342.
2017-10-24 23:40:30 +00:00
Imarok 66a357f286 The server should choose the guid
Reviewed by: elexis
Differential Revision: https://code.wildfiregames.com/D943
This was SVN commit r20341.
2017-10-24 22:05:24 +00:00
LordGood 4e2866baeb seleucid,persian, and stan's iberian models, actors, and templates. persian ballista tower in there for a goof. little seleucid house edit
This was SVN commit r20339.
2017-10-24 13:49:39 +00:00
elexis 5cc9e998e0 Remove abstract rmgen Terrain class that was inherited by SimpleTerrain and RandomTerrain.
It didn't add a benefit, hid a bug (see 0c9205e5b8), required the
inheriting classes to use terrainObjects, added confusing indirection
and none of the other classes (painters, placers, constraints) use that
inheritance.
Define what the Terrain classes do, refs #4831.
Rename treeType to templateName.
Remove unneeded round in the validT condition.

This was SVN commit r20338.
2017-10-24 03:24:05 +00:00
elexis ba65661f3e Define rmgen Entity class, refs #4831.
Make playerID non-optional.
Move default orientation code to the function header.
Add missing quotes.

This was SVN commit r20337.
2017-10-24 03:09:42 +00:00
elexis 86d3cdf2d5 Define rmgen Constraints, refs #4831.
Use an array function instead of a loop.

This was SVN commit r20336.
2017-10-24 03:06:05 +00:00
elexis 0c9205e5b8 Fix missing [] to undefined replacement in b4503bb61e that was never noticeable because Terrain.place overwrites it on every tile of every map.
Fix wrong variable name in 45bb3d2a43.

This was SVN commit r20335.
2017-10-23 14:45:26 +00:00
fatherbushido 0ddfe51b55 Tweak a bit Scipio's aura radius. Patch by temple. Reviewed by Grugnas.
Differential Revision: https://code.wildfiregames.com/D737
This was SVN commit r20334.
2017-10-23 14:05:07 +00:00
bb f55aac2521 Make the biome setting visible for mp clients.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D979
This was SVN commit r20333.
2017-10-23 12:34:13 +00:00
elexis 1a896f531a Add diskArea rmgen helper function and use it instead of Math.PI * Math.pow(radius, 2).
Use getMapArea instead of mapSize*mapSize.

This was SVN commit r20332.
2017-10-23 10:39:32 +00:00
elexis 1dee1eced9 Remove rmgen euclidian distance helper function, refs 6590f301c2 / D969.
Use Math.square(x) instead of Math.pow(x, 2) in places that don't
multiply it with Math.PI.

This was SVN commit r20331.
2017-10-23 10:13:49 +00:00
fatherbushido 32812f0974 Add unit tests to the EntityLimits component.
Differential Revision: https://code.wildfiregames.com/D970
This was SVN commit r20329.
2017-10-23 06:27:00 +00:00
elexis 6590f301c2 Add Math.square to compute the square of a number without the need to repeat the term, without using the slower Math.pow.
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.
2017-10-22 20:46:41 +00:00
LordGood aeaf3d1f43 Persian range and Stan's Iberian stables. Template edited for Iberian range.
This was SVN commit r20325.
2017-10-21 21:12:23 +00:00
elexis 56ba3e4416 Show stacktrace too in case custom JS exceptions are thrown.
This was SVN commit r20324.
2017-10-21 20:38:10 +00:00
mimo 3c2f5ca5a6 rework a bit D964
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D967
This was SVN commit r20323.
2017-10-21 19:05:52 +00:00
Imarok 6c5a8269f3 Fix some style issues noticed by our linter
Reviewed By: bb
Differential Revision: https://code.wildfiregames.com/D585
This was SVN commit r20322.
2017-10-21 17:31:05 +00:00
Imarok 5f0a0fbbef Add id for IQ stanzas
Patch by: Dunedan
Differential Revision: https://code.wildfiregames.com/D899
This was SVN commit r20321.
2017-10-21 14:11:25 +00:00
mimo 23893415d1 Unify trade gain computation between simulation and ai
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D964
This was SVN commit r20320.
2017-10-21 08:40:11 +00:00