Bug "Exp" zone-dependent variable off (by order of magnitude?)

VinnyB

Member
Hi, I've been trying to reproduce the "<Mainstat> Experience" variable (which appears in the green sidebar), but haven't been able to figure out how to get the "EXP/2" component. It's clearly splitting "Experience" up and bundling it into the appropriate attributes, and presumably including stat multipliers too. But it's also including a zone-dependent variable which appears to be underestimating stats from monsters in the selected zone by ~10x. FantasyRealm has a bunch of 1-monster zones, with nice round base ML. Here's an example of the various values of "EXP/2" I saw with an arbitrary setup (though with the usual +10% moon sign stat multiplier):

100 ML zone: 23.33
120 ML zone: 23.58
130 ML zone: 23.71
140 ML zone: 23.83
150 ML zone: 23.96

That's a predicted increase of only 0.63 substats from a ML increase of 50.
What one SHOULD see from +50 base ML is 50/8 = 6.25 (primary) substats, or 6.875 if including the moon sign.

(Ideally I'd sort of prefer to just see the number free of zone-predictive info, since I rarely pre-set the "Adventure" zone before visiting a location...)
 

VinnyB

Member
Obviously this is pretty low priority, but bumping this to keep it on the first page (since it does still seem to be broken).

Maybe just commenting out the zone-specific variable would be easiest, until someone gets around to seeing where it's miscalculating? It's already effectively shrunk into oblivion, but at least then it would remain stable (and thus more useful!).

Thanks for what y'all do! I'd offer to help if I had the slightest inkling of how to do so >_<
 

fronobulax

Developer
Staff member
Well I read this the first time and didn't understand it and I reread it because you politely bumped it but I'm not sure what the problem is.

In the (usually) green side pane there is a list of modifiers - some given as numbers and some as percentages. There is a modifier labelled "Exp: " followed by a signed number (to two decimal places). I think you are trying to calculate the same number independently and not getting the expected result. You believe there is a zone specific component to the calculation and that KoLmafia is not accounting for that correctly. Am I close?

I would not describe what I am talking about as 'the "<Mainstat> Experience" variable' so I am not sure we are talking about the same thing. Since I have not looked at the code I have no idea whether "EXP/2" is a division or a shorthand indicating experience gains depend upon stat gain boosters and ML modifiers or something else.

You note that the Adventure Zone is not always set.

So I see a couple things going on.

You believe that when the Adventure Zone is set the displayed value is still calculated incorrectly.

In addition you would like a calculation that did not account for adventure zone effects OR a means of being reminded that the Adventure Zone might not be what you want it to be.

Any of this close to correct?
 

xKiv

Active member
I would not describe what I am talking about as 'the "<Mainstat> Experience" variable' so I am not sure we are talking about the same thing.

I don't know either, but when I do "modtrace exp" I get an overview table where one of the rows is "Class EXP/2" and one of the columns is "$Mainstat Experience", and the value in their intersection is weird. And it's the only value in the entire table that changes when I select a different location on the Adventure tab.

I believe the relevant code starts in KolCharacter around line 6200. Excerpts for me (moxie class, moxie sign, no tuning):
Code:
		double monsterLevel = newModifiers.get( Modifiers.MONSTER_LEVEL );
...
		double baseExp = ( Modifiers.getCurrentML() - monsterLevel ) / 4.0f; //  monsterLevel is 17*3=51, which corresponds to ML 51 shown on my green pane
		double exp = newModifiers.get( Modifiers.EXPERIENCE ); // at this point 20.0
...
	double moxExpPct = newModifiers.get( Modifiers.MOX_EXPERIENCE_PCT ) / 100.0f; // 0.1
...
			double moxExp = baseExp * moxExpPct + exp * ( 1 + moxExpPct ); // ??*0.1 + 20.0*(1.1) 
...
				newModifiers.add( Modifiers.MOX_EXPERIENCE, 1 + moxExp / 2.0f, "Class:EXP/2" ); // 13.77

Let's see what happens when debugging.

baseExp = 31.875
exp = 20
moxExpPct = 0.1
moxExp = 25.1875
EXP/2 := 1 + moxExp / 2.0f = 13.77

So this includes the bonus mainstat that's due to my moonsign (because that's my only %-based exp source). This explains why the effect is only 10% of full base monster experience.

I am calling not-a-bug, working as expected, intended, and useful.
 

VinnyB

Member
Ah, I get: it's predicting the size of the monsters to be encountered, but only for the purposes of folding percentage statgain bonuses into the additive statgain bonus calculation. So it's not a bug, and it's useful for comparing +xp setups ... IF you set the adventure zone beforehand. Maybe the maximizer could show the presumed zone if percentage statgains are involved in calculations? (perhaps excluding the ever-present moon sign bonus) Surely I'm not the only one that hops around a lot...

Actually... if it's already predicting who you're going to fight, wouldn't a straight-up prediction of the TOTAL experience from said fight be more useful?

Also, dummy programming question: Are those variables listed in that snippet of code checkable via CLI command? (I am indeed trying to calculate the "Exp" number independently)
 
The maximizer always considers your current zone, for just about everything (like all the zone specific item drops), so that is nothing new.
But you can set the location you are about to adventure in with the set_location() command or by selecting it in the adventure tab of the cli before running the maximizer.

That said, you do have a good point overal: why is it not returning the total expected experience gained, that does sound like a far more useful number.
 
Last edited:

xKiv

Active member
That said, you do have a good point overal: why is it not returning the total expected experience gained, that does sound like a far more useful number.

Does maximizing for item drops/meat from monsters/... include the base 100%?
 
Top