Phobos icon indicating copy to clipboard operation
Phobos copied to clipboard

[Customize & New Feature]Targeting Optimizations

Open TaranDahl opened this issue 1 year ago • 5 comments

  1. Technos won't SelectAutoTarget if they are not IsArmed. Didn't check thoroughly, more tests or disassembling are needed.
  2. New flags to customize the scanning delay per techno, and differently for player and AI. Default to the vanilla flags NormalTargetingDelay and GuardAreaTargetingDelay. As enemy scanning is a costly part of the total overhead, this should be able to improve the performance, especially on the maps with numbers of enemies.
[General] or [SomeTechno]
AINormalTargetingDelay=
PlayerNormalTargetingDelay=
AIGuardAreaTargetingDelay=
PlayerGuardAreaTargetingDelay=

P.S.: The docs are coming, s∞n. image

TaranDahl avatar Aug 18 '24 10:08 TaranDahl

Documentation please image

MortonPL avatar Sep 26 '24 11:09 MortonPL

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

github-actions[bot] avatar Sep 26 '24 11:09 github-actions[bot]

Documentation please image

It's here now.

TaranDahl avatar Sep 26 '24 14:09 TaranDahl

This can be merged after tests.

Some friends in Chinese community tested this. No fatal error, desync, or misbehavior was found. Didn't check for edge cases carefully, though.

TaranDahl avatar Sep 27 '24 08:09 TaranDahl

Deployed infantry appear to be ignoring these tags. In fact, they also appear to be ignoring the two original tags. They shoot immediately at anything that gets nearby, no matter how high delay values i set. Some hardcoded behavior for deployed infantry, i suppose.

Didn't notice any other issues.

mevitar avatar Dec 11 '24 22:12 mevitar

From my personal perspective, the implementation of DistributeTargetingFrame may not be as efficient as modifying the random range of TargetingTimer which is default to (0,2).

Yeah. It does incur some additional overhead. However, its purpose is not to replace that randomness. It is designed to address the frame rate drops caused by the periodic auto-targeting of a large number of units pre-placed on the map.

TaranDahl avatar Jul 09 '25 05:07 TaranDahl

Yeah. It does incur some additional overhead. However, its purpose is not to replace that randomness. It is designed to address the frame rate drops caused by the periodic auto-targeting of a large number of units pre-placed on the map.

If that's the case, then I think we can try to make TargetingTimer start a random value during TechnoClass::Init?

CrimRecya avatar Jul 09 '25 06:07 CrimRecya

The Tanya’s problem mentioned in the doc should have been resolved, remember to remove it.

CrimRecya avatar Jul 10 '25 07:07 CrimRecya