0ad/source/maths
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
..
tests Removes rand function usage from tests to avoid non-uniform distributions. 2021-11-25 17:57:59 +00:00
BoundingBoxAligned.cpp Fixes a bounding box projection to an incorrect camera causes the red water bug. 2021-05-15 13:33:36 +00:00
BoundingBoxAligned.h Fixes a bounding box projection to an incorrect camera causes the red water bug. 2021-05-15 13:33:36 +00:00
BoundingBoxOriented.cpp Cleanups BoundingBoxAxisAligned and fixes coding styles a bit. 2019-06-12 20:23:14 +00:00
BoundingBoxOriented.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
BoundingSphere.cpp Refactor CBoundingSphere and add tests 2019-03-25 21:17:43 +00:00
BoundingSphere.h Fixes a misprint that was introduced in cb83d494e0. 2019-04-25 18:59:41 +00:00
Brush.cpp Removes low-level GL calls from graphics and geometrics primitives and adds DebugRenderer. 2021-04-15 18:07:01 +00:00
Brush.h Removes low-level GL calls from graphics and geometrics primitives and adds DebugRenderer. 2021-04-15 18:07:01 +00:00
Ease.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
Fixed.cpp Remove a load of implicit CStr type conversions, since they're error-prone and can cause silent data loss. 2011-02-17 20:08:20 +00:00
Fixed.h UnitMotion pushing improvements 2022-01-24 15:36:13 +00:00
FixedVector2D.h Avoid overflow in UnitMotion. 2020-11-09 13:25:50 +00:00
FixedVector3D.h Implement a FixedVector2D::CompareLengthSquared function to provide a more performant alternative to CompareLength. 2020-02-09 21:00:43 +00:00
Frustum.cpp Moves Frustum from graphics to maths to more related geometric primitives like bounding ones. 2021-03-29 17:28:13 +00:00
Frustum.h Moves Frustum from graphics to maths to more related geometric primitives like bounding ones. 2021-03-29 17:28:13 +00:00
MathUtil.h Slightly improves minimap flares, makes animation more smooth via alpha fade in/out. 2021-11-16 16:58:32 +00:00
Matrix3D.cpp Cleanup Camera code for projections. 2019-01-05 22:40:56 +00:00
Matrix3D.h Removes mentions of legacy and unused GL calls, unifies AsFloatArray. 2021-10-11 12:39:01 +00:00
MD5.cpp split debug_assert into ENSURE and ASSERT as discussed in a previous meeting. 2011-04-30 13:01:45 +00:00
MD5.h Force some byte-order functions to be inline. 2010-05-25 18:47:11 +00:00
Noise.cpp Actually remove trailing tabs from source/. 2016-11-23 14:09:58 +00:00
Noise.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
NUSpline.cpp Insert cinematic path nodes after the currently selected node instead of before (so paths are not created in the opposite of the expected order). 2017-07-01 15:49:59 +00:00
NUSpline.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
Plane.cpp Actually remove trailing whitespace for non-header files as well. 2016-11-23 13:02:58 +00:00
Plane.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00
Quaternion.cpp Clean up header includes, add new forward declarations. 2020-11-21 11:20:29 +00:00
Quaternion.h Clean up header includes, add new forward declarations. 2020-11-21 11:20:29 +00:00
Rect.cpp Moves CRect from ps to maths to related geometric primitives. 2021-03-30 21:14:36 +00:00
Rect.h Moves CRect from ps to maths to related geometric primitives. 2021-03-30 21:14:36 +00:00
Size2D.cpp Removes unused code from Size2D and changes eol-style to native. 2021-03-27 21:11:36 +00:00
Size2D.h Removes unused code from Size2D and changes eol-style to native. 2021-03-27 21:11:36 +00:00
Sqrt.cpp # Rewrite of the game's simulation system 2010-01-09 19:20:14 +00:00
Sqrt.h # Rewrite of the game's simulation system 2010-01-09 19:20:14 +00:00
Vector2D.cpp Replaces CPos by more a consistent CVector2D, reduces geometry code duplication. 2021-03-28 21:55:13 +00:00
Vector2D.h Replaces CPos by more a consistent CVector2D, reduces geometry code duplication. 2021-03-28 21:55:13 +00:00
Vector3D.cpp Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
Vector3D.h Removes mentions of legacy and unused GL calls, unifies AsFloatArray. 2021-10-11 12:39:01 +00:00
Vector4D.h Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/. 2016-11-23 11:18:37 +00:00