Bug Monster stats overflowing int32

heeheehee

Developer
Staff member
3982544193 is out of range, returning 0

Apparently monsters stats are being parsed into ints. If they're bigger than 2 ** 32 - 1, then this causes them to be totally useless.

edit: this is probably in net.sourceforge.kolmafia.combat.MonsterStatusTracker.
 
Last edited:

Fluxxdog

Active member
I think Veracity means what did you fight, do, etc. to cause a monster to have such a high HP? (My money is on one of Dr. Weirdeaux monsters.)
 

Veracity

Developer
Staff member
Oh, I figured that. I was wondering if this happened in combat, from an ASH script, whatever.

It is true that we store Attack, Defense, and HP in int, rather than long variables. Should be easy enough - but considering it affects ONLY Dr. Weirdeaux monsters, it didn't seem a high enough priority to wait for before the emergency point release.
 

heeheehee

Developer
Staff member
Right. In the meanwhile, I'm just parsing the Manuel stats from the page. It's not too big of an inconvenience.
 
Monster HP shows as 0 when HP is very large

r16083. Message in gCLI: "3810120529 is out of range, returning 0", at beginning of battle. Shows as 0 HP in relay browser. Manuel shows 3810120529.

Well, the exception is being handled anyway.
 

heeheehee

Developer
Staff member
Merged with existing thread. I do have a patch to handle this, but it requires a lot of internal changes (once attack gets high enough, stats start overflowing the count field of AdventureResult, as well), so I'm not yet ready to commit it.

In the meantime, uhm, please stop fighting Weirdeaux monsters?
 
:D When the radio says get fingernail clippings, I go get 'em. Somewhere in the back room is a big pile of the things.

Obviously not a high priority change. Some day when I have the time I'll get back to ascending and leave all these silly big numbers behind.

[and did I put that in the wrong forum? oops...]
 

heeheehee

Developer
Staff member
The other reason this isn't a priority at all (in my opinion) is because of how KoL handles very large monsters --- while yes, at the start of combat, monsters have high stats, after the initial pageload, their stats are capped at 2^31-1.
 

Theraze

Active member
Does that mean that the >int stats are actually lying and it starts at 2^31-1 from the beginning, or does it take the first round honestly against the shown stats, but not save higher than 2^31-1 after that?

So basically, if a monster starts with 3 billion health and I hit it for 100k... does it have 2^31-100001 or 2^31-1 health?

If it's the first, then the mafia workaround for the KoL bug would be simply storing 2^31-1 health and stats anytime it shows higher, since that's what KoL is actually using.
If it's the second, then there probably isn't anything 'good' we can do to try to track KoL inconsistencies.
 

heeheehee

Developer
Staff member
Even though it's the former (if you twiddle, you see that the stats are immediately capped), that still isn't quite what KoL uses, since Marinara damage is still computed off of the pre-cap value.
 

heeheehee

Developer
Staff member
Stat gains are based on the pre-cap value. I've certainly gotten hundreds of billions of stats from a single combat before.
 

heeheehee

Developer
Staff member
You gain 24709303416 Fortitude
You gain some Muscle points!
You gain 54576022385 Wizardliness
You gain some Mysticality points!
You gain some Levels!
You gain 23203338981 Sarcasm
You gain some Moxie points!
Hm, not quite, I guess. Logged attack was 357,308,639,959. Marinara did do 9 billion damage that hit, though; that was fun.
 
Top