Fixing Cyclops futily slow beaming a stinger by instead making it inch forwards
Fixes https://github.com/ZeroK-RTS/Zero-K/issues/3338
TODO:
- [x] Further restrict when inching happens. Only do it when attack moving or attacking the slow beamed target
- [ ] Be more careful about removing commands to specifically only remove when it's an inching move command
- [ ] Verify performance drop when a hundred cyclops are spammed is under 1%
I feel like the engine is meant to have something that sets which weapon is for aiming. Failing that, how much range does slowbeam need to lose for the main gun to fire at reasonable elevation differences? If the fix is as simple as 20 less slowbeam range, then perhaps that's the one to go for.
After a bit of looking I couldn't find any way to use the engine for this.
The slow beam needs to lose about 60 range before a modest slope or a hill 1.5 lotus high prevents it from just sitting there. However, this is not a viable solution as losing any range at all means a Cyclops on attack move won't move into slow beam range against stingers or other static things like a afk paladin. It also can't catch and kill Dante any more and is MUCH easier for scalpels and domis to kite (two units tank really struggles against).
Shall I go ahead with my TODOs above on the assumption this will be merged?
I was planning to look prior to the next update. I'll have a look now and make some comments.
I tried to move a Cyclops through Crab range and it gave itself a small move order and became stuck. The units in this picture are immobile.
This time I spawned a Cyclops in range and tried to move away. It got to the point where it could no longer fire, then got stuck on a small move order towards the Crab.
Moving a Cyclops away from a Nimbus is impossible.
I don't see any part of the code that would deal with these cases.
"IterableMap with ApplySelf " <- no idea what this is
Grep for examples. Eg

Grep for examples again. Other gadgets use it. Experiment a bit.