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

Re-implement Chrono Dampener to properly use firing cycle + VFX fixes #5883

Merged
merged 16 commits into from
Jun 23, 2024

Conversation

lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Feb 8, 2024

Fixes #2410.
To replicate the issue, start chrono with targeting of a land/sea surface unit, then walk underwater while staying within its 35 range. It will stay locked on and never check its own inability to fire underwater, so it'll keep firing underwater.
This is caused by its custom firing cycle that never goes to the OnFire event except in the initial target acquisition. The cycle:
idle -> FireReady -(FireReady.OnFire)-> FiringState (repeat forever) -(FiringState.OnLostTarget)-> Idle

Changes

  • RateOfFire actually determines the fire rate now.
  • It can no longer fire underwater.
  • Categories to stun are generated from the BP's stun buff definition instead of being coded in the weapon.
  • Chrono uses its own range instead of relying completely on the primary weapon. Now the range upgrades adjust the range of Chrono, like they do with overcharge.
  • The initial stun effects are fixed (target.InitialStunFxApplied was never reset) and the effect was changed to be a more noticeable flash, as if the enemy was suddenly hit by a burst of energy. The flash effect also reduces with distance since the stun is weaker far away.
  • If you zoomed out or looked away while Chrono was firing, the large ring particle wouldn't emit and you'd never see the effect if you looked back at it. This is changed to always emit because Chrono is rather important.
  • AIR*MOBILE is not a valid target restriction, so Chrono was uselessly firing at aircraft. The target priorities are fixed to only fire at t1-t3 mobile surface units.

Additionally: Fix and improve initial stun effect, make it less dependent on the gun range, and increase its use of BP values
@Garanas
Copy link
Member

Garanas commented Feb 9, 2024

The chrono dampener intentionally did not use the firing cycle. It was like this before I refactored it in #3918. I discussed this back then too and it would prevent multiple Aeon ACUs from permanently stunning enemy units because they have control over when the chrono dampener triggers.

@lL1l1
Copy link
Contributor Author

lL1l1 commented Feb 11, 2024

I prefer that it does use the fire cycle since tying it to the game tick has the potential to delay the activation for 4 seconds, making the weapon seem unresponsive and sluggish sometimes.
I added stunlock prevention by preventing new chrono stuns applying before the initial stunning chrono has reloaded. This allows it to be responsive when you walk into range, but it also harms multi-chrono strategies since one chrono far away from a unit can steal the ability to stun that unit from a chrono much closer, if the timings line up. But to be fair, seeing more than one chrono in a single fight is very rare.

@lL1l1 lL1l1 requested a review from Garanas March 20, 2024 06:56
@Garanas
Copy link
Member

Garanas commented Mar 21, 2024

I'll look into it for you this weekend 👍

@lL1l1 lL1l1 added area: balance related to units balance area: sim Area that is affected by the Simulation of the Game area: graphics Anything Related to the Game Graphics feature: weapon firing cycle related to the weapon firing cycle feature: target priorities related to the target priorities of weapons labels May 1, 2024
@lL1l1
Copy link
Contributor Author

lL1l1 commented May 1, 2024

@MrRowey It should be a very minor change in terms of balance, so I didn't add do not merge. Doesn't change how often Chrono fires or how long it can stun, just when it fires.

- (#5883) Allow Chrono Dampener to fire immediately when a unit comes into range.
Previously, Chrono was synced to game time to prevent stunlocking. Now, units have a cooldown before they can be stunned by any Chrono, which prevents stunlocking while allowing the new Chrono to be more responsive.
- (#5883) Fix Chrono uselessly firing at structures and landed aircraft.

If Aeon SACU get chrono with a longer cooldown, this PR would make creating that new Chrono weapon much easier.

@MrRowey
Copy link
Member

MrRowey commented May 1, 2024

thats fine, Can i get a ping when merged so I can add to patchnotes

@MrRowey
Copy link
Member

MrRowey commented May 12, 2024

@Garanas can you review this, please

@MrRowey
Copy link
Member

MrRowey commented May 30, 2024

@Garanas can you give me a ya or nay for this to be merged in ?

@Garanas Garanas changed the base branch from deploy/fafdevelop to develop June 1, 2024 19:35
@MrRowey
Copy link
Member

MrRowey commented Jun 18, 2024

@lL1l1 can you fix the conflict and can we get this in before the new game patch

@lL1l1
Copy link
Contributor Author

lL1l1 commented Jun 19, 2024

Please make sure to test that overcharge doesn't mess with the firing sequence: #1271 Going by the description of the origin of the issue it shouldn't, but it's good to be sure.
When creating the PR, I only tested that the visuals work and that multiple chronos stunning the same unit didn't stunlock the unit and that the closest chrono took priority in stunning (since it stuns the longest).

@lL1l1
Copy link
Contributor Author

lL1l1 commented Jun 23, 2024

Tested with a bunch of Percies on Setons mid (has underwater areas near land), NoDamage enabled, and adv gun range vs no gun range upgrades.

  • No errors
  • Overcharge doesn't do anything to chrono
  • Multiple ACU can't stunlock, and they don't interrupt eachother, as much as I could see, the closest ACU gets to stun the unit so stun time is maximized.
  • Gun range upgrades scale Chrono's effects correctly.
  • works above/below water vs above/below water targets

@MrRowey MrRowey merged commit 42a0c67 into FAForever:develop Jun 23, 2024
5 checks passed
MrRowey pushed a commit that referenced this pull request Jun 24, 2024
<!-- General useful tooling:
- [ScreenToGif](https://www.screentogif.com/): Free, open source screen
recorder that can export to MP4. If the changes are visual, these can
help you tell us exactly what the changes imply!
-->
<!-- Feel free to remove unused parts of this template. -->

## Issue
Due to #5883, Chrono's effects are visible through fog of war.

## Description of the proposed changes
<!-- A clear and concise description (or visuals) of what the changes
imply. -->
<!-- If it closes an issue, make sure to link the issue by using
"(Closes/Fixes/Resolves) #(Issue Number)" in your pull request. -->
Use LOD instead of making the effects always visible. The 1100 LOD makes
it always visible from a max zoomed out view on a 10 km map, and for 20
km maps, visible if about 1/4th of the map is visible. This is
appropriate for the huge AoE Chrono has: it's larger than a nuke's inner
radius. It's still weaker than a nuke, so it doesn't have unlimited LOD.

I used the emitter editor to make the changes so the file format is
changed.

## Testing done on the proposed changes
<!-- List all relevant testing that you've done to confirm the changes
work. -->
Build a chrono ACU and have it groundfire. Zoom out to see the effects
are visible at a reasonable zoom level. Switch to civilian army and turn
on fog of war to check that the effects don't emit if the ACU is not
visible.

## Checklist
- [x] Changes are documented in the changelog for the next game version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: balance related to units balance area: graphics Anything Related to the Game Graphics area: sim Area that is affected by the Simulation of the Game feature: target priorities related to the target priorities of weapons feature: weapon firing cycle related to the weapon firing cycle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

need to fire chrono dampner on land to fire it afterward in water
3 participants