server icon indicating copy to clipboard operation
server copied to clipboard

๐Ÿ›+๐Ÿ”จ Multiple misuses of xi.mod.DELAY and a general lack of how-to

Open TeoTwawki opened this issue 3 years ago โ€ข 0 comments

  • [x] I have paid attention to this example and will edit again if need be to not break the formatting, or I will be ignored
  • [x] I have searched existing issues to see if the issue has already been opened, and I have checked the commit log to see if the issue has been resolved since my server was last updated
  • [x] I have read and understood the Contributing Guide

Explanation

Yeah, I am violating the template(s) a bit here. :stuck_out_tongue:

Short version:

setDelay() takes milliseconds as input instead of a weapon delay value. xi.mod.DELAY ~~is a percentage adjustment.~~ (as of #2526 DELAYP will be used for percent adjustments, while DELAY needs set up to use standard delay units) And the weapon delays in the database are not milliseconds. 240 is not 240ms nor 2400ms. Unification of everything using just standard delay values is desired. You want 240 delay, you input 240. No conversions.

tl;dr we need better functionality for the scripters, and some existing scripts need corrections.

Long version:

Several PRs brought in some changes that were simply incorrect. People have difficulty gauging a mobs actual delay, and the way we hand delay changing in project is a chaotic mix of various kludges that leave the average user unable to determine what they should be doing. I already know, and even I have trouble following that code end to end. End users are usually watching some youtube video and trying to time things. This more often than not makes it even worse for a whole slew of reasons that would take this issue way off topic. Hopefully in the near future an addon I am fiddling with will make it easier for them.

In these wrong scripts, authors have assumed that setting the mod directly adds, subtracts, or overwrites the mobs delay. None of that is true. The modifier is in fact a percentage change. So when the ladybug mixin says -400, the ladybug is receiving a 400% attack speed increase that is clearly not retail.

  • That mixin is not the only place to incorrectly use the modifier. A helper lua in sealions den sets it to zero. Goblin Wolfman uses the mod in the amount of 1500 which probably (needs checked) should have been a haste mod (NOT haste effect mind you).
  • ~~The only place using this correctly is code invoked by Blitzer's Roll.~~ (as of #2526 DELAYP will be used for percent adjustments, while DELAY needs set up to use standard delay units)
  • To SET a mobs delay to a specific value, the function setDelay() must be used. This unfortunately takes input in milliseconds instead of the standard delay units our database uses.
  • There are currently no functions or non % modifiers to adjust delay with other than full on overwriting it with setDelay()
  • Users almost never convert between these correctly, often mistaking a 240 delay for 2400 ms, if they even know to convert at all.
  • a 450 delay weapon takes 7500 ms to swing. It feels like 2handers take forever to swing because they really do :joy:

From BG wikiw:

Time per swing (seconds) = Base Delay รท 58.6-60.4 Delay per Second The conversion coefficient is often rounded to 60 delay/second, but there is evidence that it is not entirely constant and it is unclear why.

Emphasis mine. FFXIclopecida simply lists wdelay 60 = 1 second and I believe that is what our core is doing. I'm unsure what we do on ranged delays, but they use different math so we might have them wrong.

The only 100% pure proof of any delay is to measure the TP gain. Anything else can only approximate it, but we know the game likes to use certain numbers that happen to align with types of weapons: 504, 480, 240, 180, etc. so if we calculate something as 242 using known good reference points it's a good bet its actually 240.

TeoTwawki avatar Aug 11 '22 16:08 TeoTwawki