Commit Graph

20606 Commits

Author SHA1 Message Date
wraitii feda708d5d Fix formations not queueing orders properly.
Formation controllers were not always waiting on their members correctly
because the "finishedOrder" check was being reset in the wrong place.
This happened particularly with queued orders.

This merges the "finishedOrder" and the "InPosition" logic.

Reported by: elexis
Based on a patch by: Freagarach
Tested by: Freagarach
Reviewed By: Angen
Fixes #3274

Differential Revision: https://code.wildfiregames.com/D2702
This was SVN commit r23744.
2020-06-06 16:07:01 +00:00
wraitii 759bc754c3 Fix arrow count not being properly calculated when autogarrisoning.
423b3cbcaa Moved the message sent that an entity garrisons from
`PerformGarrison` to `Garrison`. However, when an entity is
autogarrisoned from `ProductionQueue` `PerformGarrison` is called thus
not triggering the message. When ejecting the entity from the structure
there is a message sent that the entity is removed, thus allowing for a
negative amount of archers/arrows in `BuildingAI` (see
423b3cbcaa#42654).

Note that `PerformGarrison` was explicitly split in 2102648f7c when
introducing autogarrisoning. It probably has something to do with the
position, since that was split. But I couldn't find any reason why it
cannot be used now.

A side effect of this is that when autogarrisoning an entity with
visible garrison points those will be occupied as well now.

Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D2790
This was SVN commit r23743.
2020-06-06 10:19:42 +00:00
wraitii 4588ee3bbc Trigger an exit-reentry when the target entity of an order is renamed
This lets unitAI FSM states correctly handle target entity renaming by
processing a message when that happens. The default behaviour is to
leave-reenter the state, which re-runs sanity checks and optionally
picks a better behaviour.

UnitMotion is still not made aware of entity renaming, as the
leave-enter makes it irrelevant in practice. It still may be a good idea
to implement that someday.

Fixes the concern raised at de1bb8a766.
Fixes #5584

Comments by: bb, Freagarach
Tested by: Freagarach
Reported by: minohaka, bb, Freagarach, gameboy (error in the original
commit)

Differential Revision: https://code.wildfiregames.com/D2735
This was SVN commit r23742.
2020-06-06 06:19:15 +00:00
Stan 371299f244 Reduce alarm sound intensity:
Thread:
https://wildfiregames.com/forum/index.php?/topic/27207-committedpoll-alarm-sound/page/2/&tab=comments#comment-398144

This was SVN commit r23741.
2020-06-05 21:34:22 +00:00
Stan 8339c6da79 Fix heroes not attacking on elephants
This was SVN commit r23740.
2020-06-05 21:28:18 +00:00
Stan a7cc40524c Fix spear orientations for infantry spearmen units when attacking and capturing.
Thread:
https://wildfiregames.com/forum/index.php?/topic/28301-seleucid-thureos-shields-attack-with-butt-of-spear/&tab=comments#comment-398078

This was SVN commit r23739.
2020-06-05 20:57:19 +00:00
wraitii f6977b64db Use IID_Health in test_Damage after 16b452cf91.
The wrong components were mocked, but the test did not fail as the
asserts were not called.
Add a check that tests are indeed called here.

Patch by: Freagarach
Reviewed by: wraitii
Differential Revision: https://code.wildfiregames.com/D2787
This was SVN commit r23738.
2020-06-05 17:14:04 +00:00
wraitii 829567c304 Unify Cavalry walk speeds across citizen/champion/hero variants.
Citizen, Champion and Hero cavalry now have the same 2x walk speed
multiplier.
Speed difference between cavalry type unchanged.

Patch by: Nescio
Approved by: borg-, ValihrAnt, wraitii
Differential Revision: https://code.wildfiregames.com/D2596
This was SVN commit r23737.
2020-06-05 16:58:18 +00:00
Stan 21a1ba4e5a New alarm/alarmattackplayer_1.ogg sound
Thread:
https://wildfiregames.com/forum/index.php?/topic/27053-request-battle-sounds/
Thread:
https://wildfiregames.com/forum/index.php?/topic/27207-feedback-wanted-alarm-sound/

Patch by: @Samulis
This was SVN commit r23736.
2020-06-05 08:09:58 +00:00
wraitii 4812844c33 Look for foundations near the target, not the entity.
Entities should look for a new foundation near the targeted one, not
near themselves, when they cannot proceed with constructing the original
target.
This behaviour matches expectations from players better, since the
entity will go closer to where the player intended.

It also rejoins behaviour when gathering introduced in 7d53fb19a2.

For now, keep looking near the entity too if there are no obvious picks
at the destination, but this could be done only within a certain range
(see D2525).


Comments by: Angen
Differential Revision: https://code.wildfiregames.com/D2753
This was SVN commit r23734.
2020-06-04 11:06:27 +00:00
wraitii cdfa6cb8b4 Make CommitResources accept a target, not a type.
This moves some resource committing logic from `UnitAI` to
`ResourceGatherer`.
Allows easier modification by modders, and cleaner separation of
concerns.

Check if the carried resources actually changed before sending the
message.

Make all paths through Repair.ConstructionFinished return resources.

Patch by: Freagarach
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D2664
This was SVN commit r23733.
2020-06-04 11:01:06 +00:00
wraitii 7440523ade Enable garrisoning on gates / fix movement of units with visible garrison points (2nd commit)
This is the same commit as 2abd9cead2 / D1418, fixing noted issues.

This addresses two related issues:
- Units visibly garrisoned on gates keep the gate open.
- Units visibly garrisoned on entities keep their pathfinding blocker
flags.

De-activate the obstruction of visibly-garrisoned entities, fixing the
2nd issue.
Keep a list of entities that cannot move and thus should not count
towards gate-opening logic.

Packing logic is kept separate: it is more related to entities having
'alternate forms' with different capabilities than being currently
incapable of moving.

Based on work by temple

Fixes #2679.
Fixes #5151.

Differential Revision: https://code.wildfiregames.com/D2775
This was SVN commit r23731.
2020-06-02 11:40:29 +00:00
Stan c2b73e7874 Remove inaccurate howdah from the carthaginian champion elephant.
Patch by: @Nescio
Comment by: @wowgetoffyourcellphone
Thread:
https://wildfiregames.com/forum/index.php?/topic/28168-war-elephants/page/2/&tab=comments#comment-396952

Differential Revision: https://code.wildfiregames.com/D2779
This was SVN commit r23730.
2020-06-02 08:02:09 +00:00
Stan aad8aa9a3e Make elephants more interesting by reducing their cost.
Reviewed by: @borg-
Patch by: @ValihrAnt, @Nescio

Differential Revision: https://code.wildfiregames.com/D2575
This was SVN commit r23728.
2020-06-01 16:53:01 +00:00
Imarok c4625b14df Improve the warning message for FromJSValue<CColor> when trying to convert a non-object to CColor.
Reviewed by: wraitii
Differential Revision: https://code.wildfiregames.com/D2778
This was SVN commit r23727.
2020-06-01 16:09:28 +00:00
bb 37980a3e48 Move all session hotkeys under session in default.cfg
This appears to comply with "This can be changed once all settings
belong to a section." from afecbf02f3 which did not set these hotkeys
under session.

Patch By: Nescio
Differential Revision: D2616
This was SVN commit r23726.
2020-06-01 15:11:26 +00:00
bb 95cc785865 Also fix 6 player skirmish maps
refs D1042 29098b456b

This was SVN commit r23725.
2020-06-01 14:35:25 +00:00
wraitii 945ac4fc3b Do not change the gamma of the display on startup.
Added in df6fceba62 to (most likely) have some control over brightness,
this conflicted with dimming utilities and would not play nice with
starting 0 A.D. in windowed mode.

If gamma handling were to be reintroduced later, it should only affect
the 0 A.D. window.

Reviewed By: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1976
This was SVN commit r23722.
2020-06-01 05:12:51 +00:00
bb 27311ec62e Correct tooltips of gamesetupSettingsTabs
Introduced in 34138a7764

Patch By: Nescio
Agreed By: elexis
Differential Revision: D2615
This was SVN commit r23721.
2020-05-31 21:17:16 +00:00
bb 74a02d232e Allow a garrisonholder to not have health.
Patch by: Freagarach
Adaptation by: wraitii
Differential Revision: D2375
This was SVN commit r23720.
2020-05-31 19:40:54 +00:00
bb 29098b456b Remove all spaces, caps, parentheses and hyphens from map file names.
PersistMatchSettings are broken by this commit.

Comments By: leper, itms, Stan, vladislav, elexis
Patch By: Nescio
Differential Revision: D1042
This was SVN commit r23719.
2020-05-31 19:10:15 +00:00
Stan 6a29c46b5f Fix Gaul trader offset. Refs https://code.wildfiregames.com/D2640
This was SVN commit r23718.
2020-05-31 16:21:42 +00:00
bb 82c2de90fd Replace the Flight_demo map from 2c58b07223 with Flight_demo_2 from a64f1356cb. Adding a runway on a cliff to the latter, so all functionalities are kept.
While at it remove the cap from the name, according to the art naming
conventions.

Noticed and proposed by Nescio in D1042
Comments by: elexis, stan, vladislav
This was SVN commit r23717.
2020-05-31 15:55:21 +00:00
bb 743443977b Rename brit_champion_cavalry* to brit_champion_chariot*
Patch By: Nescio
Comments By: Stan
Differential Revision: https://code.wildfiregames.com/D2529
This was SVN commit r23716.
2020-05-31 14:16:23 +00:00
Angen 10fb4822df [gameplay-a24] Allow training all barracks champions at captured barracks.
Before this change, civilisation could train champions in captured
barracks only if captured barracks allowed to train that unit, what was
not always the case so some champions were allowed to be trained in
captured barracks and some was not.

Differential Revision: https://code.wildfiregames.com/D2547
Patch by: Nescio
Reviewed by: ValihrAnt
This was SVN commit r23715.
2020-05-31 10:12:02 +00:00
wraitii 531dcf40c3 Revert 0363202a20, 2abd9cead2 and b4144dc2c3
Player-testing has revealed QA issues, so reverting these for now.

Differential Revision: https://code.wildfiregames.com/D2773
This was SVN commit r23714.
2020-05-31 10:06:39 +00:00
Stan 0cde295654 Make wall segment cost proportional.
Patch by: @Nescio.
Reviewed by: @ValihrAnt
Differential Revision: https://code.wildfiregames.com/D2611
This was SVN commit r23713.
2020-05-31 07:29:26 +00:00
wraitii b4144dc2c3 Hotfix for 2abd9cead2 - remove the OnEntityRenamed handling.
0363202a20 actually fixed the particular issue of upgrading a long-wall
to a gate by correctly handling it in UnitAI, so this code, which didn't
work, is no longer needed anyways.

Noticed by running units_demo which seems to have skirmish replacer
placeholders.

This was SVN commit r23711.
2020-05-30 14:26:33 +00:00
wraitii 2abd9cead2 Enable garrisoning on gates / fix movement of units with visible garrison points
This addresses two related issues:
- Units visibly garrisoned on gates keep the gate open.
- Units visibly garrisoned on entities keep their pathfinding blocker
flags.

Remove the block-movement flag from visibly garrisoned entities.
Keep a list of entities that cannot move and thus should not count
towards gate-opening logic.

Packing logic is kept separate: it is more related to entities having
'alternate forms' with different capabilities than being currently
incapable of moving.

Based on work by temple

Comments by: Freagarach
Tested by: Nescio
Fixes #2679
Fixes #5151

Differential Revision: https://code.wildfiregames.com/D1418
This was SVN commit r23710.
2020-05-30 09:18:33 +00:00
wraitii ed2ae1d283 Do not compute capture points for the invalid player on player defeat
Reviewed By: Freagarach
Refs #5745

Differential Revision: https://code.wildfiregames.com/D2748
This was SVN commit r23709.
2020-05-30 06:25:10 +00:00
wraitii 0363202a20 Trigger an exit-reentry when the target entity of an order is renamed
This lets sunit AI FSM states correctly handle target entity renaming by
processing a message when that happens. The default behaviour is to
leave-reenter the state, which re-runs sanity checks and optionally
picks a better behaviour.

UnitMotion is still not made aware of entity renaming, as the
leave-enter makes it irrelevant in practice. It still may be a good idea
to implement that someday.

Fixes the concern raised at de1bb8a766.
Fixes #5584

Comments by: bb, Freagarach
Reported by: minohaka, bb, Freagarach
Differential Revision: https://code.wildfiregames.com/D2735
This was SVN commit r23708.
2020-05-29 17:00:50 +00:00
Stan 131590927f Remove the old, broken colosseum and the version that was made for Delenda Est introduced in 83680b0dee which was completely unused and did not provide actors. They belong to 0 A.D: Empire Besieged.
This was SVN commit r23707.
2020-05-29 14:11:26 +00:00
Stan ebd9786268 Add missing cpp files in last commit refs D2503
This was SVN commit r23704.
2020-05-28 18:18:00 +00:00
Stan cdade0af30 Reorganize selection textures by size instead of by shapes. Optimize templates to reduce duplication
Patch by: @Nescio
Differential Revision: https://code.wildfiregames.com/D2503
This was SVN commit r23703.
2020-05-28 18:05:05 +00:00
bb 5cfce692e7 Implement keyDown event
Change HotkeyPress event to be non-repeating (HotkeyDown to replace the
repeating case)
Fix shiftlag
Make toggle hotkeys only respond to the first SDL event.

Many iterations of review by: elexis
Test done by: Imarok
Comments By: vladislav, Stan
Reviewed By: wraitii
Fixes: #5055
Differential Revision: https://code.wildfiregames.com/D1398
This was SVN commit r23701.
2020-05-26 21:47:03 +00:00
wraitii 892f97743b Fix some cases of units getting stuck.
This fixes an off-by-one error that led to entities sometimes getting
stuck against obstructions.
It also increases the max-range of the short pathfinder to help entities
find their way around corridors and house blocks.

Fixes 2ff8614ce2 (off-by-one error) and reverts the range changes from
32e8ed51aa

Reported By: Freagarach
Fixes #5586 . Refs #5624

Differential Revision: https://code.wildfiregames.com/D2754
This was SVN commit r23699.
2020-05-25 20:13:35 +00:00
wraitii d68b3bb098 Do not send Attacked message on entities that have no attack effects receiver
Since 16b452cf91, it is possible for units to be sent "Attacked"
messages even though they cannot be attacked
(e.g. a non-capturable being the target of a Capture attack effect).
These messages are spurious and should not be sent.

Reported By: Angen
Differential Revision: https://code.wildfiregames.com/D2758
This was SVN commit r23698.
2020-05-25 19:14:46 +00:00
Stan 28f591ad1e Add slaughter animations to most units.
Discussed briefly with @fatherbushido
Thread:
https://wildfiregames.com/forum/index.php?/topic/27974-slaughter-attack-in-actors-templates/&tab=comments#comment-394851

Differential Revision: https://code.wildfiregames.com/D2708
This was SVN commit r23697.
2020-05-25 10:07:20 +00:00
Angen 9f6d44feb8 Remove some variables from serialisation and update this.animations name to reflect what it actually holds [Formations.js]
Needs ReviewPublic

Differential Revision: https://code.wildfiregames.com/D2707
Comments by: elexis, Stan, wraitii, bb
Remove variables were not needed to be serialised or stored inside
component
Create `variablesToSerialize` to hold list of variables, that need to be
Serialized.
Rename `this.template.Animations` to `this.template.AnimationVariants`
(and anything related) as it does not hold animation names but names of
animation variants what is misleading.
Do not create timer when deserializing as that would cause oos and timer
already exists.
this.Init has to be called from Deserialize because it is not called by
default

This was SVN commit r23694.
2020-05-23 13:03:34 +00:00
Angen 21e3eedd2f Fix computation of clusters and var->let
Compare matrix values against `undefined` instead of relying on `||`
because `||` does not work as intended when distance is `0`.

Differential Revision: https://code.wildfiregames.com/D2761
Fixes: #5761

This was SVN commit r23693.
2020-05-23 12:53:11 +00:00
Angen c8e6c05334 Fix gcc warning reported by Imarok after 204e17206b
Introduced in 204e17206b.
Gcc gives warning about missing parenthesis so this patch is adding
them, not changing result of expression.
Fix proposed by Imarok in P206 after report on irc
http://irclogs.wildfiregames.com/2020-05/2020-05-22-QuakeNet-%230ad-dev.log.

Differential Revision: https://code.wildfiregames.com/D2762
Reviewed by: elexis
This was SVN commit r23692.
2020-05-23 12:21:49 +00:00
Angen 204e17206b Update plural_forms.cpp by tinygettext to reflect needs of translators
Some languages like sk in [[SVN:21907]] have changed crucial line with
information about how many plurals language uses and how to calculate
correct one. However in plural_forms this line could not be matched with
implemented functions so as result object with default settings have
been returned what resulted in using only singular for translatePlural
calls.

Affected languages (12):
sk, lt, uk, cs, pl, ro, mk, he, ga, cy, be, br

I am leaving old variants as they can be useful for another languages.

Differential Revision: https://code.wildfiregames.com/D2751
Comments by: wraitii
This was SVN commit r23690.
2020-05-22 20:06:40 +00:00
s0600204 9034335d22 Correct WallPiece schema help comments
(Fairly sure I've got them right this time.)

Refs: #2944, D900, da35f63279

This was SVN commit r23687.
2020-05-21 19:11:00 +00:00
Itms 6e6c401ee8 Check the library version instead of the mtime of the already-built guard file in build-osx-libs.sh
Use a suffix for bundled libraries in order to rebuild them when we
patch them, refs #2551.

Patch By: Krinkle
Differential Revision: https://code.wildfiregames.com/D2649
This was SVN commit r23686.
2020-05-21 15:28:38 +00:00
elexis 57636140b5 Fix typo (certifiacte -> certificate) imported from gloox in 0e2adda813, reported by pilino1234 on transifex, relayed via Angen on Phabricator.
This was SVN commit r23685.
2020-05-21 10:15:26 +00:00
s0600204 da35f63279 Add help comments to WallPiece component schema
Also resolves whitespace issue in WallSet component breaking structree
and rmgen
wallbuilder when wall curve pieces are listed separated with newlines (&
tabs)
instead of single spaces.

Requested by: Nescio
Refs: #2944, D900

This was SVN commit r23684.
2020-05-21 04:34:13 +00:00
bb b8be438472 Invert a case in 585f9e76a5
This was SVN commit r23683.
2020-05-20 19:47:40 +00:00
bb 585f9e76a5 Create unitAI function to match a target's speed.
Patch By: Freagarach
Differential Revision: D2731
This was SVN commit r23682.
2020-05-20 19:39:36 +00:00
wraitii c1ddc0c4b9 Internationalise Damage Types and Status Effects using (optional) JSON files.
.json files in simulation/data/template/helpers/damage_types and
status_effects will be used to internationalise damage types and status
effects, as well as share common text.
Fixes the order of damage types being inconsistent.

Add the possibility for i10n xml extractor to set a custom context.

Fixes #4801
Related to D2296.

Featuring work from: Freagarach

Differential Revision: https://code.wildfiregames.com/D2337
This was SVN commit r23681.
2020-05-20 17:26:37 +00:00
wraitii 441f17cbeb Fix EntitiesNearPoint range query
Use a fixed range delta around the missile hit-location for neighboring
entities to damage.
Use a common query for GAIA and non-GAIA entities.
Do not presume attackable entities have Health.
Fix an issue where gaia entities were returned twice.

This fixes concerns reported by elexis at 38b2e37a61 and by Freagarach
at 16b452cf91.

Differential Revision: https://code.wildfiregames.com/D2738
This was SVN commit r23680.
2020-05-20 17:03:33 +00:00