-
Notifications
You must be signed in to change notification settings - Fork 248
Fix inaccuracy of the DoTTime weapon stat
#6457
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
Conversation
same as in the DamageArea function
- Fix the DoT interval not matching DoTTime: - 1: Properly count the first pulse as happening immediately for calculated DoT interval. - 2: Use an accumulator to correct errors caused by `WaitTicks` rounding downwards. - Make the control flow more straightforward
New logic is accurate for DoT times, so the stats in the blueprints need to be changed to what actually happened with the old inaccurate time logic to avoid balance changes
Garanas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the differences between EntityDoTThread2 and EntityDoTThread. At least I think they should be named better. But beyond that - from a maintainability perspective, is it desirable to have two instances of functions that are almost identical?
It may adjust the balance of mods (as you mention), but that weighs less than the reduced maintainability in my point of view.
|
I kept the second function around in case there are any non-projectile scripts utilizing the default damage's DoT by itself, and are expecting the first damage instance to happen immediately. Unfortunately since the total duration is calculated outside the function and we only get the interval it's not possible to cleanly avoid this. Mod balance was not a concern, and I think they benefit more from visuals lining up with damage effects than potentially losing some precision tuned and tested stats. |
Do you have an example where this is done? |
|
No. |
|
You respond fast 😃 , in that case my preference would weigh towards better maintainability and just go for one of the two definitions. But I'll leave that decision to you and @BlackYps |
clyfordv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I also agree that we should not keep functions around for unconfirmed hypotheticals |
|
Just need a simple approval now, I removed the redundant functions and the rest of the code is reviewed. |



Issue
DoTTimerepresents how long it should take damage pulses to occur, with t = 0 being the first pulse and t = x being the last pulse.In reality, there was error from
WaitTicksflooring tick wait values and the DoT interval being calculated asDoTTime / DoTPulsesinstead ofDoTTime / (DoTPulses - 1)(the first pulse occurs instantly, you don't need to wait for it).This causes unit stats in the blueprints to be rather inaccurate depending on how much error accumulated from
WaitTicks's flooring.Some egregious cases are Aeon T3 mobile arty dealing damage over 4.2 seconds instead of 5 seconds, Aeon T3 static arty actually pulsing a 2nd time after 1 second instead of 2 seconds, and the UEF T1 bomber dealing damage over 3.6 seconds instead of 4.2 seconds. A lot of the 1 and 0.5 second times are actually 0.8 and 0.4 seconds respectively.
Description of the proposed changes
DoTTimestat by correctly counting the first pulse as taking 0 time, and using an accumulator variable to correct the flooring errors. Also streamlines the ProjectileDoDamagecontrol flow which made it easier to modify (less branches where code needs to be duplicated).DoTTimes so that they match the old, inaccurate behavior, to avoid changing balance.UnitDoTThread.Testing done on the proposed changes
Logging when damage ticks occur before/after the changes on a UEF T1 bomber (UEA0103) modified to shoot 1 projectile.
Comparing the before/after stats using this console command on the unmodified unit stats:
Output:
Checklist