View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0006199 | Spring engine | General | public | 2019-04-05 15:54 | 2020-02-11 14:12 | ||||||||
Reporter | Google_Frog | ||||||||||||
Assigned To | |||||||||||||
Priority | normal | Severity | feature | Reproducibility | N/A | ||||||||
Status | new | Resolution | open | ||||||||||
Product Version | 104.0 +git | ||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0006199: More control over unit-unit repulsion force and distance | ||||||||||||
Description | I 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. | ||||||||||||
Tags | No tags attached. | ||||||||||||
Checked infolog.txt for Errors | Irrelevant | ||||||||||||
Attached Files |
|
![]() |
|
Kloot (developer) 2019-04-05 16:53 |
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. |
Google_Frog (reporter) 2019-04-06 04:44 |
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. |
Google_Frog (reporter) 2019-04-10 10:38 |
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 |
Google_Frog (reporter) 2020-02-11 14:12 |
I made a PR with a compatible parameter https://github.com/spring/spring/pull/493 |
![]() |
|||
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 | |
2020-02-11 14:12 | Google_Frog | Note Added: 0020347 |