Winterbay's Helpful Automatic Monsterbasher (WHAM)

bsander

Member
I don't necessarily care about the dreadsylvania monsters, just in general I think WHAM stuns too little if it's so cheap with for instance the rain-doh blue balls. I would like an option to weigh not-getting-hit higher over killing the monster fast while suffering more damage.
 

Crowther

Active member
I don't necessarily care about the dreadsylvania monsters, just in general I think WHAM stuns too little if it's so cheap with for instance the rain-doh blue balls.
I'm not entirely familiar with WHAM's stunning code, why not add blue balls to your CCS?
I would like an option to weigh not-getting-hit higher over killing the monster fast while suffering more damage.
I'm not up on all the new monster mechanics, so I didn't realize you wanted to avoid being hit at all costs, but I should have understood that from your message. However, this isn't about Dreadsylvania?

WHAM tries to be as efficient as possible. If you don't agree with the cost it assigns to being hit, you'll want to modify that by significantly raising _meatperhp. This will cause WHAM to be terrified of losing any HP, so it should make the choices you seem to want. This value is normally set by Bale's UR script, so if you use that (and you should be), you'll need to modify it or WHAM or BatBrain. For example, by changing this line in BatBrain.ash:
Code:
if (get_property("_meatperhp") != "") meatperhp = to_float(get_property("_meatperhp"));
to something like this:
Code:
if (get_property("_meatperhp") != "") meatperhp = to_float(get_property("_meatperhp"))*10;
WHAM will consider HP to be 10x more valuable than UR says it is. Just remember, you will be asking WHAM to be wasteful to avoid the lower cost of being hit, because being hit bothers you more than the actually cost of healing.

BTW, if you weren't running UR, then that might explain some poor choices, since without UR WHAM/BatBrain have less information about the actual costs of healing.
 
Last edited:
Does WHAM have slime support, for the Sauceror nemesis quest?

I ask because I have viles of slimes as my goal, I adventure and it does this:

Code:
Round 0: chef_rannos wins initiative!
Round 1: Hungry Hungry Squidite produces a tubular red firecracker labeled M-65, lights the long fuse, and tosses it behind your opponent.
ATT: 147 (2.4% × 2.41, death in 862)
DEF: 132 (97.73% × 128.18, win in 2)
HP: 167, Value: 334.69 μ, RES: 0
WHAM: Monster HP is 167.0.
WHAM: Running SmartStasis
Profit per round: ActionProfitDamageOtherbase; Squamous Gibberer (0μ)0μ--60% stun chance
WHAM: Starting evaluation and performing of attack
WHAM: We are going to 1-shot with Headbutt.
Round 1: chef_rannos executes a macro!
Round 1: chef_rannos casts HEADBUTT!
Round 2: vendor slime takes 142 damage.
Round 2: vendor slime takes 65 damage.
Round 2: chef_rannos wins the fight!
After Battle: Hungry Hungry Squidite sets off a lovely little cluster rocket, and smiles broadly as it explodes.
You gain 3 hit points
You gain 3 Mana Points
After Battle: Hungry Hungry Squidite's scaly tentacles gently caress your face.
You gain 37 hit points
You gain 29 Mana Points
You gain 13 Strengthliness
You gain 20 Wizardliness
You gain 9 Cheek
 

Theraze

Active member
Yes and no. It knows that it can use the bottle in the lobby for free damage. However, to be efficient, it's not doing that. Best choice for you is probably to make a location-CCS exception that runs the item instead of WHAM there. :)
 

Winterbay

Active member
I thought SS tried to gather slimes, but I may remember wrongly and I haven't slept well tonight due to kid-not-wanting-to-sleep disorder...
 
Normally I let nemesis.ash do all the work, but I was trying to get a jump on the slime collection while burning turns of Deep-Tainted Mind... :)

I had plenty of safe moxie, so to me, it seems like the most efficient method would be to save the MP and use the free damage, especially if my goal is only obtainable that way. ;)
 

fronobulax

Developer
Staff member
On occasion I get extremely frustrated with WHAM because it will, for example, decide to spend 30 rounds against a spectre and get beaten up when I had enough mana to one shot it with Saucestorm. WHAM is mature enough (and complex enough) that I am sure this is the result of some setting I have set but don't understand. Inevitably whenever I voice my frustration I am told to recreate the situation with a higher verbosity and post the results. Of course I can't always do that so I am left with a vague feeling of dissatisfaction. I think that WHAM may be at a point where the following Feature Request would be worth doing. That would be for WHAM to detect that it has lost a fight and whenever that happens dump any and all of the diagnostic information someone would use to determine why into a file. This would be controlled by an opt in parameter, of course.

I do not know at what point control gets passed from WHAM to Mafia so this request may not be feasible strictly within WHAM.ash but I can certainly see setting up something where WHAM always dumped the relevant parameters of the last battle and a between battle script checked parameters to determine whether the file should be preserved or deleted. As much as I worship Total Automation, I'd even accept something where setting the flag in WHAM just wrote the file and added "When Beaten Up is Acquired Abort" to a mood. Maybe WHAM sets everything as a Mafia or zLib parameter and something else collects those parameters into a file. But it is really time to ask for WHAM to provide enough information that the question Why? can be answered after the fact.

Thanks.
 

livercat

Member
Today WHAM tried to kill a Moister Oyster with a... champagne popper. I'm not sure what caused it, I'll try to catch something similar with a higher verbosity.
[1872] An Octopus's Garden
Encounter: moister oyster
Round 0: livercat loses initiative!
Round 1: moister oyster takes 1 damage.
Round 1: moister oyster takes 4 damage.
Round 1: moister oyster takes 3 damage.
You lose 30 hit points
WHAM: Running SmartStasis
WHAM: Starting evaluation and performing of attack
WHAM: Reached WHAM_round_limit while looking for a way to kill the monster. Executing the current strategy and continuing from there.
WHAM: Enqueuing a stun to help with the battle
WHAM: We are going to 10-shot with Rain-Doh blue balls, Saucegeyser, Saucegeyser, Saucegeyser, Saucegeyser, Silent Squirt, divine champagne popper, divine champagne popper, divine champagne popper and divine champagne popper.
Round 1: livercat executes a macro!
Round 1: livercat uses the Rain-Doh blue balls!
Round 2: moister oyster takes 9 damage.
Round 2: moister oyster takes 3 damage.
Round 2: moister oyster takes 4 damage.
Round 2: moister oyster takes 4 damage.
You lose 32 hit points
Round 2: livercat casts SAUCEGEYSER!
Round 3: moister oyster takes 124 damage.
You gain 33 hit points
You gain 9 Mojo Points
Round 3: moister oyster takes 1 damage.
Round 3: moister oyster takes 8 damage.
Round 3: moister oyster takes 3 damage.
You lose 30 hit points
Round 3: livercat casts SAUCEGEYSER!
Round 4: moister oyster takes 130 damage.
You gain 37 hit points
You gain 7 Mojo Points
Round 4: moister oyster takes 1 damage.
Round 4: moister oyster takes 6 damage.
Round 4: moister oyster takes 3 damage.
You lose 30 hit points
Round 4: livercat casts SAUCEGEYSER!
Round 5: moister oyster takes 249 damage.
You gain 37 hit points
You gain 10 Mojo Points
Round 5: moister oyster takes 2 damage.
Round 5: moister oyster takes 4 damage.
Round 5: moister oyster takes 4 damage.
You lose 29 hit points
Round 5: livercat casts SAUCEGEYSER!
Round 6: moister oyster takes 237 damage.
You gain 32 hit points
You gain 9 Mojo Points
Round 6: moister oyster takes 3 damage.
Round 6: moister oyster takes 6 damage.
Round 6: moister oyster takes 3 damage.
You lose 32 hit points
Round 6: livercat casts SILENT SQUIRT!
Round 7: moister oyster takes 42 damage.
Round 7: livercat uses the divine champagne popper!
 

Winterbay

Active member
Well it reached WHAM_round_limit which can make it do silly things like that. However it really shouldn't have since that is marked as a custom action and it wanted to use 4...
 

Crowther

Active member
I can certainly see setting up something where WHAM always dumped the relevant parameters of the last battle and a between battle script checked parameters to determine whether the file should be preserved or deleted.

An interesting idea. I too have shared your frustration in trying to get a log for a failed fight. Worse, when I finally got one, it didn't contain enough information for me to find the source of the problem, so I became obsessed with finding monsters I'd predictably lose against, so I could debug them. Those often turned out to be special monsters in KoL and not the source of my frustration.

And while I wrote the above, this arrived:
Today WHAM tried to kill a Moister Oyster with a... champagne popper. I'm not sure what caused it, I'll try to catch something similar with a higher verbosity.
Which is a great example of a special monster. The moister oyster has "25% Physical Resistance and 25% Elemental Resistance." I believe the line I just added to batfactors.txt should allow WHAM to better predict damage against the moister oyster.

I looked into adding something to WHAM to compare predicted damage to actually damage. Damage ranges, combat macros and mafia not saving that information were all obstacles. One thing you can do is turn on mafia's reporting of actually damage. That helps find these problems.
 

Crowther

Active member
I don't recognize this. Is that logging the monster health changes or logging cleaned HTML for fights or something else?
I always believed it was the second. Looking at when logMonsterHealth shows up in FightRequest.java it looks like the information all comes from the HTML.
 

Winterbay

Active member
1) Are you sure that's 10? If so tehre is something very wrong going on as 10 should abort before perfoming any actions.
2) There is something odd going on... There are no prints at all starting with "WHAM: " which there should be lots of...
 

EdFox

Member
Your concerns tied all my recent issues with stomping/siphoning and auto attacking together. For some reason WHAM wasn't running even though my CCS is just consult WHAM.ash. Then I noticed my action was set to attack with weapon... *facepalm* How that got changed, I do not know but it's irrelevant.

Forgive me. I'm overdrunk today but I'll recheck all these issues tomorrow and likely be deleting a number of forum posts.
 
Your concerns tied all my recent issues with stomping/siphoning and auto attacking together. For some reason WHAM wasn't running even though my CCS is just consult WHAM.ash. Then I noticed my action was set to attack with weapon... *facepalm* How that got changed, I do not know but it's irrelevant.

Forgive me. I'm overdrunk today but I'll recheck all these issues tomorrow and likely be deleting a number of forum posts.


:D I've done stuff like that before. I blame it on getting old in my case. ;)
 

zarqon

Well-known member
Winterbay, I wanted to post here to give you a heads up about the upcoming BatBrain release, which will require you to make a few (simple) changes to WHAM.

The custom field for advevents (presently a boolean) will be changing to a string. So anywhere that you're checking someadvevent.custom, you'll instead want to check someadvevent.custom != "". Note that due to reasons observed here, WHAM may still verify even without editing, but it would have very unfortunate results, as checking custom would always return false, meaning that WHAM may start treating custom actions as normal actions.

Since my update may not actually cause your script to fail to run (though it would be behaviorally broken), we'll want to make our updates at nearly the same time. If you're ready to update any time in the next 5 hours, we can synchronize. Otherwise, I'll wait until I've heard back from you.

I apologize for the inconvenience, but this change is totally worth it. We will be able to have a category of custom action for each game mechanic (so far: attract, banish, yellow, copy).
 

Crowther

Active member
I've been dying in the fantasy airship. Here's an example:
Code:
[374] The Penultimate Fantasy Airship
Encounter: Random Lack of an Encounter
Encounter: MagiMechTech MechaMech
Strategy: /home/scottk/.kolmafia/ccs/Destroy.ccs [default]
Round 0: crowther loses initiative!
You lose 51 hit points
ATT: 187 (94% × 58.66, death in 3)
DEF: 175 (8.8% × 27.45 (10), win in 19)
HP: 174, Value: 685.35 μ, RES: 0
Your Slimeling is running on E.
WHAM: Monster HP is 174.0.
WHAM: Running SmartStasis
Profit per round: ActionProfitDamageOtherbase; Slimeling; enthroned El Vibrato Megadrone (0μ)73.53μ--MP: 12.5
WHAM: Starting evaluation and performing of attack
WHAM: Enqueuing a stun to help with the battle
WHAM: We are going to 9-shot with Rain-Doh blue balls, Candyblast, Ravioli Shurikens, Clobber, attack with your weapon, attack with your weapon, attack with your weapon, attack with your weapon and Salsaball.
Round 1: crowther executes a macro!
Round 1: crowther uses the Rain-Doh blue balls!
Round 2: magimechtech mechamech takes 18 damage.
Round 2: crowther casts CANDYBLAST!
Round 3: magimechtech mechamech takes 72 damage.
You acquire an item: Senior Mints
Round 3: crowther casts RAVIOLI SHURIKENS!
Round 4: magimechtech mechamech takes 39 damage.
You lose 51 hit points
Round 4: crowther casts CLOBBER!
Round 5: magimechtech mechamech takes 14 damage.
Round 5: magimechtech mechamech takes 9 damage.
You gain 9 Mana Points
You lose 52 hit points
Round 5: crowther attacks!
Round 6: magimechtech mechamech takes 3 damage.
Round 6: magimechtech mechamech takes 16 damage.
You gain 16 Mana Points
You lose 51 hit points
Look! You found 1 Senior Mints (50μ)!
WHAM's trying to 9-hit in a death-in-3 situation. I don't think blue balls are that good. Batfactors says 3, which includes the round they are used on, so it matches the wiki's 2. Still, that means death on round 6 and winning on round 9. Not an optimal strategy. Of course, WHAM is trying to extend combat out, because of my slimeling. It's almost like the blue balls are being counted twice.
 

Winterbay

Active member
Well, it's actually 8 rather than 9 (the stun is added onto the queue, but that is still more than we would want. How much damage would you assume "attack" would do, and how much damage does a slimeling do?

Also, Zarqon: I've been out for the entire day and won't be able to do anything about this for a while. I may have time to do some poking tomorrow afternoon/evening (i.e. in ~20 hours or so from this posting). If you want to you could go ahead, people can go back one revision if needed for things to work and I'll get to it asap.
 
After upgrading to the newest build of kolmafia and seeing an svn update for BCA and Zlib this morning I am know getting this:

1635] The Middle Chamber
Encounter: Iiti Kitty
Strategy: C:\Users\Eddie\Dropbox\Kolmafia\ccs\default.ccs [default]
Round 0: txranger wins initiative!
"if" requires a boolean conditional expression (WHAM.ash, line 302)
Consult script 'WHAM.ash' not found.
You're on your own, partner.
Click here to continue in the relay browser.
 
Top