Skip to content

Allow weapon range modifiers to apply on ProjectileRange#2230

Open
Starkku wants to merge 1 commit into
Phobos-developers:developfrom
Starkku:feature/projectile-range-modifiers
Open

Allow weapon range modifiers to apply on ProjectileRange#2230
Starkku wants to merge 1 commit into
Phobos-developers:developfrom
Starkku:feature/projectile-range-modifiers

Conversation

@Starkku
Copy link
Copy Markdown
Contributor

@Starkku Starkku commented May 28, 2026

ProjectileRange now has weapon range modifiers applied to it if greater than 0 and unless ProjectileRange.ApplyModifiers is set to false on the WeaponType.


Summary of changes:

  • Patches Ares code to skip Ranged=true projectile checks and updating projectile position to new coordinates.
  • Add new hook at 0x467BA4 (Ares hook return address) with updated projectile range check as well as the skipped position update.
  • New mechanism treats BulletClass::Range as immutable initial max range (as opposed to distance that the projectile can still travel that is deducted from every frame) to preserve ability to check effective range with dynamic modifiers, distance traveled so far is stored in new field BulletExt::DistanceTraveled.

Fixes the main underlying reason for #2227's existence, whether or not it has any reason to remain after addressing this I do not know.

@Starkku Starkku force-pushed the feature/projectile-range-modifiers branch from 8fa259a to 4a23258 Compare May 28, 2026 11:41
@Starkku Starkku force-pushed the feature/projectile-range-modifiers branch from 4a23258 to 1206de7 Compare May 28, 2026 11:43
@Starkku
Copy link
Copy Markdown
Contributor Author

Starkku commented May 28, 2026

Behaviour of projectiles immolated by Firestorm Wall should be tested, there's a high likelihood that this was broken here (something I realized as an afterthought). I will adjust the patches and hook accordingly if this turns out to be the case.

@github-actions
Copy link
Copy Markdown

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.

@Coronia
Copy link
Copy Markdown
Contributor

Coronia commented May 28, 2026

tested it and firestorm wall seemed to behave like what it was before: can't intercept the projectile directly but changing its destination to a location near the wall. Not sure if this need to be adjusted

and there're other issues: it can't affect range bonus from high ground, opentopped transport, Tank Bunker etc. These cases can also resulted in failure of projectile with range limit

in addition, the game now becomes super laggy when a unit with ProjectileRange weapon and WeaponRange.Multiplier AE entering a Tank Bunker. It won't be laggy if it's not inside Bunker or using WeaponRange.ExtraRange instead of multiplier

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants