Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aim testing issues #1801

Open
saurtron opened this issue Dec 6, 2024 · 2 comments
Open

Aim testing issues #1801

saurtron opened this issue Dec 6, 2024 · 2 comments

Comments

@saurtron
Copy link
Collaborator

saurtron commented Dec 6, 2024

Seems like atm there's some problems with testing for whether an unit is targetable.

Opening this issue to try to gather information about this and maybe look for potential solutions.

One of the main issues seems to be it's not possible to query for being able to target a unit taking cannon potential position into account. So it checks from current position, when moving the cannon the test can change.

Also, maybe current methods to query might not be documented well enough.

  • GetUnitWeaponTryTarget
  • GetUnitWeaponTestTarget
  • GetUnitWeaponTestRange
  • GetUnitWeaponHaveFreeLineOfFire
  • ... ?

References:

  • this PR looks like it could help: preaim at blocked targets #977
  • @sprunk proposes "GetUnitWeaponHaveFreeLineOfFire should have a version that uses weapon query piece and a version that uses weapon aimfrom piece, perhaps a version that accepts an arbitrary piece or even arbitrary xyz as well"
  • According to robert the epie "the problem originates from a fix: ce4c51d to [Issue #891]"
  • also from robert "try target goes through test target (can the target class or ground be shot, e.g. aa can't shot sea), range, is underground, and then the line of fire test that is the problem"
  • this issue might be related too
  • here is @SethDGamre reporting about it on discord

Seth's report from discord (there's also a video there but I can't seem to copy it):

  • Spring.GetUnitWeaponHaveFreeLineOfFire() is jank to the point of almost being useless for cannons.
  • It conducts the test (regardless of what sourceX, sourceY, and sourceZ input values) from the QueryWeapon() piece in the animation script. This is problematic because as the point from which the projectile is fired changes elevation, it changes the point from which GetUnitWeaponHaveFreeLineOfFire is being tested from. Meaning it'll return false when it's lowered, but when it's raised to fire (like here, when smart select switches it to high trajectory) it'll return true. This causes infinite loops when obstacles are barely blocking the trajectory.
  • In the video, the Aggrivator (corpun) has had its QueryWeaponX piece changed to its base (which doesn't move)
    the Persecutor has the sleeve (point from which the weapon fires) as its QueryWeaponX piece which moves with barrel elevation changes. I tried AimFromWeaponX changes only so the point from which the projectile emits wouldn't be affected, but this has no effect on GetUnitWeaponHaveFreeLineOfFire.
@lhog
Copy link
Collaborator

lhog commented Dec 7, 2024

If there's a bug with ce4c51d let's create a separate issue, copy all necessary information / replay in this issue and tag the author of commit to see if they possibly can have a look. References to Discord are not good. All relevant information is supposed to be in the ticket. For me for example Discord doesn't even open from the browser.

@saurtron
Copy link
Collaborator Author

saurtron commented Dec 9, 2024

If there's a bug with ce4c51d let's create a separate issue, copy all necessary information / replay in this issue and tag the author of commit to see if they possibly can have a look. References to Discord are not good. All relevant information is supposed to be in the ticket. For me for example Discord doesn't even open from the browser.

At the moment I'm not sure it's specifically that commit is really the problem, we just have a report that it might be that.

Since I seen several aim related issues/reports and didn't find anything here, I created this task to try gather more information. Could be nothing is even working but just documentation lacking, although by @sprunk comments seems like it's a known issue and in part could be game responsibility since engine can't really give a perfect solution, but it can maybe provide some extra methods to help.

Regarding the discord report, yeah... I know :P. I now copied his testimony above, but can't seem to copy all the information so the discord link could be useful at least for me helps in going back to the specific place in chat.

My hopes with this issue is to find out if there's just one or maybe more issues and then have a clear idea of what can be done to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants