2019-08-18 21:40 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0006199Spring engineGeneralpublic2019-04-10 10:38
ReporterGoogle_Frog 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusnewResolutionopen 
Product Version104.0 +git 
Target VersionFixed in Version 
Summary0006199: More control over unit-unit repulsion force and distance
DescriptionI am not clear on what controls how closely units can pack and the forces that try to prevent packing. I would essentially like to set a units repulsion radius and the strength of the force that keeps units apart. This may even be useful to apply to small structures.
TagsNo tags attached.
Checked infolog.txt for lua ErrorsIrrelevant
Attached Files

-Relationships
+Relationships

-Notes

~0019919

Kloot (developer)

Describing the code in words will never be accurate, so "it attempts to prevent footprint overlap by pushing units apart based on radial penetration depth with 'forces' inversely proportional to their relative momenta" will have to do as a summary. Only the repulsion radius is actually constant.

Some parameters can probably be extracted to Lua (and other dials added), but full control will require using the UnitUnitCollision callin.

~0019924

Google_Frog (reporter)

Here are some issues I've found with what I'm trying to do: https://youtu.be/Gr_yh_XAYiM

The interaction between allied and enemy units is a lot better, but units slip past and through tight looking clumps of enemy units too easily. I think I would like the repulsive force to grow to a hard boundary over a much shorter radius. The aim is to be unable to move through a gap between two adjacent enemy units. I would like to configure the packing radius to be about twice what it is currently for a 2x2 footprint. I don't want to increase the footprint too much because that causes more jittery interactions with terrain.

The other issue I had is with toggling pushResistant. My end goal with ally pushing is to make allies able to push each other with idle or moving, but not when busy with a task that requires them to stand still (such as attacking). I tried implementing this by using SetGroundMoveTypeData at the appropriate points in the units LUS, but found that enabling pushResistant seems to disable the units ability to repel allies. The pathmap does not update fast enough to stop units from walking into the backs of allies so they tend to phase through the units in front, and sometimes become stuck. I think this may be solved by increasing the packing radius of the units to better cover the block created by pushResistant, and there is possibly an issue where units with pushResistant don't emit any repelling force.

~0019934

Google_Frog (reporter)

I'm testing out some changes to the collision mechanics in a fork. The code is currently specialised to my particular case and generally unmergable: https://github.com/GoogleFrog/spring/commits/colTest
+Notes

-Issue History
Date Modified Username Field Change
2019-04-05 15:54 Google_Frog New Issue
2019-04-05 16:53 Kloot Note Added: 0019919
2019-04-06 04:44 Google_Frog Note Added: 0019924
2019-04-10 10:38 Google_Frog Note Added: 0019934
+Issue History