BatBrain -- a central nervous system for consult scripts

heeheehee

Developer
Staff member
So I've seen. Anecdotally, I've been using zarqon's fight.ash override and getting beaten up occasionally since I just assumed that BatBrain actually considered the probability that I'd get beaten up (since it _does_ handle things like crits and fumbles). This would be awesomesauce, but it'd probably be a fair amount of effort.
 

Winterbay

Active member
There is a small bug with the hichance function and QWOPped up. BatBrain correctly makes the hitchance for attack 0, but for a bunch of other SC and TT skills the effect also makes them miss. I've added the following line to hitchance():
Code:
            if($ints[1003, 1004, 1005, 2003, 2005, 2015, 7096, 11001] contains to_int(aid.group(2))) through *= to_int(!(have_effect($effect[QWOPped Up] ) > 0)); //QWOPped Up make all these skill fail
which correctly makes BatBrain report that you will miss with TS, LTS, Bashing slam thingie, Shieldbutt, Kneebutt, Headbutt and Cleave.
 

zarqon

Well-known member
You should probably also add the TT combo skills to that list.

Although it's less accurate, I'm tempted to just completely filter out melee skills in build_skills() when you are QWOPped Up. It would be much less expensive in terms of script operations, and in practice, I can't imagine anyone ever wanting to spend MP to stasis when they could get the same result with "attack".

I've added Wassail and Toynado to the spell list.

@heeheehee: BatBrain does consider you getting Beaten Up as part of the cost when it evaluates the profit of actions. It's not without limitations: it only looks one round ahead, and it uses average values, and I'm beginning more and more to suspect that the formula for monster damage may have changed and actually monsters deal more damage than our formula would have us believe. It also considers the cost of Beaten Up variably, depending on whether you have means to remove Beaten Up.

Calculating probabilities based on ranges has thus far been completely outside the scope of this script. A syntax for ranges was added to the data file back when StDoodle was thinking about writing a combat script of his own and he wanted to include ranges, but also wanted to share a data file rather than having duplicated work.
 

heeheehee

Developer
Staff member
zarqon: Yes, I know it takes into account me getting beaten up. The problem I'm encountering is when the average value is enough to kill the monster, I can't take a hit, and I end up getting a low damage roll.
 

zarqon

Well-known member
BatBrain is at Revision 3!

Yes, I deleted everything and completely rewrote this script from the ground up. My memory of the script was really quite good, so I only needed to make changes twice!

No. Actually BatBrain has moved to SourceForge, as part of my gradual migration of my entire adventuring package, which means the version number has started over. It lists ZLib as a dependency, so authors including BatBrain (meaning Winterbay) need not list ZLib in their (his) dependencies.txt.

"And what, praytell, may we expect in this update, O Zarqon?" asks Shubbie J, shocking the crowd with his astute grasp ON ALL OF THEM.

Well Shubs, I'm glad you asked! First off, BatBrain now supports you!

"What?!" says Shubbie, shocked. "I support myself! I don't need handouts from nobody!"

That's not what I meant. I meant that it understands you now.

Sparks fly. "NO ONE understands me!! I am a lone wolf!" He punches something and it gets badly damaged. That something is me.

See how my (ouch) expository skills are (ouch) failing against you right now? That's what BatBrain now understands. And then I tatter away, leaving Shubbie to howl at the moon, alone and misunderstood, but not by BatBrain.

"What else is new?" asks Yog-Urt, who happens to be nearby. I immediately use another tattered scrap. No need to go through all that again. Let's go back to bulleted lists, those are way easier than dialogue:

  • Monsters with healing moves were causing kill_rounds() to erroneously cap on the low end at 2. Fix that.
  • As mentioned previously make all the changes necessary to support Yog-Urt and Shubbie J.
  • Add support for: Duskwalker syringe giving bubblin' crude, Wassail and Toynado being skills, QUOPped Up making melee skills miss.
  • Add throwing the strange goggles at The Server when the panel falls off to BatBrain's reactions, both in act() and batround().
  • Add a pile of more recent items and skills to batfactors.txt.

After that, we have a couple speed/efficiency tweaks:

  • I know we just moved stun immunity, but we're moving it again. This time to set_monster(), which will set boolean flags which we can check. This will make to_event(), which is called quite a lot, a little bit less expensive.
  • Since build_options() already sorts opts at the end with something that includes to_profit(), use the profit cache in all other sorts. This will make for thousands fewer calculations each round.

Enjoy!
 

fronobulax

Developer
Staff member
BatBrain is at Revision 3!

Because it is a concern, I am posting to let you know that I did read the referenced release notes (as a post here) and I appreciate your successful effort to make them amusing and informative. I confess, however, that the notes have pointed out to me that my grasp of some KoL mechanics is lacking.
 
Because it is a concern, I am posting to let you know that I did read the referenced release notes (as a post here) and I appreciate your successful effort to make them amusing and informative. I confess, however, that the notes have pointed out to me that my grasp of some KoL mechanics is lacking.

Can we post the SVN Checkout URL?
 

Winterbay

Active member
No. Actually BatBrain has moved to SourceForge, as part of my gradual migration of my entire adventuring package, which means the version number has started over. It lists ZLib as a dependency, so authors including BatBrain (meaning Winterbay) need not list ZLib in their (his) dependencies.txt.

I'm looking forward to when I can change the BatBrain dependency to a SmartStasis dependency instead :)
 

fxer

Member
Code:
[195726] Spooky Putty Monster
Encounter: clod hopper
Round 0: fxer wins initiative!
 > Auto-funk: merging 'use 5561' and 'use 3665'.
Round 1: fxer executes a macro!
Round 1: fxer tries to steal an item!
Round 2: Morty Goldfarb's yellow eye gazes upon a pie cooling on a windowsill. The pie doesn't vanish, but the hobo who was trying to steal it does.
You lose 1 hit point
Round 2: fxer casts POINT AT YOUR OPPONENT!
Round 3: Morty Goldfarb swings his eyestalk around and unleashes a massive ray of yellow energy, completely disintegrating your opponent.
You acquire an effect: Everything Looks Yellow (duration: 100 Adventures)

Does batbrain/smartstasis still need some updating to allow for yellow-ray delaying? i'm lvl 50 so no way a hopper poses a threat...
 

zarqon

Well-known member
I'm looking forward to when I can change the BatBrain dependency to a SmartStasis dependency instead :)

Yeah, I'm working my way up the tree. One every day or two. Might get to SS tonight, depending on what happens with my rehearsal schedule.

Yay!

@fxer: AARGH. I've tried to fix this several different ways, but evidently there's something I'm missing. I'll make a point of working this out as soon as I get to aftercore this time around. I have putty and a He-Boulder so should be able to set things up the same way you have. I'll have to be careful though because I'll only get 2 tests a day and don't want to spend a lot of time in aftercore.
 
Last edited:

Winterbay

Active member
WOuld adding this to the addopt-function make the pufferfish poison slightly more predictable for BatBrain (and thus not make WHAM kill me everytime I run into one)?
Code:
case $monster[pufferfish]: a.pdmg[$element[none]] = (round == 0 && a.stun == 0 ? 2 + 2 ** round : 0);
 

zarqon

Well-known member
That's a good idea. But let's add it to the monster event instead, that's a better place for it. r4.

Also moved the list of monsters that always hit from m_hitchance() into set_monster(). I'm trying to consolidate most of the monster attributes that might require large lists there, setting global flags which can then be efficiently and quickly checked by functions elsewhere.

Now that updates aren't an annoyance for users, I don't need to wait until I have a big batch of updates to release all at once. SVN FTW!

ETA: r5 starts to address the recent flurry of Candyblast reports by letting BatBrain know the candy drop rate is only 33%, not 100%.
 
Last edited:

Bale

Minion
That was the previous flurry.

We are too polite to keep hammering zarqon for over a year about a bug for which he's already acknowledged its existence. Hence the lull until a new generation of users discovered the issue. I believe that this is actually the third flurry of Candyblast reports.

Let's just drop the topic now. It's a little mean and I'm actually really happy that zarqon has written in a crude hack to deal with the problem until he finds an emotionally satisfying solution.
 
Last edited:

Crowther

Active member
If I could have found an emotionally satisfying solution, I would have at least suggested it. I wasn't teasing about the dried face. For some reason, it always made me smile. It had to be something that would autosell for 7 meat. The only other choices were turtle stuff.
 

zarqon

Well-known member

There has been a recent flurry, which the update addressed. The one you linked to wasn't recent, but then it wasn't really a flurry either. When nitpicking, one must consider all words together. :)

@Crowther: Since BatBrain now multiplies the item profit by 0.33, a new item may be needed for a hack other than the dried face, haha. Maybe you can find something equally smile-worthy.
 
Top