This makes it possible to make units heavier, which both push more & get
pushed less by other units.
In particular, the diff does it for siege units & elephants.
This improves movement for these units in crowd situation, since they
will now basically not move when other regular units push into them.
Supported By: asterix, marder
Refs #6127
Differential Revision: https://code.wildfiregames.com/D4452
This was SVN commit r26275.
This is a paradigm change for AI computation.
Historically, the AI was intended to be run in a separate thread from
the simulation. The idea was that slow AI wouldn't stop the renderer
from being smooth.
In that original design, the AI received a copy of the game world and
used that to run its logic. This meant the simulation could safely do
whatever it wanted in the meantime. This copy was done via AIProxy &
AIInterface.
This design ended up having significant flaws:
- The copying impacts the simulation negatively, particularly because
AIProxy subscribes to a lot of messages (sometimes sent exclusively to
it). This time cannot be threaded, and impacts MP games without AIs.
- Copying the data is increasingly difficult. Modifiers are a headache,
LOS is not implemented. Lots of logic is duplicated.
The intended benefits of the design also failed to realise somewhat:
- The AI was never threaded, and in fact, it is probably better to try
and thread Sim + AI from the renderer than just the AI, at which point
threading the AI specifically brings little benefit.
The new design is much simpler and straighforward, but this has some
side-effects:
- The AI can now change the simulation. This can be used for cheating,
or possibly for a tutorial AI.
- The AI runs in the same GC zone as the simulation, which may lead to
more frequent Sim GCs (but overall we might expect a reduction in
temporary objects).
- The AI state was essentially cached, so replacing some functions with
Engine.QueryInterface might be slower. The tradeoff should be balanced
by lower AIProxy computation times.
Future work:
- Threading some specific AI tasks could still be worthwhile, but should
be done in specific worker threads, allowed to run over several turns if
needed.
Technical note: the AI 'global' is in its own Realm, which means name
collisions with the same are not possible.
Other notes:
- The RL Interface uses the AI Interface and thus will gradually lose
some data there. Given that the RL Interface can now request data
however, this should be dine.
Refs #5962, #2370
Differential Revision: https://code.wildfiregames.com/D3769
This was SVN commit r26274.
6581796103 removed the ability for terrain to affect movement speed. The
JPS pathfinder cannot support it, and the approach was poor anyways,
coupling rendering data with simulation data.
This lets us remove the dependency on CTerrainTextureManager everywhere.
Tested by: langbart
Differential Revision: https://code.wildfiregames.com/D4459
This was SVN commit r26269.
The new values in 158cf8ea8d were too high, units would push each other
too much when building. This lower value should fix that, though further
adjustements may be necessary.
Reported by: Freagarach.
Differential Revision: https://code.wildfiregames.com/D4461
This was SVN commit r26261.
Moves the work done from cmpResearcher to cmpTechnologyManager.
No functional changes.
It allows fancy stuff in the future (#6364).
Differential revision: https://code.wildfiregames.com/D4438
This was SVN commit r26252.
The main change is the introduction of a 'pushing pressure' counter on
units. This counter increases when units get pushed around, and
decreases over time. In essence, units under high pressure move slower &
are harder to push around.
The major effect is that units can now get bogged down when very dense
groups start colliding. This makes movement more realistic, makes unit
movement more 'chokepointy', and generally improves the mathematical
soundness of the system (lower values are easier to handle for our 200ms
turns).
Other changes:
- The logic to detect units crossing each other's path has been
reworked. Units that run towards each other should not more obviously
avoid each other.
- New parameters: 'Spread' is a measure of how strong the pushing effect
is based on distance. With the current settings, static-pushing is
rather 'on/off', whereas moving-pushing is more gradual (and thus the
max influence distance was increased when moving).
- Default values have been tweaked for lower overlap.
- Units only looked at other units within their grid region. This led to
overlap near grid-borders. Units now look at neighboring grid elements,
which largely removes this issue. While this may be slower, the
performance of pushing was largely negligible before, so it is unlikely
to become a main cause of lag (and overlap was generally disliked by
players).
- Units no longer orient in the direction of pushing, but instead keep
facing their target. This can look slightly odd under very heavy pushing
forces, but vastly improves behaviour of very slow units such as rams
(since they spend much less time turning around). As a side-effect,
clean up angle code following acc780bcbb .
Engine changes:
- Add a debug rendering mode at compile-time to help understand what is
happening.
- Make it possible to constexpr initialise fractional fixed numbers by
using FromFraction
The 'pressure' change was inspired by alre's suggestion at
https://wildfiregames.com/forum/topic/56436-for-a-better-unit-movement/#comment-461987
Refs #6127
Differential Revision: https://code.wildfiregames.com/D4439
This was SVN commit r26245.
dropsiteSupplies kept a list of resources and did not remove exhausted
resources, leading to possibly buggy resource-management in the AI code
(and needless computations).
Differential Revision: https://code.wildfiregames.com/D4442
This was SVN commit r26244.
One needs UnitAI to be able to use a formation, so include the spec
therein (to keep information close to where it is used).
Modders can change their templates with the following script:
https://code.wildfiregames.com/P261.
Differential revision: https://code.wildfiregames.com/D4443
Comments by: @Stan
Idea accepted by: @wraitiiFixes: #6399
This was SVN commit r26235.
The ResourceTrickle component has been changed to a global aura instead.
It increases the trickle slightly, but catafalques are unbalanced
anyway.
Patch by: @Grapjas
Differential revision: https://code.wildfiregames.com/D4383
Refs. #6032 by fixing the Macedonian specific case, but not showing the
tooltips, as requested.
This was SVN commit r26234.
In GL3.0 alpha test mode was deprecated and removed in GL3.3. We should
use discard/kill in shaders instead.
In shaders alpha test was removed in d3a24c26ba, in FFP it was removed
with FFP in b7e6811ea6.
Differential Revision: https://code.wildfiregames.com/D4434
This was SVN commit r26211.
8d80a2186e removed the values for the tech cost multipliers from the
templates, since the component uses those default values, but failed to
account for modifications thereof.
Those weren't applied since the template value didn't exist.
This changes that to iterating over all resources.
Reported by: @Langbart
Differential revision: https://code.wildfiregames.com/D4409
Tested by: @Langbart
Fixes: #6408
This was SVN commit r26192.
Issue noticed by Exodarion.
After researching technology for resourcetrickle modifiers were
returning old cached value because modifiers were not cleared for
structure when it was build and changed owner from invalid_owner to the
player so old values were kept.
Cause:
global cache depends on originalvalue.
Health and other modifiers use also player-wide modifiers and result
from that is used as the key, what means global cache is never used
because originalvalue will differ in that case.
That does not look to be case for resourcetrickle and possibly for
another scenarios.
Modifiers that get cached on init and do not get changed by player-wide
modifiers in combination with ownership being changed afterwards will
bug.
Since we dont reset cache for ownership going from invalid_player, the
old global cache is kept and used.
Another solution would be to not cache on init, but thats workaround to
hide the issue.
Differential revision: D4395
This was SVN commit r26134.
To catch e.g. typos.
- Use the same structure in the ProductionQueue item (de)serialisation
as in Trainer and Researcher.
- Also iterate over the serialisable attributes on deserialize, as
proposed by @elexis (on IRC), for its symmetry.
Proposed by: @Stan
Differential revision: D4388
This was SVN commit r26133.