Each of the following screenshots shows the total xp/hr displayed as roughly MIN_INT for a signed 32-bit integer. I was able to reproduce them each the following ways, with the issue being present for one or two game cycles before it corrected itself. With no other skills being tracked (that is, after "Reset All" is chosen):



Check if this is still present post #1367
I'll check with the coming release :+1:
I'll try to do a farm run on master's code to check if I remember.
Not fixed. This is from current master branch code.

Edit: Same thing happened after teleporting, cleaning herbs, and using agility shortcuts, so same bug as before.
I noticed that XpTrackerPlugin subscribes to both ExperienceChanged and GameTick events. Which order do they come in on a tick where XP is updated?
The client ticks every 20ms, it can change the xp during those ticks. The gametick event happens every 600ms so your answer is that it can happen in any order.
Still not solved?
Okay, got a couple questions:
A simple way I was able to reproduce this was by doing the following:


I was easily able to reproduce something similar using one of the steps @Nightfirecat mentioned (only thing my total exp not showing -max_int)

But i don't think this is a bug, since its somewhat accurate if i could repeatedly gain that exp in such short time. (few millisec)
Are you sure you're on the latest snapshot @Nightfirecat ?
The recent two screenshots were from last week's release, but I was seeing the same behavior last night when I did a farm run on master's code.
It going into the minus just means that the integer overflows the max value, so I'm not exactly sure if there actually is a bug here aside from it briefly displaying such a huge amount (because first time you gain exp is "instant" so the the calculation would use for example 3ms = 1 action)
I have reproduced it and saw it for a few seconds.
Cause: Divide by zero result = Max Integer.
Adding max integer to another integer results in negative integer due to signed integer behavior.
FISHING Time in seconds: 0
FISHING Value: 90
FISHING Result: 2147483647
...
FISHING Time in seconds: 1
FISHING Value: 90
FISHING Result: 324000
When I add FLETCHING Result: 2147483647 to FISHING Result: XXX, I get -214748XXXX
I'll write up a PR for this. I think I have a solution for it.
Yeah thats exactly what I was saying. Maybe we could assume time always being 0.5 seconds at the least, which seems reasonable.
@Kamielvf I tried low second values and it was still crazy. It worked well with 60 seconds in my testing.
Makes sense, you could get an xp drop each tick which is why I suggested 0.5 seconds but if that happens your Xp tracker will update accordingly anyway.
@Nightfirecat @Kamielvf
Wanna try on master to confirm?
Will do later today.
Yup, problem solved. :+1:
Unfortunately, it looks like this isn't fixed after all--just saw it again today... :confused:


Video of a simpler repro case: https://www.youtube.com/watch?v=afAqr3EATvs (wind striking, meleeing, pickpocketing NPCs and burying bones in Lumbridge)
https://github.com/runelite/runelite/pull/1419 fixed in here, in case you want to wait.
Most helpful comment
Cause: Divide by zero result = Max Integer.
Adding max integer to another integer results in negative integer due to signed integer behavior.
When I add
FLETCHING Result: 2147483647toFISHING Result: XXX, I get-214748XXXXI'll write up a PR for this. I think I have a solution for it.