beyond-all-reason / beyond-all-reason/RecoilEngine

Separate the use of targetBorder for range and aimPos to aim

Open
#2,897 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 2h
Merged PRs (30d)
40

Description

Assigning `targetBorder = 1` makes units target the nearest point on an enemy. This makes sure that a target with any part of its hitbox within range can be targeted, preventing awkward boundaries on the targeting volume.

But it causes shots on a retreating target to lead the target less, by (approx) half its radius. This exacerbates the retreat advantage by quite a lot and, for some weapons, drops their damage output to zero when chasing.

Also, units that are in hugging range point their guns sharply inward to aim at the enemy unit. This was very noticeable on the new Legion Praetorian, which just got new elbow joints on its wide-set twin shotguns.

I am not sure if the targetBorder should be respected in any cases, not just these, over the aimPos.

The request would be: After checking whether the targetPos is within range, maybe in GetUnitLeadTargetPos, aim at the aimPos if within range else the intersection of the ray along aimPos->targetPos and the targeting volume.

I think I'd prefer the engine to do this rather than leveraging https://github.com/beyond-all-reason/RecoilEngine/pull/2813. Though none of that is up to me.

Contributor guide

Open the contributing guide

Research direction

Start at GetUnitLeadTargetPos and trace how targetBorder, targetPos, and aimPos are used for range checks and leading. Reproduce the retreating-target and hugging-range cases, then verify that aiming uses aimPos when it is in range and otherwise follows the targeting-volume intersection described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
47/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.