Talk:Active effect time imprecision bug

From the CreationKit Wiki
Jump to navigation Jump to search

Credit goes to meh321 for discovering the precise nature of the problem, and for providing me with the code offset that I needed to investigate further and get some more exact details on how the passage of in-game time relates to real-time effect durations. I realize the name of the article is kinda butt, but it's the only thing I could think of that's fully accurate, given that this bug isn't exclusive to abilities or conditions. DavidJCobb (talk) 2020-03-03T08:57:53 (EST)

Affected actors[edit source]

After doing a bit more digging, I think only the player is affected?

ActiveEffect::AdvanceTime is called in the following places:

  • ActiveEffect::Subroutine00657160 (always passes zero as the time)
  • MagicTarget::sub00663DF0 (always passes zero as the time)
  • MagicTarget::AdvanceTime (passes its own argument)
    • This function is only called in four places. Two are player-exclusive; one is for "non-actor magic targets;" and the remainder is Actor::AdvanceTime, which passes its own argument.
      • Actor::AdvanceTime is only ever passed a non-zero value when it's called on the player.
  • call near 0x00667588 (always passes zero as the time)
  • ActiveEffect::Subroutine006675C0 (always passes zero as the time)

If ActiveEffect::AdvanceTime is told to pass zero seconds, then it forces conditions to be re-checked. If I'm not mistaken, this means that the only time it ever receives a non-zero value (i.e. the only time it might ever not re-check conditions) is when it's called on the player. This would suggest that the time imprecision bug only affects the player. Has anyone seen it affect abilities on an NPC? DavidJCobb (talk) 2020-03-03T09:27:04 (EST)

The thing that's making me feel so unsure of myself here is: if ActiveEffect::AdvanceTime is never told how much to advance when called on an NPC, then how does it update elapsed time on NPCs' effects? DavidJCobb (talk) 2020-03-03T09:27:58 (EST)
If Actor::AdvanceTime is called with zero, it computes the correct time delta to use from various global timing-related values that remain unidentified. Hooking and logging indicates that Unknown012E32E8::Subroutine0075B5D0 advances time for all actors. Not yet sure whether these time values are affected by fast-traveling/sleeping/waiting/prisoning. DavidJCobb (talk) 2020-03-04T12:02:22 (EST)