Closed marcushutchings closed 4 months ago
Note, games using their own targetting priorities are not impacted by this change. This change only affects games using the engine's internal targeting priority calculations.
Is there a rationale for previous behavior? I'd like to understand (if any) what was the idea.
It comes from a time before Lua had control (so was implementing game design) and I believe it was meant to partially avoid all units picking the same target when there are multiple similar choices available and partially reduce rigidness. Regardless, Lua can add the component back if desired (while currently you can't do the opposite and cancel the random component out, other than reimplementing the whole calculation from scratch).
What is the rationale to scan targets every two seconds or so, if the current target is valid?
Probably to make sure the unit is targetting the best unit - with units moving about during combat, it likely helps break up any excessive over targetting of one unit.
It is only done during auto target.
If you give the unit a specific target, then it will stay on that target.
What is the rationale to scan targets every two seconds or so, if the current target is valid?
Otherwise everything would get stuck on the first thing that enters range.
Addresses the issue where units can sometimes find themselves switching back and forth between two targets that are similar distance and angle. For slower rotating turrets, this can prevent them opening fire. Units without a specific attack target check for targets on slow update, the random element can cause two similarly viable targets to cause units to switch between the targets each time.
https://cdn.discordapp.com/attachments/724924957074915358/1230113372322795540/golswing.mp4?ex=6632235a&is=661fae5a&hm=ede9cabe20e2cf7894ef3f279dacf9721199d8e574a382af3863848d8cc9f193&