Skip to content

Comments

Extra threat#2114

Open
TaranDahl wants to merge 2 commits intoPhobos-developers:developfrom
TaranDahl:ExtraThreat
Open

Extra threat#2114
TaranDahl wants to merge 2 commits intoPhobos-developers:developfrom
TaranDahl:ExtraThreat

Conversation

@TaranDahl
Copy link
Contributor

Extra threat

  • Now you can adjust the techno's evaluation of the threat posed by the target in more ways. This will help the techno in auto - targeting.
    • When the target poses a threat to the techno, it will receive an additional threat value defined by ExtraThreat.IsThreat.
      • Generally speaking, "Posing a threat" means the target can fire at the techno.
      • Using AlwaysConsideredThreat makes the target always considered to be a threat.
    • When the target is within the techno's range, it will receive an additional threat value defined by ExtraThreat.InRange.
    • When the target is within the techno's range, it will receive an additional threat value equal to ExtraThreatCoefficient.InRangeDistance multiplied by the distance (in cells) from the target to the techno.
      • Only considering in-range is because the vanilla flag TargetDistanceCoefficientDefault only considers outside-range. This flag is complementary to that.
    • The target will receive an additional threat value equal to ExtraThreatCoefficient.Facing multiplied by the difference in facing from the techno's current firing-facing to the target's facing.
      • "Firing-facing" refers to the facing the techno uses to check if it "is already facing the target and can fire". Infantry doesn't check the facing when firing, so this is also invalid for infantry.
      • The unit of facing is the in-game internal numerical scale. A full circle corresponds to 65536.
    • The target will receive an additional threat value equal to ExtraThreatCoefficient.DistanceToLastTarget multiplied by the distance (in cells) from the target to the techno's last target.
      • Each techno will record its current target as the "last target" per frame. This record will be retained for at most 15 frames after the target becomes invalid.
      • If the techno doesn't have a "last target", then this will not take effect.

In rulesmd.ini:

[General]
ExtraThreat.IsThreat=0.0                            ; double
ExtraThreat.InRange=0.0                             ; double
ExtraThreatCoefficient.InRangeDistance=0.0          ; double
ExtraThreatCoefficient.Facing=0.0                   ; double
ExtraThreatCoefficient.DistanceToLastTarget=0.0     ; double

[SOMETECHNO]                                        ; TechnoType
AlwaysConsideredThreat=false
ExtraThreat.IsThreat=                               ; double, default to the flag in [General] with same name
ExtraThreat.InRange=                                ; double, default to the flag in [General] with same name
ExtraThreatCoefficient.InRangeDistance=             ; double, default to the flag in [General] with same name
ExtraThreatCoefficient.Facing=                      ; double, default to the flag in [General] with same name
ExtraThreatCoefficient.DistanceToLastTarget=        ; double, default to the flag in [General] with same name

@TaranDahl TaranDahl added ❓New feature Needs testing ⚙️T1 T1 maintainer review is sufficient labels Feb 22, 2026
@github-actions
Copy link

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.

@phoboscn-bot
Copy link

To Chinese users:
This pull request has been mentioned on Phobos CN. There might be relevant details there:

致中文用户:
此拉取请求已在 Phobos CN 上被提及。那里可能有相关详细信息:

https://www.phoboscn.top/t/topic/161/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs testing ❓New feature ⚙️T1 T1 maintainer review is sufficient

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants