0ad/source/simulation2/components
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
CCmpAIManager.cpp Adds std namespace to shared_ptr usages in scriptinterface and simulation. 2021-05-22 19:30:18 +00:00
CCmpCinemaManager.cpp Fix most Clang 10 Warnings 2020-12-31 14:25:37 +00:00
CCmpCommandQueue.cpp Split off JSON-related function from ScriptInterface, clean up headers. 2021-05-14 10:18:03 +00:00
CCmpDecay.cpp Actually remove trailing tabs from source/. 2016-11-23 14:09:58 +00:00
CCmpFootprint.cpp Fix compilation following 52fcee9c91 2021-02-27 11:12:21 +00:00
CCmpMinimap.cpp Revert 895182cbcb 2021-04-25 13:42:51 +00:00
CCmpMotionBall.cpp Avoid slightly-expensive QueryInterface() calls 2013-09-11 20:41:53 +00:00
CCmpObstruction.cpp Add a simple 'pushing' logic to unit motion to improve movement. 2021-04-02 16:30:59 +00:00
CCmpObstructionManager.cpp Further reduce usage of TERRAIN_TILE_SIZE in non-terrain components 2021-05-02 17:40:00 +00:00
CCmpOverlayRenderer.cpp Fix documentation of non system component. 2017-03-24 07:09:28 +00:00
CCmpOwnership.cpp Bump year number of files changed this year in the license headers. 2017-05-01 14:28:22 +00:00
CCmpParticleManager.cpp Splits CRenderer part about scene to CSceneRenderer. 2022-01-04 13:29:01 +00:00
CCmpPathfinder.cpp Thread the pathfinder computations using the task manager. 2021-06-03 16:21:28 +00:00
CCmpPathfinder_Common.h Thread the pathfinder computations using the task manager. 2021-06-03 16:21:28 +00:00
CCmpPosition.cpp ParamNode: switch to utf8, ToXML -> ToXMLString, test tweak, PCH tweak 2021-04-11 09:23:10 +00:00
CCmpProjectileManager.cpp Fix units changing appearance when switching animation. 2021-07-31 17:55:10 +00:00
CCmpRallyPointRenderer.cpp Removes unused and outdated includes, replaces some includes by forward declarations. 2021-05-15 17:27:01 +00:00
CCmpRallyPointRenderer.h Removes unused and outdated includes, replaces some includes by forward declarations. 2021-05-15 17:27:01 +00:00
CCmpRangeManager.cpp Further reduce usage of TERRAIN_TILE_SIZE in non-terrain components 2021-05-02 17:40:00 +00:00
CCmpRangeOverlayRenderer.cpp Refactors smart pointers creation, reduces code duplication and improves exception safety. 2021-02-13 23:53:40 +00:00
CCmpSelectable.cpp Adds line drawing to DebugRenderer. 2021-04-25 20:48:44 +00:00
CCmpSoundManager.cpp Notify players with a sound when a player is defeated 2020-11-18 09:14:08 +00:00
CCmpTemplateManager.cpp ParamNode: switch to utf8, ToXML -> ToXMLString, test tweak, PCH tweak 2021-04-11 09:23:10 +00:00
CCmpTerrain.cpp Splits CRenderer part about scene to CSceneRenderer. 2022-01-04 13:29:01 +00:00
CCmpTerritoryInfluence.cpp Allow boolean and u16 modifications for C++ 2020-12-11 14:07:48 +00:00
CCmpTerritoryManager.cpp Further reduce usage of TERRAIN_TILE_SIZE in non-terrain components 2021-05-02 17:40:00 +00:00
CCmpTest.cpp Remove some unused Profiler.h and CLogger.h includes. 2019-09-07 13:35:45 +00:00
CCmpUnitMotion.h UnitMotion pushing improvements 2022-01-24 15:36:13 +00:00
CCmpUnitMotion_System.cpp UnitMotion pushing improvements 2022-01-24 15:36:13 +00:00
CCmpUnitMotionManager.h UnitMotion pushing improvements 2022-01-24 15:36:13 +00:00
CCmpUnitRenderer.cpp Moves Frustum from graphics to maths to more related geometric primitives like bounding ones. 2021-03-29 17:28:13 +00:00
CCmpVision.cpp Add support for const methods in components and make those that can be const const. 2017-01-20 02:25:19 +00:00
CCmpVisualActor.cpp Fix units changing appearance when switching animation. 2021-07-31 17:55:10 +00:00
CCmpWaterManager.cpp Splits CRenderer part about scene to CSceneRenderer. 2022-01-04 13:29:01 +00:00
ICmpAIInterface.cpp Employ some variadic macros to make some of the C++ -> JS function calling code nicer. 2017-01-28 23:37:15 +00:00
ICmpAIInterface.h SpiderMonkey 31 upgrade 2015-01-24 14:46:52 +00:00
ICmpAIManager.cpp Split off JSON-related function from ScriptInterface, clean up headers. 2021-05-14 10:18:03 +00:00
ICmpAIManager.h Choose AI behavior in gamesetup 2017-12-20 22:02:15 +00:00
ICmpAttack.cpp Do not hardcode attacktypes in the engine/Atlas 2020-10-10 15:12:17 +00:00
ICmpAttack.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
ICmpCinemaManager.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpCinemaManager.h Draw paths only when cinematics isn't playing. Patch by Vladislav. 2017-05-08 04:02:33 +00:00
ICmpCommandQueue.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpCommandQueue.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
ICmpDecay.cpp # Add corpse decay and building collapse. 2010-08-01 17:38:01 +00:00
ICmpDecay.h # Add corpse decay and building collapse. 2010-08-01 17:38:01 +00:00
ICmpFogging.cpp Reduce drastically the number of mirages by making fogging conditional: entities will be miraged only if their health/resource amount is modified, or if they have a non-gaia owner. 2015-02-07 15:48:32 +00:00
ICmpFogging.h Reduce drastically the number of mirages by making fogging conditional: entities will be miraged only if their health/resource amount is modified, or if they have a non-gaia owner. 2015-02-07 15:48:32 +00:00
ICmpFootprint.cpp Split JS conversions from ScriptInterface. 2021-05-13 09:43:33 +00:00
ICmpFootprint.h Add support for const methods in components and make those that can be const const. 2017-01-20 02:25:19 +00:00
ICmpGarrisonHolder.cpp Fix some C++-style notes from b5df81af76. 2021-01-11 11:26:31 +00:00
ICmpGarrisonHolder.h Fix some C++-style notes from b5df81af76. 2021-01-11 11:26:31 +00:00
ICmpGuiInterface.cpp Employ some variadic macros to make some of the C++ -> JS function calling code nicer. 2017-01-28 23:37:15 +00:00
ICmpGuiInterface.h Removes unused forward declarations of class and struct. 2021-09-08 19:43:01 +00:00
ICmpIdentity.cpp Replace {gender} by {phenotype} and support this tag in VisualActor. 2019-08-01 19:14:40 +00:00
ICmpIdentity.h Replace {gender} by {phenotype} and support this tag in VisualActor. 2019-08-01 19:14:40 +00:00
ICmpMinimap.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpMinimap.h Revert 895182cbcb 2021-04-25 13:42:51 +00:00
ICmpMirage.cpp Hide changes to buildings in the fog-of-war. 2014-08-04 22:49:19 +00:00
ICmpMirage.h Hide changes to buildings in the fog-of-war. 2014-08-04 22:49:19 +00:00
ICmpMotion.cpp # Rewrite of the game's simulation system 2010-01-09 19:20:14 +00:00
ICmpMotion.h # Rewrite of the game's simulation system 2010-01-09 19:20:14 +00:00
ICmpObstruction.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpObstruction.h Add a simple 'pushing' logic to unit motion to improve movement. 2021-04-02 16:30:59 +00:00
ICmpObstructionManager.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpObstructionManager.h Add a simple 'pushing' logic to unit motion to improve movement. 2021-04-02 16:30:59 +00:00
ICmpOverlayRenderer.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpOverlayRenderer.h Use const T& for parameters of some types in script-exposed native functions 2016-01-23 15:17:56 +00:00
ICmpOwnership.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpOwnership.h Add support for const methods in components and make those that can be const const. 2017-01-20 02:25:19 +00:00
ICmpParticleManager.cpp Set svn:eol-style=native, fix some inconsistent line endings 2013-12-06 00:42:50 +00:00
ICmpParticleManager.h Set svn:eol-style=native, fix some inconsistent line endings 2013-12-06 00:42:50 +00:00
ICmpPathfinder.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpPathfinder.h Removes unused and outdated includes, replaces some includes by forward declarations. 2021-05-15 17:27:01 +00:00
ICmpPlayer.cpp Split CColor from Shapes. 2019-01-13 15:38:41 +00:00
ICmpPlayer.h Diplomacy Colors 2018-02-03 14:17:31 +00:00
ICmpPlayerManager.cpp # Add new renderer mode based on GL_ARB_fragment_program. 2011-03-26 20:17:21 +00:00
ICmpPlayerManager.h # Add new renderer mode based on GL_ARB_fragment_program. 2011-03-26 20:17:21 +00:00
ICmpPosition.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpPosition.h Fix target height computation when launching projectiles. 2021-01-22 18:16:13 +00:00
ICmpProjectileManager.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpProjectileManager.h Let the template define the actor used for the projectile. Also let projectiles have an impact animation (such as an explosion). 2017-12-23 09:27:19 +00:00
ICmpRallyPoint.cpp Spawn units in rally point direction 2018-02-07 20:58:07 +00:00
ICmpRallyPoint.h Spawn units in rally point direction 2018-02-07 20:58:07 +00:00
ICmpRallyPointRenderer.cpp Removes unused forward declarations of class and struct. 2021-09-08 19:43:01 +00:00
ICmpRallyPointRenderer.h Spawn units in rally point direction 2018-02-07 20:58:07 +00:00
ICmpRangeManager.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpRangeManager.h Fix no-pch build. Potentially fixes bb49fbe793, 0198942a79, 34b1920e7b, 8b08f4ae7a 0dbf417171, 3af1fc64d2, 5fbdbaa3bc, 6fbf036ae4. 2021-05-12 13:48:55 +00:00
ICmpRangeOverlayRenderer.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpRangeOverlayRenderer.h Diplomacy Colors 2018-02-03 14:17:31 +00:00
ICmpSelectable.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpSelectable.h Diplomacy Colors 2018-02-03 14:17:31 +00:00
ICmpSettlement.cpp # Initial support for territories 2011-07-20 19:48:06 +00:00
ICmpSettlement.h # Initial support for territories 2011-07-20 19:48:06 +00:00
ICmpSound.cpp Fix units not being able to play sounds when walking and running 2018-02-24 18:13:03 +00:00
ICmpSound.h Fix units not being able to play sounds when walking and running 2018-02-24 18:13:03 +00:00
ICmpSoundManager.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpSoundManager.h Fix building without precompiled headers. 2020-11-18 11:35:36 +00:00
ICmpTemplateManager.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpTemplateManager.h AIManager: loads only the used templates when starting (or deserializing) a game 2017-11-24 19:13:28 +00:00
ICmpTerrain.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpTerrain.h Replace hardcoded copies of a C++ simulation constant in JS used to compute the mapsize with a call to a new getter in the C++ interface. 2017-05-31 16:43:57 +00:00
ICmpTerritoryDecayManager.cpp Add a TerritoryDecayManager component to update territoryMap with the blinking state when territories are recomputed. That's needed by the AI which was up to now not aware of blinking cells. 2017-10-07 08:42:39 +00:00
ICmpTerritoryDecayManager.h Add a TerritoryDecayManager component to update territoryMap with the blinking state when territories are recomputed. That's needed by the AI which was up to now not aware of blinking cells. 2017-10-07 08:42:39 +00:00
ICmpTerritoryInfluence.cpp # Initial support for territories 2011-07-20 19:48:06 +00:00
ICmpTerritoryInfluence.h Add support for const methods in components and make those that can be const const. 2017-01-20 02:25:19 +00:00
ICmpTerritoryManager.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpTerritoryManager.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
ICmpTest.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpTest.h # Rewrite of the game's simulation system 2010-01-09 19:20:14 +00:00
ICmpTurretHolder.cpp Allow to specify subunits on creation. 2021-04-05 05:22:25 +00:00
ICmpTurretHolder.h Fix some C++-style notes from b5df81af76. 2021-01-11 11:26:31 +00:00
ICmpUnitMotion.cpp Add accelerations in unit movement. 2021-10-09 21:31:11 +00:00
ICmpUnitMotion.h Add accelerations in unit movement. 2021-10-09 21:31:11 +00:00
ICmpUnitMotionManager.cpp Implement a Motion Manager around UnitMotion. 2021-03-17 17:04:51 +00:00
ICmpUnitMotionManager.h Moddability for pushing: radius in XML, allow deactivating globally/some templates. 2021-06-02 17:36:32 +00:00
ICmpUnitRenderer.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpUnitRenderer.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
ICmpUnknownScript.cpp # Added initial support for players and population counters in new simulation system, plus various infrastructure improvements. 2010-01-22 20:03:14 +00:00
ICmpUnknownScript.h # Added initial support for players and population counters in new simulation system, plus various infrastructure improvements. 2010-01-22 20:03:14 +00:00
ICmpValueModificationManager.cpp Allow boolean and u16 modifications for C++ 2020-12-11 14:07:48 +00:00
ICmpValueModificationManager.h Allow boolean and u16 modifications for C++ 2020-12-11 14:07:48 +00:00
ICmpVisibility.cpp RangeManager: Grid for 2D array, enum cleanups. 2020-06-13 09:05:40 +00:00
ICmpVisibility.h RangeManager: Grid for 2D array, enum cleanups. 2020-06-13 09:05:40 +00:00
ICmpVision.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpVision.h Add support for const methods in components and make those that can be const const. 2017-01-20 02:25:19 +00:00
ICmpVisual.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpVisual.h Implement quality levels for actors & corresponding setting. 2021-04-08 07:22:24 +00:00
ICmpWaterManager.cpp Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers. 2021-05-01 08:01:30 +00:00
ICmpWaterManager.h Replaces UNICODE characters in the code by consistent ASCII characters. 2021-01-15 10:07:36 +00:00