BatBrain -- a central nervous system for consult scripts

Something is wrong with the formula in this line:
Code:
fam     102     Imitation Crab  {2+5*famgear,max(2,fweight/2-max(0,(fweight-(20+20*famgear)))*zone(sea))+5*famgear,fweight-max(0,(fweight(20+20*famgear)))*zone(sea)+5*famgear}        0       rate 1
I don't see anything wrong, but WHAM aborts (zlib evaluation error) whenever I have an Imitation Crab (via wardrobe).

In a maybe related and similar issue, I have never had BatBrain successfully handle Frigidalmatian.

Expression syntax errors for 'modifier_eval()':
Can't understand buffedmys)+spelldmg+elembonus)
Expected ), found
Expected ), found (zlib.ash, line 188)


Edit:
The current line for Frigidalmatian is this:
Code:
effect	1038	Frigidalmatian	spelldmgpercent*(40+(0.35*buffedmys)+spelldmg+elembonus) cold	0

plugging in some numbers solves the problem:
Code:
effect	1038	Frigidalmatian	spelldmgpercent*(40+(0.35*222)+44+11) cold	0
 
Last edited:
If those are really being passed to modifier_eval() complete with variables, I am not at all surprised that they fail; those are not valid tokens in the modifier expression language. Looking at zlib's eval() function, it looks like it replaces "user defined variables" with their values. It gets the names of the variables using this pattern: "\\b[a-z_][a-zA-Z0-9_]*\\b". Since "\b" is a "word boundary", I see nothing wrong with that string - unless the passed-in map of variables does not include "buffedmys", etc.
 
I also see nothing wrong with that string. Especially since it is nearly the same as Sauce Geyser (which works with no errors):
Code:
skill	4012	Saucegeyser	spelldmgpercent*(65+(0.4*buffedmys)+spelldmg+elembonus) sauce	-min(1,effect(54))*1.12*mpcost	aoe 3, mp max(1,min(1,effect(55))*0.29*mpcost)

Mysterious...
 
Apparently your Frigidalmation isn't properly converting buffedmys into an int, as you discovered. As long as it has run build_options, that shouldn't be the case, but... maybe effects are different than skills? Since Frigidalmation is an effect and Saucegeyser is a skill...
 
Try reducing that range to just the average. Without actually having poked into it yet, I'm guessing it's due to something like BatBrain's range reduction matcher not accounting for commas in formulas.
Yes, I believe that is the issue. Just using the average worked.

EDIT: I did a quick search (regex) and there are no other lines that have extra commas in a range.
 
Last edited:
r76 Update: fvars, fvars, fvars

So it turns out that bunches of extra things have been added to modifier_eval() since the last time the Wiki for that function was updated. Some of them mean we can delete some of our fvars (which is good because those fvars get foreached on each formula evaluated). This update removes somewhere around five of them. If my feature request gets implemented, I'll be able to remove a good bit more of them by using the skill() text function instead of fvars. (NOTE: If you get expression syntax errors after updating, make sure your batfactors is current.)

Also, the Frigidalmation problem is an order of operations error. We set those spell damage related fvars in build_skillz(), which happens well after we load the environmental events, such as ongoing effects and equipment. To combat this problem, I've consolidated a lot of the fvars-setting code into a single function, set_fvars(). This doesn't completely solve the Frigidalmation problem yet, but it's a step in the right direction (you'll note that fewer of the keywords are unsubstituted).

Also removed the redundant support for "ghostly", fixed "cloned" (it doesn't double groups), and fixed "untouchable" as per Crowther's report.

Enjoy!
 
Wow. I just love all the simplification that's been happening!

OCRS is a tough environment for WHAM/BatBrain, but given that it's working impressively well. Now that untouchables are handled, it seems to me that the elemental auras aren't quite right. I think I remember those being a problem with hobos too.
 
Today I had off work due to the panic in Korea about MERS. Yay viruses!

I'm taking the time to go over all the classes with a fine-toothed comb and make sure BatBrain supports the class revamps correctly. (The comb is purely cosmetic, mind.) Have made quite a few tweaks and changes (especially to batfactors), and in the process several questions came up:

  • Do spells passing through saucespheres no longer return HP/MP? I see references on the Wiki to this being a thing that used to happen.

  • Do Surge of Icing and Kasesosesturm benefit from Intrinsic Spiciness?

  • Does Soul Blaze benefit from bonus (generic or elemental) spell damage, and spell damage percent? Does it count for finishing off a monster with a spell when you've cast a Curse of either Marinara or Weaksauce as a Sauceror? It's not described as a "Combat Spell" in its description.

  • Is the Mysticality bonus to Hobopolis spells no longer capped? The Wiki again gives conflicting information on this.

  • Also, am I missing something or is mafia missing the fact that Fury grants bonus weapon damage? As a SC with 5 Fury, when I "modtrace Weapon Damage", I see a variety of sources, but no Fury. Without Seething of the Snow Leopard, I see nothing. With Seething, I see +10. So mafia is granting the bonus from the bonus to the bonus, but not the bonus itself. Is this bug-report-worthy?

@Crowther: I have still never seen any spading on hobo auras. I think the current numbers seem to be pretty accurate though. In which direction do the OCRS auras seem to be off? I'd be happy to bump them in a direction towards accuracy even before the exact number is known.
 
Do spells passing through saucespheres no longer return HP/MP? I see references on the Wiki to this being a thing that used to happen.
That is just a memory. The new method of Sauceror MP regen is much easier so I do not miss it at all. When a Sauceror kills a monster with a spell (including a Pastamancer or Hobopolis spell) while Curse of Weaksauce is active, it grants MP equal to 30% of the damage, capped at 50 MP. This only counts for the killing shot and multiple hits from a single spell only count the last hit

Does Soul Blaze benefit from bonus (generic or elemental) spell damage, and spell damage percent? Does it count for finishing off a monster with a spell when you've cast a Curse of either Marinara or Weaksauce as a Sauceror?

I know it returns MP/HP from breaking curses, but I don't know about the rest of that.

Is the Mysticality bonus to Hobopolis spells no longer capped?

No cap of any sort.

I don't know the answers to your other questions.
 
Also, am I missing something or is mafia missing the fact that Fury grants bonus weapon damage? As a SC with 5 Fury, when I "modtrace Weapon Damage", I see a variety of sources, but no Fury. Without Seething of the Snow Leopard, I see nothing. With Seething, I see +10. So mafia is granting the bonus from the bonus to the bonus, but not the bonus itself. Is this bug-report-worthy?

Mafia includes it in Wrath of the Wolverine (the skill needed to have any Fury in the first place).
 
I am about 60% sure soul blaze benefits from all bonus spell damage, as a hot spell. Not in position to test it, though.

Also maybe of note for breaking curses: a hit from stuffed mortar shell happens last in round, so it probably is what counts for the curses too (it's what counts when overkilling hobos, iirc).
 
Maybe it is just me, but what I think is the latest version of BatFactors is throwing errors in zLib. The problem seems to be with skills that use wpnpower. The obvious whitespace issues did not seem to be the cause but since I am out of turns...
 
Shell -> weaksauce works for weaksauce MP.

I am about 60% sure soul blaze benefits from all bonus spell damage, as a hot spell. Not in position to test it, though.

CRITICAL HIT! You build a pyre of Soulsauce around your foe and set it alight. It writhes in agony, suffering 13378 damage.
2x damage from crit, 2x for alignment (vs spooky monster), 1181 buffed mys, +110% spell damage, +180 hot spell damage, +0 general spell damage. 10 ML, so 4% damage resistance.

Expected base range: 1481-1581 * 8.4 is about 12440 - 13280. Bonus from hot spell damage is 180 * 4.2 (spell crit doesn't apply to bonus spell damage) = 756, so the expected range with hot spell damage as well should be 13196-14036. ML resistance drags that range to about 12668-13474.

Looks like both +hot spell damage and +% spell damage apply. Generic spell damage should also apply, but I haven't explicitly tested that.
 
Well, that's all my questions answered save one. Good enough to spin us some r77. The improvements are manifold. MANIFOLD I TELL YOU.

Let's start with more removed fvars:

  • Cold Shoulder, Weasel, and Intrinsic Spiciness are now in-formula for all skills they enhance, eliminating the need for those fvars (or special handling in the case of Spiciness). Should we find that Spiciness affects non-guild Sauceror skills, it's now a batfactorsable fix.
  • Club Foot's variable stun is handled entirely in the formula! Quite something since that's a bit complicated.
  • Opening the Bag of Tricks can directly access the tracking preference instead of using an fvar.
  • Intimidating Bellow checks Louder Bellows in the formula, eliminating still another fvar.
  • Flying Fire Fist got messed up with the elimination of its fvar -- the special handling to determine its cost was still checking the fvar. I have a multi that kept using FFF, which confused me as he's a fully skilled Fist and the other skills ought to have been cheaper. Fixed that.
  • Bring Up the Rear now correctly supported in formulas, making "bringuprear" the shortest-lived fvar yet.
Each of these removed fvars is a small but meaningful triumph, as they are one less string searched per formula evaluated.

As I was scouring the class skills (made it through three of them, went down the list and confirmed each skill one by one), I found that BatBrain's support was outdated or missing in a number of other areas:

  • Added support for Audacity of the Otter increasing your critical multiplier.
  • Soul Funk gives some passive damage.
  • So does the Hand in Glove, for that matter. And we can even add this one without an fvar! Thanks, "K".
  • Soul Blaze is now treated as a spell (despite not being labeled as such) and benefits from various types of spell bonus damage. This is my one remaining question with Soul Blaze: As it's not labeled a spell, does it succeed or fail versus spell-resistant monsters?
  • Spells no longer return HP/MP through saucespheres.
  • Thanks to "mainhand(whip)" being usable in the formula, we can eliminate the special handling in-script for the Dandy Lion.
  • Frigidalmation should now work correctly.
  • Splattersmash uses the real formula instead of the placeholder formula.
  • Harpoon is an aoe skill.
  • Clobber is now half-formula, half-script, and is no longer "regular". It never belonged there, really.
  • Verified and corrected all spell damage formulas against the Wiki. Many were outdated (particulary PM spells, which were still all the old formulas).
  • Nearly complete support for all Sauceror Curses (sans knowledge of ongoing effects, but including finishing spells restoring HP/MP).
  • Cone of Zydeco is aoe 5.
  • Fix Fire Rocket.
  • Utensil Twist support improved: now calculate weapon damage properly, plus include support for twisting Dinsey's pizza cutter.
MANIFOLD.

Enjoy, my friends!
 
Last edited:
@Crowther: I have still never seen any spading on hobo auras. I think the current numbers seem to be pretty accurate though. In which direction do the OCRS auras seem to be off? I'd be happy to bump them in a direction towards accuracy even before the exact number is known.
I haven't taken the time to look closely, but since I'm getting beaten up by them I believe BatBrain's estimate is too low.
 
The talk page http://kol.coldfront.net/thekolwiki/index.php/Talk:X_Bottles_of_Beer_on_a_Golem says that Soul Blaze does not count as a spell for blocking. Curses don't seem to count, either.

Also, Utensil Twist has a higher myst scaling with Hand that Rocks the Ladle (20%, as I reported earlier).

edit: half the auras seem to be using 0.1, not 0.2
case "foul-mouthed": setmatt("aura",to_string(my_maxhp()*0.1)+" sleaze"); break;
case "haunted": setmatt("aura",to_string(my_maxhp()*0.1)+" spooky"); break;
case "hot": setmatt("aura",to_string(my_maxhp()*0.1)+" hot"); break;
case "wet": setmatt("aura",to_string(my_maxhp()*0.1)+" cold"); break;
 
More questions I apparently missed:

+10, +20% spell damage, 76676 buffed mys, 10 ML:
You conjure up a refreshing cup of wassail and hand it to your opponents. They throw the cup to the ground and stomp on it, suffering 8,861 damage in the process.
You dance while a zombie punches your opponent in the face for 30968 damage.

Looks uncapped to me.

1 mys, +10, +100% spell damage:
You summon a storm of pungent cheese sauce, drenching her for 112 damage.
Other samples: 116, 120.

I thought I worked out the damage range on that to be 35-40 plus 0.3*mys, but I could be mistaken. With that range, it looks like Intrinsic Spiciness is applied.

Dunno about surge of icing.
 
I came here to say that auras are .2 instead of .1 only to find hee^3 had done that two hours ago.

EDIT: I updated my own copy and now I'm no longer losing fights. It was interesting to see WHAM stasis an electrified monster trading HP for MP.
 
Last edited:
Yes when I added them the Wiki had different wording on some of the auras, implying that there were two levels of aura. Making them all 0.2 seems like a much more reasonable way of handling it.

r78
 
Back
Top