BatBrain -- a central nervous system for consult scripts

zarqon

Well-known member
r15 Update

As discussed in the WHAM thread, BatBrain's weapon damage calculations were off. Fixed those, to the best of our knowledge. This is an important fix that ought to help BatBrain's accuracy with regard to some of the most-used attacks.

Also, a small tweak that just may help fxer (I haven't forgotten you!), though I rather doubt it. Regardless, it's a useful change: when building skills, perform our "once" check after the big skill switch, where skills are sometimes flagged with once.
 

Crowther

Active member
I added monster healing for Mer-kin Outpost monsters. I assumed a 50% rate at 250 HP, for an average of +125 HP/round, capped at the monsters' max HP. That ought to help your script to choose actions which will actually kill the monsters before the combat runs out.
When stunned these monsters don't heal. WHAM didn't know this, so dropped out of a easily winnable fight. My workaround was to increase my MP. It's really nice to see WHAM winning these fights now.

If WHAM knew stunning prevented healing it might be "more optimal". ;)
 

Theraze

Active member
If this is actually a WHAM request, should probably post it there. If the request is that BatBrain be aware of reduced healing, then you probably shouldn't mention WHAM. :)
 

Crowther

Active member
If this is actually a WHAM request, should probably post it there. If the request is that BatBrain be aware of reduced healing, then you probably shouldn't mention WHAM. :)
I don't think it's a WHAM request. I quote the BatBrain change I'm talking about. Why shouldn't I mention the one script that uses the BatBrain feature I'm talking about? Is that because of the way stunning works?

EDIT: It's also not really a request. More like a helpful suggestion. I'm just about done with the sea, so I won't benefit much from this. And my workaround works well enough for my needs.
 
Last edited:

zarqon

Well-known member
Okay, r16. I've altered the healing to be factored by the monster's current stunned-ness. This still won't be strictly accurate in relay play, as neither BatBrain nor myself know a good way to track previously-performed stuns. But for predictive play in WHAM or other BatBrain-powered scripts, it ought to do the trick.

Anyone have any info about the question I asked earlier? What is the Mer-kin to-hit mechanic? It's obviously different from other monsters, and I suspect it's the same mechanic as Clancy.
 

evilspoons

Member
Recently I decided to start doing "boring" 100% familiar runs. And what could be more boring than starting with familiar #1, the trusty Mosquito?

Doing that, I found out that WHAM would always abort with an error:



I eventually traced this back to the famevent() function in BatBrain passing "-dmg" to zlib's eval() function. After that, it was easy to locate the offending "-dmg" in the Mosquito section of batfactors.txt

I have not dug deeper than that, and just replaced that -dmg with a 0, which made it work again (probably ignoring the huge contribution my mosquito makes to killing the monster). I have found similar "-dmg" lines for the Adorable Seal Larva and the Robot Reindeer.

Any ideas where to go from here? Is there anything better than "0" that we can put into those fields?

The message quoted above is from May and the problem was apparently solved in v 1.36 (pre-SVN). I am running the newest SVN version and I seem to be having this same issue now that I've started using the Adorable Seal Larva (mosquito-type familiar). I get the following when trying to run WHAM:

Code:
[1052] The Poop Deck
Encounter: wacky pirate
Round 0: midnight13eyes     loses initiative!
You lose 31 hit points
Expression     syntax errors for 'modifier_eval()':
Can't understand dmg (zlib.ash,     line 162)
You're on your own, partner.

Strange that this is happening again after it was supposedly fixed... or do I somehow have an old file still kicking around I need to get rid of? I deleted batfactors.txt and let it obtain a new one, and the problem persisted, so I simply replaced "-dmg" with "0" to get it working again for now.
 
Last edited:

fronobulax

Developer
Staff member
I discovered this recently but blamed it on WHAM so there is some discussion there. I think the answer is can't fix but I remember things that did not happen so it is probably worth looking through the thread to confirm.
 

zarqon

Well-known member
It's not fixed for some people, evidently, but the cause is unknown to me. Current status is "can't duplicate" -- I am able to use those familiars without error.

The obvious difference between my setup and the reported errors is WHAM, but I haven't had time to dive into WHAM yet so don't know if there is in fact an OOP error there, or if my script simply avoids exposing an error in BatBrain.
 
I've been adventuring a bit in the Dreadsylvanian Village, and so far what I've noticed is all the ghosts only take 1 damage from PM or SA spells.

If you use hobo spells though, those damage the ghosts normally. They are elementally based though, so you have to pick a spell that'll damage them well (instead of doing 1 point).

I don't even see the monster names on the wiki yet...maybe I should run another ascension and let others spade more? :D
 
Last edited:

Bale

Minion
I've had no problem harming ghosts with saucegeyser. YOu just need to do elemental damage. Like with any other physically immune ghost in the game.
 

Crowther

Active member
I've been adventuring a bit in the Dreadsylvanian Village, and so far what I've noticed is all the ghosts only take 1 damage from PM or SA spells.

If you use hobo spells though, those damage the ghosts normally. They are elementally based though, so you have to pick a spell that'll damage them well (instead of doing 1 point).

I don't even see the monster names on the wiki yet...maybe I should run another ascension and let others spade more? :D
As Bale said, they're just normal ghosts. When that information is added to KoL's monsters.txt file, then these scripts should handle them just fine.
 
EDIT:

I think I figured out what was going on...I didn't notice that I had the fire extinguisher equipped, so this was overriding immaculate seasoning with Saucegeyser, so some of the monsters looked like elemental spells were not working on them.

:facepalm:

Saucegeyser FTW now! :D
 
Last edited:

zarqon

Well-known member
Adding support for the Colosseum is mostly finished -- but things are going more slowly than anticipated since at the moment I'm on vacation in Thailand and I somehow keep finding other things to do. :) Today I fell down a waterfall, but fortunately both I and my then-pocketed phone are OK, despite a few scrapes and submersion. Had to buy dry clothes before I could continue Adventuring, though!

Anyway, the autoresponses are tested working fine, however they require further tweaking, since a) there are a few cases I didn't test and 2) the usual approach doesn't completely work here. This is the first case where we've definitely needed to react to the reactions -- possibly with the same reaction again (can BALLS subroutines recurse?). Secondly, happenings tracking does need to be tweaked for these skills, since if you use them not as a response to a special attack, they are then unavailable for the rest of the combat, even for autoresponding with. Checking happened() is therefore presently meaningless for these skills when facing Colosseum monsters.

I've completed this run, however, so in the interest of sooner than later will probably release this better-than-nothing support until I can make the fixes required for a perfect solution. If you have all three skills and don't use any of them as regular attacks, it works, although for chains of autoresponses it only autoresponds to the first one, and then executes a series of act() use_skill() calls for the remaining responses (due to reason 2), which is inelegant and hits the server more than necessary. All the batround() autoresponse code duplication in act() is meant as not only insurance for macro failure such as this, but also because no macro is called on the starting page text.

I've also not tested what happens if you don't have all the skills (reason a), nor did I attempt complete automation of a combat (in which I strongly suspect BatBrain will recommend one of the skills as your attack action, which would make the skill unavailable for further responses). These skills should probably be temp-blacklisted when fighting Colosseum monsters.
 

roippi

Developer
Zarqon must be the protagonist, as it's scientifically proven that only villains are seriously harmed by jumping down waterfalls.
 

zarqon

Well-known member
BatBrain simply checks ASH's mp_cost(), so evidently mafia doesn't know what Super Skill does. Make a bug report!

I'm entering the Sea again today with the goal of refining the autoresponses. Might not make it there till tomorrow, we'll see.
 
Top