0ad/source/simulation2/system
wraitii 158cf8ea8d UnitMotion pushing improvements
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.
2022-01-24 15:36:13 +00:00
..
CmpPtr.cpp # Rewrite of the game's simulation system 2010-01-09 19:20:14 +00:00
CmpPtr.h Replace use of safe bool by explicit bool operator. 2015-01-25 03:11:24 +00:00
Component.h Don't include ComponentManager.h in ScriptComponent 2021-05-16 15:12:39 +00:00
ComponentManager.cpp UnitMotion pushing improvements 2022-01-24 15:36:13 +00:00
ComponentManager.h Adds std namespace to shared_ptr usages in scriptinterface and simulation. 2021-05-22 19:30:18 +00:00
ComponentManagerSerialization.cpp Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
Components.h # Rewrite of the game's simulation system 2010-01-09 19:20:14 +00:00
ComponentTest.h Adds std namespace to shared_ptr usages in scriptinterface and simulation. 2021-05-22 19:30:18 +00:00
DynamicSubscription.cpp Convert debug_printf to take UTF-8 strings instead of wchar_t. 2015-02-14 01:45:13 +00:00
DynamicSubscription.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
Entity.h Replace deprecated jsval with JS::Value. 2017-08-28 10:27:36 +00:00
EntityMap.h Use templates to replace explicit serialization helpers. 2020-12-19 09:10:37 +00:00
IComponent.cpp Don't include ComponentManager.h in ScriptComponent 2021-05-16 15:12:39 +00:00
IComponent.h Don't include ComponentManager.h in ScriptComponent 2021-05-16 15:12:39 +00:00
Interface.h Don't include ComponentManager.h in ScriptComponent 2021-05-16 15:12:39 +00:00
InterfaceScripted.h Split JS conversions from ScriptInterface. 2021-05-13 09:43:33 +00:00
LocalTurnManager.cpp Increase MP Command delay to 4 turns, decrease MP turns to 200ms. 2021-03-03 21:02:57 +00:00
LocalTurnManager.h Add an interface for Reinforcement Learning. 2020-08-01 10:52:59 +00:00
Message.h Remove DefPersistentRooted and unneeded includes. 2020-11-12 08:24:30 +00:00
ParamNode.cpp Drops custom utf16 string implementation (from cdd3317ded), uses C++11 one. 2021-11-29 12:10:41 +00:00
ParamNode.h Include CStrInternStatic where necessary only. 2021-05-18 11:09:54 +00:00
ReplayTurnManager.cpp Split off JSON-related function from ScriptInterface, clean up headers. 2021-05-14 10:18:03 +00:00
ReplayTurnManager.h Remember OOS on a per-client basis. 2021-03-31 15:55:19 +00:00
SimContext.cpp Simulation context cleanup, refs #3991, #3168. 2016-05-19 19:42:07 +00:00
SimContext.h Simulation context cleanup, refs #3991, #3168. 2016-05-19 19:42:07 +00:00
TurnManager.cpp Split off JSON-related function from ScriptInterface, clean up headers. 2021-05-14 10:18:03 +00:00
TurnManager.h Fix Profiler1 "time per turn". 2021-05-06 16:49:34 +00:00