BatBrain -- a central nervous system for consult scripts

Oh my...I knew there was a reason I bought that tome! :D

You bought it because if Jesus were an IotM tome, he would be outclassed by this thing. The true wins are A Light that Never Goes Out, epic consumables and Louder Than Bomb. The way it interacts with Utensil Twist is just decoration on the cake. There is so much amazing decoration on this cake that it is hard to encompass the awesomeness. Even Handsome Devil's +100% item drop bonus is just another cake topping.
 
I've made a little progress on Disco Face Stab, Disco Shank and Knife in the Dark. They need the weapon power from your best knife in inventory. I got this with this patch to BatBrain.ash. View attachment knife.patch.txt

I got the first two to match very well (without disco momentum). I'm a bit unsure what to do about Knife in the Dark. The formula for physical damage matches Disco Face Stab, very closely, but the extra spooky damage has a very different formula. The problem is, I don't know how to do an uneven division like that in batfactors.txt. Maybe it just needs special handling in BatBrain.

Sorry, I'm all over the map on what skills I'm looking at. Today I decided Sneaky Pete might use knives, so I went after knife skills.
 
Are the formulas well-spaded, or do those need work? >.>
They weren't perfectly clear on the wiki, but I didn't have much trouble filling in the details. Knife in the Dark was just a spread sheet of spading results, but since it matched other skills I'd just tested, it wasn't much of a puzzle. The big problem is add in that extra spooky damage. It's not a portion of the regular damage, but a different formula (which I haven't bothered to figure out, but it looks simple like 0+{.1,.15,.2}*1.25*wpnpower).

For now I just left off the spooky damage. It's pretty small anyway. I'll update batfactors when BatBrain officially has a way to prove the wpnpower of the best knife in inventory.
 
r30 Update

Thanks again for all the help with the new content, guys. Thanks also for the encouragement -- I'm glad the script continues to prove useful. This update contains several more of the changes that cannot be made in batfactors:

  • Account for brain drops in monster_value() using ZLib's new braindrop() function.
  • Support for Deft Hands granting +25% damage from combat items. Assuming this is additive with the Vivala mask bonus rather than multiplicative.
  • All Cadenzas are automatically "once", so batfactors need not specify "once" for them (thanks for the stopgap though, Bale).
  • As requested by Crowther, add "bestknife" fvar, for use in batfactors with DB skills that use your best knife in inventory (there are three such skills to my knowledge). It will contain the best knife's power as given by the ASH function get_power().
Enjoy!
 
Hey Zarqon:
In the vein of the skeleton support you added a while back I'd like to get the following added for the Video Game Boss:
Code:
   if (my_location() == $location[Video Game Level 3]) {
      string bossatt = get_property("gameProBossSpecialPower");
      switch (bossatt) {
         case "Cold immunity": mres[$element[cold]] = 1; break;
         case "Cold aura": base.pdmg[$element[cold]] += 7; break;
         case "Hot immunity": mres[$element[hot]] = 1; break;
         case "Hot aura": base.pdmg[$element[hot]] += 7; break;
         case "Ignores armor": /*This boss ignores parts of your armor*/ break;
         case "Blocks combat items": setmatt("noitems", ""); break;
         case "Reduced physical damage": mres[$element[none]] = 0.5; break;
         case "Reduced damage from spells": /*This boss takes roughly 30% less damage from spells*/ break;
         case "Stun resistance": setmatt("nostun",""); break;
         case "Elemental Reistance": foreach el in $elements[] mres[el] = 0.3; break;
         case "Passive damage": /*This boss deals some passive damage when attack with melee weapons*/ break;
      }
   }

There are unfortunately two there that I do not know the magnitude of (armor ignoring and the passive damage) and one that I'm not sure how to implement (30% less damage from spells). I'm not sure if there is a "spelldamagecap" or resistance codeword for Batfactors...
 
As requested by Crowther, add "bestknife" fvar, for use in batfactors with DB skills that use your best knife in inventory (there are three such skills to my knowledge). It will contain the best knife's power as given by the ASH function get_power().
Thanks! I've updated batfactors.txt with the formulas for those three spells. DB momentum handling was added by someone else. I left that alone and did not test it. Without momentum I'm getting very good matches now with both the mirror shard and the soap knife (3-6 and 20-40 dmg). In the end I cheated a bit with Knife in the Dark. In KoL the physical damage has a average 16.5 bonus damage which the spooky damage doesn't. In batfactors, I made physical damage and spooky damage the same, so they're both off by about 8.25.

EDIT: Hmm. I'm not sure how well my cheat works with disco momentum.
 
Last edited:
On the most recent version of KoLmafia, I'm getting this error when using WHAM, and I think it's probably coming from something that BatBrain is trying to do:

Code:
Expression syntax errors for 'modifier_eval()':
Can't understand bestknife*1.25 (zlib.ash, line 185)
You're on your own, partner.

Of the scripts that I know WHAM uses (SmartStasis & BatBrain), I could only find a reference to the string "bestknife" in BatBrain.
 
Sorry. I debated delaying updating batfactors in case people updated out of order, but if I didn't do it before I left for work this morning, I might not have had time later.
 
On the most recent version of KoLmafia, I'm getting this error when using WHAM, and I think it's probably coming from something that BatBrain is trying to do:

Code:
Expression syntax errors for 'modifier_eval()':
Can't understand bestknife*1.25 (zlib.ash, line 185)
You're on your own, partner.

Of the scripts that I know WHAM uses (SmartStasis & BatBrain), I could only find a reference to the string "bestknife" in BatBrain.

I just reverted batfactors.txt to the previous version (dated 2/11/14) using DropBox and BatBrain, WHAM, etc. are humming along happily now. I'm sure someone knowledgeable enough to fix the copy on Zarqon's server soon but until then, this is a workaround.
 
I just reverted batfactors.txt to the previousu version (dated 2/11/14) using DropBox and BatBrain, WHAM, etc. are humming along happily now. I'm sure someone knowledgeable enough to fix the copy on Zarqon's server soon but until then, this is a workaround.

You should only need to update batbrain and it shoukd work fine.
 
Aha -- it won't populate the variable for people without any knives. Fix coming in a few minutes.

EDIT: Commits are failing for me at the moment (500 Internal Server Error) so the fix might be longer in coming than stated.

EDIT EDIT: Never mind, it must have been a short-lived glitch. r31 gives us a fix for the knifeless and support for most of the Video Game Boss attributes as well.
 
Last edited:
Aha -- it won't populate the variable for people without any knives. Fix coming in a few minutes.
Ugh. I would have tested that, but all my characters had mirror shards and those are quest items, so you can't go knifeless once you get that far.
 
EDIT EDIT: Never mind, it must have been a short-lived glitch. r31 gives us a fix for the knifeless and support for most of the Video Game Boss attributes as well.

Unsupported boss attribute: Reduced damage from spells

I'm guessing this is BatBrain but could be WHAM or perhaps BB added it and now WHAM needs to learn how to use it? (In which case this is the wrong thread...)
 
I'm guessing this is BatBrain but could be WHAM or perhaps BB added it and now WHAM needs to learn how to use it? (In which case this is the wrong thread...)

I would assume a potential problem in the interaction. WHAM should probably remove the current support and also some attributes aren't spaded at all.
 
The unspaded/non-implemented attributes will print that warning so you can be aware of BatBrain's knowledge gap. It does the same for a few skeleton attributes.
 
Back
Top