1
0
forked from 0ad/0ad
Commit Graph

21201 Commits

Author SHA1 Message Date
a79a47effe Allow to limit unit count per match.
This allows to limit the number of times a specific template can be
constructed/trained/created during a match.

Part of:
https://wildfiregames.com/forum/index.php?/topic/27214-borg-expansion-pack-mod-implementation-in-0ad-alpha-24-release/
Refs.
https://wildfiregames.com/forum/topic/24682-champions-and-civilisations-balance-mod-for-a23/

Differential revision: D2411
Reviewed by: @wraitii
Comments by: @Angen, @Stan
This was SVN commit r24468.
2020-12-29 11:00:54 +00:00
71a61d5f50 Fix Idle formation rearranging when an entity dies.
Idle formations re-arrange whenever a member leaves the formation.
Because Idle formation entities can attack nearby units (the formation
stays idle for this), any death will re-arrange the formation, causing
the entities to move in formation before going back to attack.

This looks odd and makes formation less usable. Given that it's tricky
to change the controller state with the current code, this instead
reforms the formation on a timer, only when all members are IDLE.

It fixes the issue and looks generally similar in other cases.

Reported By: wowgetoffyourcellphone
Reviewed By: Freagarach
Differential Revision: https://code.wildfiregames.com/D3236
This was SVN commit r24467.
2020-12-29 10:08:55 +00:00
f0faab7a42 Fix serialization errors when hosting MP game.
Follows D2746 / 9fc6c3c897 and dad2857538.
Player colors are copied from the settings, which are deep-frozen, thus
not extensible. Cloning them restores that, allowing serialization.

Reported By: Angen
Differential Revision: https://code.wildfiregames.com/D3263
This was SVN commit r24466.
2020-12-28 17:44:20 +00:00
9fc6c3c897 Correctly serialize/deserialize user-defined JS objects.
Generalize component/AI serialization system to any user-defined JS
object. This includes Vector2D/3D, fixing an old issue.
As with components/AI, JS Objects may implement a Serialize/Deserialize
function to store custom data instead of the default, which attemps to
serialize all enumerable properties.

Fixes #4698

Differential Revision: https://code.wildfiregames.com/D2746
This was SVN commit r24462.
2020-12-27 17:18:13 +00:00
Angen
1432343eeb Fix upgrades not being sorted by phase in structuretree
Currenlty there is regression in structuretree from b2842e8021, when
upgrade for sentry tower is not in the correct phase row.
Thix is fixing that.
Probably typo in condition.

Differential Revision: D3252
Reviewed by: bb
This was SVN commit r24461.
2020-12-27 15:47:30 +00:00
Angen
06dfd3eaa0 [gameplay-a24] Lower cost of briton special tech for grain gather rate
The technology introduced in 586b045d09 for gauls is a bit overprised.
This is lowering the price to the original cost of rotarymill and
lowering gain a bit more because the tech is not just gobal but
available in phase earlier. Also it is "almost" half on cost and effect
of the current phase II tech which is available for everyone.

Differential Revision: D3253
Reviewed by: borg-
This was SVN commit r24460.
2020-12-27 15:46:00 +00:00
ae9ea5b859 Map browser, used in the gamesetup and in the main menu.
This grid-based system allows browsing all available maps at a glance,
encouraging more diversity and making it nicer to pick a map.

Moves the mapCache and the map filters controller to the gui maps/
folders, and include that folder where it is used, instead of them being
in common/ or the gamesetup.

Comments By: Freagarach
Patch By: Nani (reworked by elexis then wraitii)
Fixes #5315 (though further work, such as proper scrolling, would be
nice).

Differential Revision: https://code.wildfiregames.com/D1703
This was SVN commit r24459.
2020-12-27 15:26:19 +00:00
f31443eccb Increase projectile speed slightly across the board.
This bumps arrows from 75 to 100, slingers to 90 and javelins from 62.5
to 70. It's both slightly more realistic and helps with dancing, since
the problem is the ratio of unit speed vs projectile speed.

Further increases would reduce dancing, but also make it harder to see
projectiles which isn't desirable.

Refs #5106

Differential Revision: https://code.wildfiregames.com/D3179
This was SVN commit r24458.
2020-12-27 08:26:32 +00:00
eafc2a4ea8 Don't show the sword-shield icon if there is nothing to show.
Reviewed By: Freagarach
Refs #5883

Differential Revision: https://code.wildfiregames.com/D3258
This was SVN commit r24457.
2020-12-27 08:12:44 +00:00
d7caa91420 Switch to the running animation only above a certain ratio of the walk speed.
Following D3221/38c3827d3b, units switch to the 'run' animation when
moving faster than their walkspeed.
This makes formations 'flickery' because units often move slightly
faster than their walkspeed when the formation rotate slightly, which
happens often. It looks fairly bad.

This switches to the running animation halfway through, though a more
general system would be more desirable.


Approved By: Angen
Reviewed By: bb
Differential Revision: https://code.wildfiregames.com/D3224
This was SVN commit r24456.
2020-12-27 08:07:10 +00:00
1e8299dcdb Fix off-by-one line number in JS error reporting.
Post SM60 upgrade, CompileFunction started actually adding a line in
front of the source buffer, shifting the error reporting in the
simulation and other callers of LoadScript.
The GUI isn't affected as it uses LoadGlobalScript, which uses Evaluate
directly.

Refs #5859
Fixes #5895

Differential Revision: https://code.wildfiregames.com/D3257
This was SVN commit r24455.
2020-12-27 07:51:30 +00:00
8a77efd849 Fix no-pch builds following 5b46ce0778
Component.h is loaded by convention in all CmpComponents and is
requireed to use CmpPtr.

Fixes #5898

Differential Revision: https://code.wildfiregames.com/D3259
This was SVN commit r24454.
2020-12-27 07:48:26 +00:00
4c1d6eb236 Fix entities turning when attacking while fleeing.
Bug revealed by non-instantaneous turning.

Code by: @bb
Differential revision: D3241
Reviewed by: @wraitii
This was SVN commit r24453.
2020-12-27 07:21:18 +00:00
7f6602cffd Show the number of builders together with build time.
Also adds the remaining time to the tooltip.

Differential revision: D2425
Reviewed by: @bb
This was SVN commit r24452.
2020-12-27 06:56:37 +00:00
6a3cad75eb Correct technology specific names.
Also:
- Added generic Greek names for Ptolemies and Seleucids.
- Remove those where requirements prevent it for a civ.
- Simplified Greek romanisation, per
https://wildfiregames.com/forum/index.php?/topic/25202-transliteration-of-ancient-greek-into-english/page/3/&tab=comments#comment-378658.

Patch by: @Nescio
Differential revision: D2025
This was SVN commit r24450.
2020-12-26 06:21:37 +00:00
47b9d2a02e Play sound of entity that is able to perform a command.
In unit_actions.js sounds of the first entity that is able are now
played, instead of trying to play a sound of the first entity of the
selection, which may or may not be able to perform the command.

Differential revision: D3099
Reviewed by: @bb
This was SVN commit r24449.
2020-12-26 05:46:13 +00:00
Angen
fe1356b80c [Petra/AI] Fix wrong function call in worker.js after FastMoving class introduction
Introduced in 164af0742a.
Missed when doing review.
Reported by: Freagarach
This was SVN commit r24448.
2020-12-25 17:46:35 +00:00
bb
9ae637bd43 var => let and some periods in fogging
Implicitly reguested by Freagarach

This was SVN commit r24447.
2020-12-25 17:02:52 +00:00
bb
136022564d Change tower armour tech to a roughly equivalent health one
Patch By: Nescio
Comments By: borg, Freagarach
Differential Revision D2937

This was SVN commit r24446.
2020-12-24 17:02:01 +00:00
bb
87849f4fe9 Fix some translatable strings
Patch By: Nescio
Comments By: Freagarach
Differential Revision: D3134
This was SVN commit r24445.
2020-12-24 16:25:32 +00:00
e90609fa28 Some cleaning in unit_actions.js.
Let the `hotkeyActionCheck` and `preselectedActionCheck` use the regular
`actionCheck` to reduce duplication.
Save the first able entity used to orderOne.
Removed some functions which were used merely once.
Combined non-target actions with the regular ones.

Differential revision: D3222
Reviewed by: @bb
Comments by: @wraitii
This was SVN commit r24444.
2020-12-24 07:45:42 +00:00
3d61c227f3 Make slaughter actually kill animals in one strike.
Changed in 37d3adcf23, presumably erroneous given a relevant IRC log
(2012-12-02), and in daf572eb43.

Refs. D193.

Differential revision: D3233
Reviewed by: @Nescio
This was SVN commit r24443.
2020-12-24 06:35:33 +00:00
bb
19762acf03 Also do transform
This was SVN commit r24441.
2020-12-23 17:48:24 +00:00
bb
6205f687e4 cp => CapturePoints
Reviewed By: Angen
Differential Revision: D3248
This was SVN commit r24440.
2020-12-23 17:26:36 +00:00
Angen
75b8d3194e Show a default value in playersFilter input to show user what it is for [v2]
Redo original diff D245 by ffffffff after commit of cpp changes for
input placeholders.

Differential revision: D3245
Reviewed by: bb
Comments by: Stan, wraitii
This was SVN commit r24439.
2020-12-23 15:50:16 +00:00
bb
0fe7f86b6d Display header from c8fda40b02 also for upgrades.
refs 024aa77c35, D2654
Reviewed by: Freagarach
Comments By: elexis
Differential Revision: D3008
This was SVN commit r24437.
2020-12-22 22:27:10 +00:00
Angen
6b353c4ae5 [Petra/Ai] Get landaccess of garrison holder if entity is garrisoned
Position of garrisoned entities is undefined, thats why landaccess
fails, when asking for position in some cases.
Last replay in ticket is from a23b.

source of the issue was this.target in attackplan got garrisoned so it
got undefined possition.

Solution applied is to ask for landaccess of garrisonholder if current
entity is garrisoned inside the function itself, instead doing it in
every place possible and forget it the future additions. If calling code
does not want to deal with garrisoned entities, it should check for that
case separately.

For attack plan, when it happened is fine, because it will deal with
garrisoned entity later.

Differential revision: D3244
Fixes: #5589

This was SVN commit r24436.
2020-12-22 11:11:18 +00:00
Angen
41df29ff25 [gameplay-a24] sword/axeman cavalry balance move speed
give same movement speed to sword/axe cav as spear cav has

run speeed multiplier 1.2 -> 1.1

Differential revision: D3231
Patch by: borg-
Accepted by: Nescio, ValihrAnt
This was SVN commit r24435.
2020-12-22 08:15:06 +00:00
d92aadcb96 Revert ZONE_INCREMENTAL gc to fix a crash.
The crash could be reproduced by hotloading. It didn't always happen
(about 1 in 15?).
I do not have sufficient time to investigate, so this reverts this for
now.
Introduced with the SM78 migration, refs #5861

Differential Revision: https://code.wildfiregames.com/D3239
This was SVN commit r24434.
2020-12-22 07:44:53 +00:00
Angen
37e08a4ffb Implement placeholder text for input fields and get rid of hack with mod filter
different font colour
no need to delete the text, when one wants to write there something
text displayed is not a value so field is technically empty
will disappear when user writes some character
will appear when user deletes all characters
we can get rid of text value "Filter" in mod selection screen and ugly
hack around it

Differential Revision: D2460
Comments by: vladislavbelov, elexis
This was SVN commit r24433.
2020-12-21 09:04:12 +00:00
Angen
c72861b708 Add proper lake to tutorial map
Lake was not showing properly in a24 anymore.
Reported by gameboy on forum:
https://wildfiregames.com/forum/topic/34502-the-disappearing-lake/
Cause is, that water level had the same value as terrain level and since
a24 uses more precise water level computation, high quality water
effects did not show the lake. ( found by @vladislavbelov )

Rise water level in the lake, remove animals, trees, minerals from lake
area add some fish.

Differential Revision: D3240
This was SVN commit r24432.
2020-12-19 20:21:15 +00:00
6ee43b6bcd Allow free upgrades and technologies.
And use that for the seleucids reform/traditional tech.

Noticed by @wraitii
Differential revision: D2654
Reviewed by: @bb
Comments by: @Stan
This was SVN commit r24431.
2020-12-19 20:11:57 +00:00
aeb3c284f2 Fix Danubis trigger.
In e98fce58a6 the DistanceBetweenEntities function was placed under a
helper, but not all maps were fixed.

This was SVN commit r24430.
2020-12-19 15:57:04 +00:00
70ec7812de Improve UnitMotion behaviour when working around obstructions.
This improves behaviour when units need to go around a concave obstacle.
They would tend to clump inside the 'dead-end' before realising they
needed to go around. This was rather easy to trigger on Acropolis. See
included Unit Motion Integration Test.

The cause is the logic that removed the next long waypoint when
obstructed. While that behaviour is desirable, removing too many
waypoints means the unit tries to short-path, using a small domain
range, to a goal that's impassable, meaning they go as close as they can
in Euclidian distance, i.e. towards the dead end.

This changes that behaviour by only deleting waypoints within a certain
distance from the entity, scaling with search-space range. It's tricky
to find a good compromise between performance and behaviour here, but
the values I've picked seem OK.

However, the fact that the entity would ultimately remove all waypoints
and thus trigger a full path recomputation was actually a feature,
inherited from D2754 / 892f97743b. This diff therefore handles that
explicitly, doing so on a more regular basis to behave better overall.

As a further cleanup, "m_FailedPathComputations" is incremented in
HandleObstructedMove, as it is quite possible to never increment it in
PathResult despite not getting actionnable paths. This thus renames it
to m_FailedMovements, and uses the opportunity to clean up PathResult(),
by only having one path for both short and long-range paths. Further,
PathResult now does not immediately request new paths, leaving that to
Move(), to avoid requesting transient paths that aren't actionnable.
This also makes it possible to revert 9e41ff39fc. It requires increasing
the MAX_FAILED variable, or more units get stuck as they reach the max
more often.

The search-space expansion is slightly slowed, and with a little more
delay, as a performance optimisation. From testing, this doesn't impact
real movement much as units short paths tend to be invalidated by the
next turn, as other units move, anyways.

Clarify comment around the vertex-pathfinder search-space bounds hack,
and ensure it isn't used for the very worst cases of units being stuck,
as it could be a pessimisation then.

Finally, this explicits a 2011 hack where if the long-pathfinder fails
to return a valid path the goal's center is used directly. This happens
when the goal is unreachable to the long-pathfinder, which may be
because it is actually unreachable or because only the short-pathfinder
can reach it. In those situations, the hack allows a last-ditch attempt
at reaching it before failing to move entirely. Performance wise, this
is faster overall for actually unreachable goals, since it skips all the
intermediate steps. For reachable goals, it might be occasionally
slower, but that case is quite rare (certainly rarer than unreachable
goals).

Reported By: Angen
Fixes #5795

Differential Revision: https://code.wildfiregames.com/D3203
This was SVN commit r24429.
2020-12-19 10:45:07 +00:00
cd882c1669 Commit new files forgotten in 5b46ce0778
I of course forgot to `svn add` these. Fixes 5b46ce0778

This was SVN commit r24428.
2020-12-19 09:48:11 +00:00
5b46ce0778 Use templates to replace explicit serialization helpers.
By using templates appripriately we can remove the need for explicit
specification of serializers, making it easier to serialize container
types and to write new serialization helpers.

Direct serialization calls haven't been replaced in this diff.

Comments by: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3207
This was SVN commit r24427.
2020-12-19 09:10:37 +00:00
974d4a4e25 [gameplay] Add a flaming status effect to iber champion cavalry
Accepted by: @borg-
Stats by: @wowgetoffyourcellphone
Differential Revision: https://code.wildfiregames.com/D2737
This was SVN commit r24426.
2020-12-18 23:46:01 +00:00
a2ad93662d Allow flying objects to be stationary
Discussed with: @Angen, @Freagarach

Differential Revision: https://code.wildfiregames.com/D2453
This was SVN commit r24425.
2020-12-18 22:35:31 +00:00
8c8dab6573 Part of the same rebase missing.
This was SVN commit r24424.
2020-12-18 15:14:21 +00:00
12bdbecd2b Fix production queue of previous commit.
Missed part of a rebase -_-' when committing 2452e3fb97.

This was SVN commit r24423.
2020-12-18 15:11:01 +00:00
2452e3fb97 Tweak Kush Amun temple.
Deprecates elite healer upgrade in favour of training elite healers at
the Amun temple.
Increases stats of Amun temple slightly. Removes production queue of
(unbuildable) Kushite shrine.

Lets Kushites start with a healer on random maps :) (To signify the
importance of the political power of the priesthood of Amun.)

Patch by: @Nescio
Differential revision: D2843
Reviewed by: @borg-
This was SVN commit r24422.
2020-12-18 14:41:51 +00:00
25c4bb66f6 Fix persisted matchsettings issues in GameSetup.
Fixed:
- The gamesetup no longer becomes entirely unusable when there is an
error parsing the map data.
- The match settings aren't overwritten in case of an error
- The PopCap / StartingResources control properly check for map data
existence, fixing an underlying error.

Differential Revision: https://code.wildfiregames.com/D3053
This was SVN commit r24421.
2020-12-18 08:40:38 +00:00
9eb5f338cd [gameplay] reduce slinger attack speed.
Patch by: @borg-
Reviewed by: @ValihrAnt
Differential Revision: https://code.wildfiregames.com/D3232
This was SVN commit r24418.
2020-12-18 00:53:25 +00:00
3b1bce759b Restore the briton wonder stats for balance.
Add a new model following @genava55's suggestions
Thread:
* https://wildfiregames.com/forum/topic/27889-task-brit-wonder/

Fixes: #5622 bc9116cdfb

This was SVN commit r24417.
2020-12-18 00:05:27 +00:00
bb
070492750c Don't remove const keywords, but update years
This was SVN commit r24416.
2020-12-17 23:43:09 +00:00
bb
42c70cd508 Let units take time actual time for turning while moving. This limits the possibility of "dancing" (making short moves to avoid being hit by arrows) beyond only patrolling.
Reviewed By: wraitii
Gameplay Tests By: FeldFeld
Comments By: Freagarach, Angen
Differential Revision: D2837
refs: #5106

This was SVN commit r24415.
2020-12-17 22:54:14 +00:00
051807ffae Using same value for unit and terrain ambient colors for scenarios and tutorial maps.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3160
This was SVN commit r24414.
2020-12-17 22:17:51 +00:00
596155cede Use C++17 std::size instead of sizeOf
This was SVN commit r24413.
2020-12-17 22:17:46 +00:00
5bb703bc75 Fix style issues in ea38089853
This was SVN commit r24412.
2020-12-17 22:04:03 +00:00
ff18f3dbd9 Using same value for unit and terrain ambient colors for skirmishes maps.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3142
This was SVN commit r24411.
2020-12-17 22:02:13 +00:00