flyeredML - potential rounding problem

Magus_Prime

Well-known member
I've had this happen three times in the last few weeks: when flyeredML reaches 10,000 and I return to the arena I can't complete the quest. Flyering one more monster is sufficient to complete the quest.

Both Ezandora's Guide relay script and zarqon's SmartStasis depend on the KoLmafia property flyeredML to monitor progress during flyering. Both scripts agree that 10,000 ML of monsters have been flyered.

Here is the Guide logic:

Code:
		string [int] modifiers;
		modifiers.listAppend("+ML");
		float percent_done = clampf(get_property_int("flyeredML") / 10000.0 * 100.0, 0.0, 100.0);
		int ml_remaining = 10000 - get_property_int("flyeredML");
		string [int] details;
		if (percent_done >= 100.0)

and here is the SmartStasis logic:

Code:
   foreach flyer in $items[jam band flyers, rock band flyers] if (item_amount(flyer) > 0 && get_property("flyeredML").to_int() < 10050 &&
      (to_boolean(vars["BatMan_flyereverything"]) || m.base_attack.to_int() >= 10000 - get_property("flyeredML").to_int()) && !happened(flyer) &&
      !($locations[the battlefield (hippy uniform), the battlefield (frat uniform)] contains my_location()))
     encustom(to_event("use "+to_int(flyer),to_spread(0),to_spread(to_string(m_dpr(0,0)*(1-m_hit_chance()))),"!! flyeredML +"+monster_attack(m),1));

I'm uncertain as to whether the problem lies in the actual flyeredML value or in how Guide and SmartStasis are handling it.

My search-fu failed me so I'd appreciate it if someone would refresh my memory on how to display the current value of flyeredML in the gCLI.

Thank you.
 

Crowther

Active member
Last run I had to manually flyer three monsters to complete the quest, even though when I went to the arena in the relay browser it said on top of the page that I'd done 100.0%. Normally when it fails I only need to do one monster. No idea what I did so different that run.
 

Bale

Minion
Do you have Monster Manuel? I also had such issues before I had Manuel since there is a variance to ML. If you don't have Manuel, then that is probably the problem.
 

Crowther

Active member
Do you have Monster Manuel? I also had such issues before I had Manuel since there is a variance to ML. If you don't have Manuel, then that is probably the problem.
I've got one. And I've got all the spleunky factoids too. :p
 

Bale

Minion
We can rule out monster level variance then.

I haven't had a single glitch with flyerdML being accurate since I got Manuel. There must be something else involved here.


I've got one. And I've got all the spleunky factoids too. :p

Those are no big deal. I'd be much more impressed if you told me you have all the factoids from the crowd of elemental adventurers. Those are the only factoids I'm missing now.
 
Last edited:

Crowther

Active member
Those are no big deal. I'd be much more impressed if you told me you have all the factoids from the crowd of elemental adventurers. Those are the only factoids I'm missing now.
Just 13 more to go. I'm sure the last one will take forever.
 

Bale

Minion
Just 13 more to go. I'm sure the last one will take forever.

You're doing a little better than me. I still need these 16 factoids:

=================================
[Hottest Adventurer Contest]
Fire Fighter {1}
The Lavalier {2}
=================================
[Coldest Adventurer Contest]
Mrs. Freeze {1}
=================================
[Stinkiest Adventurer Contest]
Granola Barbarian {3}
Cheese Wizard {3}
Assassin {3}
Odorous Humongous {3}
=================================

Despite having seen 14 crowds of elemental adventurers (counting my current run) I still haven't see a single Stinky Adventurer!! On the other hand, I cannot begin to tell you how many Spooky and Sleazy adventurers I have slaughtered.
 

Darzil

Developer
I have had issues like this recently. Am trying to remember the circumstances though. Might have been Heavy Rains, and it might be that the ML from water level didn't count for flyer ML, but Mafia will have expected it to count. Which path were you in ? Either way, finding a fix will be much more complex than just reporting it wrong and finding an easy fix, will have to work out exactly how the ML accumulation varies from expected, and why, so the unknown part of the relationship can be supported.
 

Magus_Prime

Well-known member
@Bale: Yes I have a Monster Manual and while it's not fully populated with factoids the ones I'm missing are either Tower-related or odd aftercore monsters.

@Darzil: The problem has occurred recently in softcore standard runs. I've been running between 80 - 100 ML throughout the runs when flyeredML is a factor. This functionality has worked well for a long time so I suspect a new element in the equation.

What type of variable is used to store flyeredML?
 
Last edited:

Veracity

Developer
Staff member
Despite having seen 14 crowds of elemental adventurers (counting my current run) I still haven't see a single Stinky Adventurer!! On the other hand, I cannot begin to tell you how many Spooky and Sleazy adventurers I have slaughtered.
I'm also on my 14th run and have this left:
Code:
=================================
[Hottest Adventurer Contest]
The Lavalier {1}
=================================
[Coldest Adventurer Contest]
Snowbrawler {3}
Ice Cream Conjurer {3}
Iceberglar {3}
Mrs. Freeze {3}
=================================
[Stinkiest Adventurer Contest]
Odorous Humongous {1}
=================================
I'll be running my last day's turns later this morning and will finish up Stinky, leaving 1 more Hot run and 3 "more" Cold runs to go. "more" in quotes, since I have seen none in 14 tries so far. So, like Crowther, I am effectively down to 13 contestant factoids needed.

On topic, Darzil is correct: we will need more info about the situations in which we are over-estimating ML. I've never had an issue since I got Manuel (see - talking about factoids was on-topic!).
 

Magus_Prime

Well-known member
Just before I ran out of turns today I started the war and received my flyers. Tomorrow I'll monitor progress turn by turn.
 

Veracity

Developer
Staff member
What type of variable is used to store flyeredML?
An integer.

It starts at 0, is incremented by the monster's Attack value (either average, from monsters.txt, plus ML, or exact, from Manuel, which includes ML) - which is an integer, and you are deemed to be "done" when it reaches or exceeds 10,000.

The calculation for what flyering does is this:

Code:
				int ML = Math.max( 0, MonsterStatusTracker.getMonsterAttack() - MonsterStatusTracker.getMonsterAttackModifier() );
				Preferences.increment( "flyeredML", ML );
Here is the monster attack calculation:

Code:
	public static final int getMonsterAttack()
	{
		if ( MonsterStatusTracker.monsterData == null )
		{
			return 0;
		}

		if ( MonsterStatusTracker.manuelFound )
		{
			return MonsterStatusTracker.attackManuel;
		}

		int baseAttack = MonsterStatusTracker.originalAttack;
		int adjustedAttack = baseAttack + MonsterStatusTracker.attackModifier;
		return baseAttack == 0 ? adjustedAttack: Math.max( adjustedAttack, 1 );
	}
I.e., attack is the original attack plus the "attack modifier" - adjustments from deleveling, for example.

So, the amount we adjust flyeredML by is baseAttack + attackModifier - attackModifier.

What is baseAttack? I.e. originalAttack?

Code:
		MonsterStatusTracker.originalAttack = MonsterStatusTracker.monsterData.getAttack();
or, if you have Manuel and he gives you "attack" the first time you see the monster.

Code:
			MonsterStatusTracker.originalAttack = attack;
What does MonsterData.getAttack() return, for the case when you don't have Manuel? For the simple case of monsters.txt having an integer, rather than a formula (scaling monsters, for example):

Code:
			return (int) Math.floor( Math.max( 1, attack + ML() * this.mlMult ) * getBeeosity() );
I don't know what monsters have an "mlMult"; only if monsters.txt says "MLMult: xxx". getBeeosity() is 0, if you are not in BeeCore.

So, basically it is base attack from monsters.txt + KoLCharacter.getMonsterLevelAdjustment();

I just started flyers. I'll track every time I do that and will visit the Arena just before I hit 10,000 and just after. I'll report back, by and by.
 

Darzil

Developer
I don't know what monsters have an "mlMult"; only if monsters.txt says "MLMult: xxx". getBeeosity() is 0, if you are not in BeeCore.
Only ones so far are Cave Bars, which scale up 5 times faster than +ML, and Drunksgiving ones (apparently) which weren't affected by +ML. Probably historically some other scaling monsters didn't, and others may in future.
 

Theraze

Active member
What does MonsterData.getAttack() return, for the case when you don't have Manuel? For the simple case of monsters.txt having an integer, rather than a formula (scaling monsters, for example):

Code:
			return (int) Math.floor( Math.max( 1, attack + ML() * this.mlMult ) * getBeeosity() );
I don't know what monsters have an "mlMult"; only if monsters.txt says "MLMult: xxx". getBeeosity() is 0, if you are not in BeeCore.

Is it actually multiplying by zero? That would zero out the whole value then...
 

lostcalpolydude

Developer
Staff member
Since attack from Manuel is a reliable thing, and several people (including me) are suddenly seeing this tracked incorrectly, I suspect that MonsterStatusTracker.getMonsterAttackModifier() is wrong somehow, and my first guess would be weirdness in some new deleveling source.

Is it actually multiplying by zero? That would zero out the whole value then...
It's actually 1 in that case.
 

Theraze

Active member
Any chance there's some (semi)popular softcore gear which isn't counted? Do we have confirmation whether this has happened for people outside softcore?

Or that one of the 'bonus' effects of the increased ML changes include only getting half bonus ML-credit above 75 or 100 or something like that?
 

Veracity

Developer
Staff member
Code:
modtrace Monster Level

MCD +10.00 = 10.00
Pride of the Puffin +10.00 = 20.00
Ur-Kel's Aria of Annoyance +24.00 = 44.00
Drescher's Annoying Noise +10.00 = 54.00

Starting with flyeredML = 0
lobsterfrogman (atk=222) +222 = 222
lobsterfrogman (atk=228) +222 = 450
pygmy witch nurse (atk=199) +199 = 649
pygmy orderlies (atk=206) +206 = 855
pygmy orderlies (atk=204) +204 = 1059
pygmy witch surgeon (atk=200) +200 = 1259
ancient protector spirit (atk=216) = 1475
pygmy witch accountant (atk=203) = 1678
pygmy shaman (atk=200) = 1878
pygmy witch lawyer (atk=203) = 2081
pygmy witch accountant (atk=206) = 2287
pygmy witch lawyer (atk=204) = 2491
pygmy shaman (atk=205) = 2696
pygmy witch accountant (atk=208) = 2904
pygmy witch accountant (atk=207) = 3111
pygmy witch accountant (atk=205) = 3316
pygmy witch accountant (atk=201) = 3517
pygmy witch accountant (atk=204) = 3721
pygmy shaman (atk=200) = 3921
pygmy shaman (atk=198) = 4119
pygmy shaman (atk=200) = 4319
pygmy witch accountant (atk=205) = 4524
ancient protector spirit (atk=212) = 4736
pygmy headhunter (atk=199) = 4935
pygmy witch accountant (atk=204) = 5139
pygmy witch accountant (atk=201) = 5340
pygmy witch accountant (atk=202) = 5542
pygmy witch accountant (atk=203) = 5745
pygmy headhunter (atk=201) = 5946
pygmy witch accountant (atk=203) = 6149
pygmy witch accountant (atk=205) = 6354
pygmy headhunter (atk=197) = 6551
ancient protector spirit (atk=214) = 6765
pygmy bowler (atk=206) = 6971
pygmy orderlies (atk=206) = 7177
pygmy bowler (atk=205) = 7382
pygmy bowler (atk=209) = 7591
pygmy bowler (atk=211) = 7802
pygmy bowler (atk=204) = 8006
ancient protector spirit (atk=210) = 8216
Protector Spectre (atk=218) = 8434
The Junk (atk=212) = 8646
The Skinflute (atk=211) = 8857
The Burrowing Bishop (atk=216) = 9073
The Astronomer (atk=223) = 9296
The Twig and Berries (atk=210) = 9506
The Hooded Warrior (atk=218) = 9724
The Pork Sword(atk=216) = 9940
(visited arena - not done yet)
The Junk (atk=217) = 10157
(visited arena - done)
This was completely typical for me. I have Manuel, and as soon as the flyered % hits 100, I can complete the sidequest.
 

Bale

Minion
I'll be running my last day's turns later this morning and will finish up Stinky, leaving 1 more Hot run and 3 "more" Cold runs to go. "more" in quotes, since I have seen none in 14 tries so far. So, like Crowther, I am effectively down to 13 contestant factoids needed.

It relieves me to see that I'm not the only one that can miss one element 14 times.
 
Top