Puts the athen-specific data in the mixin `civ/athen`. Deduplicates.
Differential Revision: https://code.wildfiregames.com/D3831
This was SVN commit r25239.
Keep responsibilities separated, allow easier modding of attacking
behaviour.
Ideally the BuildingAI attacking routine would be merged in here as
well, but not done for now.
Part of #5810
Differential revision: D3816
Comments by: @smiley, @Stan
This was SVN commit r25235.
Reduces duplication, allows all attack types to cause splash damage.
While at it, makes delay and minimal range optional (for obvious
defaults are available).
Split from D368, so basically a patch by @bb.
Note that it may seem like one can arbitrarily name an attack now, but
that is not true.
Differential revision: D2002
Comments by: @bb, @Nescio, @Stan, @wraitii
This was SVN commit r25233.
- Allows compositing any two templates in TemplateLoader, and not just
filters: 'A|B|C' is now valid for any template A, B and C.
- Allows parents to be composited paths 'A|B|C'. In such a schema, if A
or B themselves specify a parent, the actual composition becomes
A|pA|B|pB|C and so on.
This allows, by leveraging the common schema of our entities, to reduce
duplication.
For convenience, templates in "special/filters/" and "mixins/" can be
included by their direct name. Others have to be completely specified.
See the two provided cases for examples:
- 'hoplite' becomes a mixin that can be used to apply the Phalanx
formation
- 'builder' becomes a mixin that can be give a template the ability to
build the standard structures, and gives the 'Builder' identity class.
This also allows deduplicating that list of tokens.
Update checkrefs & swap std::map for std::unordered_map in
TemplateLoader.
Differential Revision: https://code.wildfiregames.com/D3801
This was SVN commit r25223.
Introduced in 93d22ef16b.
Brings back the less intrusive bug of transforming while garrisoned of
turreted and unloading results in the default stance. That needs to be
fixed again.
Differential revision: D3822
This was SVN commit r25221.
Instead of relying on the assumption that an entity which transforms
only has one of the two (and the same) before and after.
Fixes 5b3bdf3647.
Differential revision: D3821
Comment by: @Stan
This was SVN commit r25220.
Don't pretend it to be a callable function, while it is certainly part
of the FSM.
(Also makes it easier for us to implement a duration for the trading in
the future, might we ever want to.)
Differential revision: D3813
Comment from: @Angen
Closes: #6135
This was SVN commit r25216.
Allows for non-moving entities to drop resources. (When someone checks
those cases in the order.)
(Also makes it easier for us to implement a duration for the dropping in
the future, might we ever want to.)
Differential revision: D3817
This was SVN commit r25215.
Introduced in 2ef3fd7a77.
Fixed by switching the order of task of the barracks and outpost.
Patch by: @nwtour
Differential revision: D3820
This was SVN commit r25214.
An actor file, as referenced by the VisualActor, can now define
different actors for different "quality level" setting.
In this initial version, the quality is handled directly by the object
manager.
Actor format impact:
- '<qualitylevels>' may be used as the root node, containing actor nodes
as children.
- such actor nodes can refer to a file, or to an inline actor, or
simply be inlined.
- such actor nodes may have a 'quality' attribute, specifying the
maximum quality level of this actor. By default, 255 (the maximum) is
implied.
- The actor format remains valid, but 'groups', 'variants', 'material',
'castshadow' and 'float' can be given a [minquality, maxquality[ range
via XML attributes. Outside of this range, the XML node is ignored
(making it possible to define, in a single actor file, several quality
levels).
Quality is a 0-255 value, with:
- Range 0-99 intended for lower level-of-detail actors (billboards,
etc.)
- Range 100-200 the 'normal' range for models. 100 is "low", 150
"medium", and 200 "high".
- Range 201-255 used for higher quality actors that might be used for
e.g. cinematics.
The range is wide to make it easier to add intermediate levels in the
future and it seemed easier given that an integer value of some kind was
required anyways.
Engine impacts:
- A new CActorDef class is introduced, wrapping an art/actors XML file
and its different quality levels. ObjectBase remains the definition of a
given 'actor', now at a given quality level.
- CActorDef imposes a maximal # of quality level for a particular actor
definition (5 currently).
- CUnit is made to refer to an Actor Definition explicitly, not a
particular ObjectBase.
- As a minor optimisation, variation keys are calculated on
pointer-to-sets-of-selections, instead of raw sets-of-selections, as
this reduces copying.
- some refactoring, including better const-correctness and hotloading
support via std::shared_ptr.
Differential Revision: https://code.wildfiregames.com/D3787
This was SVN commit r25210.
Moves the building logic from UnitAI to Builder.
Makes it easier for modders to change building behaviour, e.g. letting
structures build.
Differential revision: D3812
Comment by: @Angen
This was SVN commit r25208.
Moves the healing logic from UnitAI to Heal.
Makes it easier for modders to change healing behaviour, e.g. letting
structures heal (instead of using an aura).
Differential revision: D2680
Comments by: @Stan, @wraitii
This was SVN commit r25207.
Moves the gathering logic from UnitAI to ResourceGatherer.
Makes it easier for modders to change gathering behaviour, e.g. letting
structures gather.
Refs. #4293 by optimising a bit.
Differential revision: D2662
Comments by: @bb, @Stan, @wraitii
This was SVN commit r25206.
It is wasteful to do and seems not needed anymore.
Differential revision: D3802
Comments by: @Angen, @Stan
Reverts b478b9742a, b478b9742a
Refs. #3410
This was SVN commit r25198.
592453c62f added a flag to "GetBlockMovementFlag" to return either the
current or the template value, and by default it returns the template
value.
Foundation logic needed it to return the current value.
Gates are also updated to avoid changing behaviour in unpredictable
ways.
Differential Revision: https://code.wildfiregames.com/D3796
This was SVN commit r25196.
This basically does two things:
- Allow turrets on moving entities (fixes serialisation in cmpPos).
- Allow an entity to be present on another when the other is created.
That makes it basically a boiled down version of a prior patch, omitting
the part where orders could be passed on.
This does allow e.g. ranged units on chariots that fire while the
chariot moves.
Original diff by: @sanderd17
Redone by: @Stan
Differential revision: D1958
Comments by: @Alexandermb, @Angen, @bb, @Langbart, @Nescio, @Stan,
@wraitii
Refs. #2577 by implementing the entity on platform case.
This was SVN commit r25192.
Adds a new component effectively handling negative resource trickles.
Prevents resources from going negative and provides an effect for not
being able to pay.
The effect chosen for 0 A.D. is having the entity not being
controllable.
Not used in the public mod itself, but it is in quite some mods.
Based on an idea of @Nescio
Differential revision: D1323
Comments by: @Angen, (@smiley,) @Stan
This was SVN commit r25191.
Revealed by f884848745. Noticed by @Langbart.
The holder was deleted after being tasked to garrison the new target,
but with still a holder we were not allowed to garrison.
Differential revision: D3794
Closes: #6128
Tested by: @Lanbart
This was SVN commit r25188.
The motion manager introduced in bae258f9a1 makes 'chasing' (e.g. an
entity targeting another entity, which also applies to fleeing)
behaviour symmetrical: both units see the initial state instead of it
being ID-dependent.
This allows removing hacks introduced in 6a66fb8205 (and refined in
7b88b1a0f9).
Differential Revision: https://code.wildfiregames.com/D3785
This was SVN commit r25185.
After 21e866fcf0.
AllertRaiser replaced the order instead of just calling the required
function.
While at it, check for the garrisonable size when looking for buildings.
Differential revision: D3789
Tested by: @Langbart
This was SVN commit r25183.
This implements a form of crowd movement that I've generally called
'unit pushing' in the last few years.
Essentially, any two units will push each other away when they're too
close. This makes it possible to ignore unit-unit obstructions, and thus
makes movement much smoother in crowds.
This first iteration of this system only allows pushing between idle
units and between moving units (i.e. a moving unit does not affect an
idle one).
This is because the unitMotion logic to detect it is stuck & needs to
use the pathfinders starts breaking: units can fail to move because they
are pushed away from their intended movement, and the current logic
fails to handle this gracefully.
Thankfully, the most value of this patch in terms of player experience
is found in the improvements to group movements and shuttling.
Other impacts:
- As the short pathfinder is called less often, we can increase the
starting search range & reduce the # of max turns, both improving
collision recovery.
- The performance of idle units is slightly worsened, as they must be
checked for idle-idle collisions. If needed a 'sleeping' system, as used
in physics engine, could be implemented.
- In general, however, expect slight performance improvements, as fewer
short paths are computed.
- Gathering efficiency should increase slightly, since shuttling times
are likely reduced slightly.
- As a sanity change to improve some edge cases (units that say they're
moving, i.e. pushable, but don't actually move), the 'going straight'
logic is turned off if a short path has been computed. This requires a
few cascading changes to work correctly.
Technical notes:
- To reduce the cost of the n^2 comparisons that pushing requires, units
are only compared within a small square on a grid which is lazily
reconstructed each turn. The overhead seems rather small, and this is
much simpler than keeping an up-to-date grid.
- The design is intended to be parallelisable if needed someday.
- The pathfinder's CheckMovement ignores moving units in UnitMotion, as
that is now the spec. Idle units are not ignored, which is required for
the 'collision' detection to work correctly (see above).
Refs #3442 (not fixed - idle units are not pushed by moving units).
Fixes#5084 (the overlap can still happen, but units will push each
other away).
Differential Revision: https://code.wildfiregames.com/D1490
This was SVN commit r25182.
This makes sure all hotkeys from hotkeys/spec/*.json files are displayed
in the editor, even if they are not found in configuration files.
Differential Revision: https://code.wildfiregames.com/D3767
This was SVN commit r25175.
Some information & resources were outdated, preventing progress.
Patch by: nwtour
Differential Revision: https://code.wildfiregames.com/D3764
This was SVN commit r25171.
Follows d0a42f2f00.
Because only the most specific hotkeys can be active at any time,
releasing a key may require re-activating less specific hotkeys.
There were two issues with this behaviour:
- It was buggy, as it only checked one active key, when any still active
key can trigger hotkeys.
- "HotkeyPress" and "HotkeyDown" events where sent, as if the hotkey was
pressed, which was unexpected for most code/users (it is unusual to have
a "Press" event on key release).
This fixes these issues by "silently" re-triggering the hotkeys in such
a case. It also makes it easier for JS code to use "hotkeyPress" instead
of "hotkeyDown" for non-continuous behaviour.
Accepted By: nani
Fixes#6123
Refs #6064 (fixes the problem, but not the code weirdness)
Differential Revision: https://code.wildfiregames.com/D3766
This was SVN commit r25169.
Fixes dc18d94030.
Using down/up to change the map in the map selection dropdown in the
gamesetup has a one-element lag. The reason is that on dropdown up/down,
two events are sent:
- first the current highlighted item is selected (it's usually the
selected one).
- then the new item is selected.
Because of faulty timer logic, only the first update went through.
Differential Revision: https://code.wildfiregames.com/D3774
This was SVN commit r25168.
Not all orders were checked, which would cause problems when receiving
an order that needed moving and that did not handle not being able to
move properly.
Differential revision: D3771
This was SVN commit r25164.
21e866fcf0
Crossbowmen should be able to turret (noted by @Nescio).
TurretHolders should be able to pick entities up.
Differential revision: D3744
This was SVN commit r25163.
This allows modifiers without "affects", or with empty "affects" lists,
to do something.
This makes it possible to force a modifier on an entity without classes
(e.g. trees) or with unknown classes.
Accepted By: asterix
Differential Revision: https://code.wildfiregames.com/D3761
This was SVN commit r25157.
Observers no longer lag the game for players. There is still some time
to serialise the game when sending it to a joining observer, and
depending on the chosen 'max lag' the game may stop while observers
sufficiently catch up, but this impact too is reduced.
- Make the NetServerTurnManager ignore players marked as 'observers' for
the purpose of ending a turn, effectively making it possible for
observers to lag without it affecting the players in any way.
- Add a config option (network.observermaxlag) that specifies how many
turns behind the live game observers are allowed to be. Default to 10
turns, or 2 seconds, to keep them 'largely live'.
- The controller is not treated as an observer.
- Implement a simple UI to show this delay & allow the game to speed up
automatically to try and catch up. This can be deactivated via
network.autocatchup.
- Move network options to the renamed 'Network / Lobby' options page.
- Do not debug_warn/crash when receiving commands from the past -
instead warn and carry on, to avoid DOS and "coop play" issues.
Refs #5903, Refs #4210
Differential Revision: https://code.wildfiregames.com/D3737
This was SVN commit r25156.