BatBrain -- a central nervous system for consult scripts

broctopus
> This monster is stun immune! That information should be added to batfactors.

I'll test on another broctopus when I go party yacht diving tomorrow.
 
Personally I'm happy to have BatBrain use whatever it can while I'm automating. To the extent that I'd happily have it use lightning to give me -1 turncount randomly rather than have me ignore it because I'm automating the entire day, when otherwise it would just sit at full.

One option though would be to have 3 user-configurable values for how much rain/lightning/thunder to keep safe... just set Rain to 100, and it will never mess up your Rain Man chances. Or if you want BatBrain to suggest making it rain during the nun quest, set it lower.
Set Lightning to 100 if you want to control it manually, 0 if you want it fully automated, 20 if you want it to always keep enough for one strike, etc.

I think this would allow for users to choose how much automation they want to allow, while still enabling those who want to think about things a bit less to actually have BatBrain make decisions for them. :)
 
I am slightly suspicious that your lantern code didn't work because the variable d was still empty. That said, the code I added was basically functionally identical, and I haven't tested it, so I would appreciate feedback that it works. I also suspect that it will be overestimating its bonus damage, since there is wording on the Wiki about bonus elemental damage not being included.

I actually put it right above the call to addopt(). I suspect the actual problem was that I was testing it wrong.

Anyway, it is now giving the correct damage for ravioli shuriken and canelloni canon so I think it passes. I cannot test stuffed mortar shell because even with +200 ML, the green lantern does enough bonus damage to completely kill anything I encounter and BatBrain doesn't report damage above monster HP.


As for the pliers, there are a few edge cases I'd like to check to determine whether I've placed the code in the correct spot:

I don't know about your edge cases, but I do know that it works for all physical attacks, like thrust smack and headbutt. Unless I misunderstand, you have situated it so that it only works for default attack without using any skill.


One option though would be to have 3 user-configurable values for how much rain/lightning/thunder to keep safe... just set Rain to 100, and it will never mess up your Rain Man chances. Or if you want BatBrain to suggest making it rain during the nun quest, set it lower.
Set Lightning to 100 if you want to control it manually, 0 if you want it fully automated, 20 if you want it to always keep enough for one strike, etc.

Brilliant. I'd probably set mine at 40/94/70. that leaves enough for 1 thunderclap and 3 lightning strikes. I can't hate it for using a few lightning strikes on my behalf since I wouldn't want to accidently lose out on some of my lightning regeneration. The odd number for lightning is because if my lightning gets to 90 or above I'd want it to use a lightning strike since the next lightning regen will cause it to go over 100.

zarqon, Warning about lightning strike. It doesn't work on non-copyable monsters.
 
Last edited:
Gurgle could probably use a "nospells" flag in batbrain.txt. While that's not entirely accurate, since spell reflect damage back onto the attacker, it may as well be "nospells".
 
You're probably better off using the new modifier added in 14552.

Quite! I have simply replaced the previous check for Song of Battle with a check for that modifier, solving all of our problems (including its functioning with skills, thanks for pointing that out Bale). A bit afraid that pushing this update will cause false bug reports though, since boolean_modifier("nonexistentmodifier") quietly returns false.

One option though would be to have 3 user-configurable values

I also like this idea, but doesn't help with the original question of assessing the value of T/R/L. For someone who sets Thunder to 40, is the first 60 of it free? Just about every combat will use Thunderstrike then, even when it barely saves any HP. We still need a cost associated with using these skills.

it is now giving the correct damage for ravioli shuriken and canelloni canon so I think it passes.

Splendid. Thanks for the swift feedback.

Warning about lightning strike. It doesn't work on non-copyable monsters.

It won't work on any monsters, since I've flagged it (like most instakillers) as a custom action to prevent it from being spammed. If we can agree on logic for SS casting this spell though, it could be part of SS.

Gurgle could probably use a "nospells" flag in batbrain.txt. While that's not entirely accurate, since spell reflect damage back onto the attacker, it may as well be "nospells".

I'd rather we code in the player damage. There may be scenarios in which damaging yourself is the only way you can win, and adding "nospells" would make that path to victory unknowable. Any idea what we should use though? Is it roughly your exact spell damage reflected back? Half of it?
 
Quite! I have simply replaced the previous check for Song of Battle with a check for that modifier, solving all of our problems (including its functioning with skills, thanks for pointing that out Bale). A bit afraid that pushing this update will cause false bug reports though, since boolean_modifier("nonexistentmodifier") quietly returns false.

Veracity will probably be spinning a new point release before the end of the week. You could wait until then. Oh, and it was lost who pointed out that new modifier. :)
 
Any idea what we should use though? Is it roughly your exact spell damage reflected back? Half of it?
Speaking from experience (thanks for the OHKO Jick!), it's the damage you would inflict as normal which is reduced by elemental resistance. Gurgle's damage caps are not factored in to damage.
 
I'd rather we code in the player damage. There may be scenarios in which damaging yourself is the only way you can win, and adding "nospells" would make that path to victory unknowable. Any idea what we should use though? Is it roughly your exact spell damage reflected back? Half of it?
I was worried you would say this, which is why I didn't add it to batfactors myself. While I can't imagine a scenario where you'd want to use spells on Gurgle, I agree it's better to let BatBrain decide that. You never know what will be added to the game later.
 
zarqon, I'm not sure how you will value thunder, but here is a little wrinkle. If you decide to support thunder skills, Thunderstrike is different from all other stunning skills as it can be used effectively at up to +150ML.

At +150ML Thunderstrike stuns the monster perfectly. It fails at +151 ML.
 
One thing about valuation is that anything that will be lost should be considered free, or at least should discount the rest of the valuation. For example, if you're at 90 thunder, and you have the +50 regen, 40 units of thunder should be considered free, unless you've set it to save more than 90 thunder, in which case however much is left (if any) should be considered free. :)

No sense in skipping a free delevel/stasis if it will give your familiar a turn to act and it's better than using a seal tooth...

Mostly goes for thunder, but if the user has the pliers equipped, might go for lightning as well. Nothing to speed up rain, right?
 
Noticed when using Saucestorm and a green lantern that it'll report something like 100 hot, 100 cold, and 100 stench. It should be 200 stench. The lantern applies to each strike separately.
 
Oh. Yeah. That is tricky. BatBrain doesn't differentiate between attacks that do multiple elements and attacks that actually do multiple attacks.

If Saucestorm actually did 100 (+100) this would have worked perfectly. :(
 
r44 Update!

  • Gurgle reflects spells, coded as 1:1 ratio (pre-resistances).
  • Check for Attacks Can't Miss modifier now replaces all the checks for things that now have that modifier.
  • A little code to support BatMan RE's upcoming awesome factoid tracker! Adds factoids gained to data file when possible so the tracker doesn't have to refresh data, otherwise sets a flag to force a refresh.

That lantern damage issue is quite tricky. I'll add it to the list of "things so difficult that they'll get done on a day when I'm particularly determined."

Oh, and it was lost who pointed out that new modifier. :)

Yep, but I was thanking you for pointing out it also applied to skills, not just Attack with Weapon.
 
So I used the holo-tank, holo-bomber, and holo-platoon as a Sauceror at level 24 with 535 mainstat. They each did 6250 damage (or 5000 before the Deft Hands bonus).
 
r45 brings us a very important bugfix for stasising with an enthroned or bjornified familiar. When I added Buddy Bjorn support, I converted mentions of "throne" or "enthroned" to use "companion" instead, but I missed one. And the one I missed was causing SS to continue stasising even after the familiar's item dropped (as I noted while farming BRICKO bricks with a bjornified chick recently). Those of you using SS with familiars in your slots will no doubt be quite relieved.

It also brings us the final implementation of BatBrain's integration with Factroid!

"What is Factroid?" you ask. Or, rather, I ask while posing as you. "Well," I reply to myself under the pretense of replying to you, "it's BatMan RE's new relay factoid tracker!" You guys, it's so awesome and I highly recommend it for all your factoid needs. I'm about to go make the update right now.
 
I am just now trying to explore and understand this fantastic script. But I am failing, and I do not know why.
Writing a fight.ash relay script, I have this:

PHP:
import <BatBrain.ash>;

void battry() {
	print("Attack: "+dmg_dealt(get_action("attack").dmg),"orange");
}

void main() {
	battry();
}

And that gives:
Attack: 0.0
every round. What am I doing wrong here? Because my attacks are doing more than 0 damage.
 
From initial glance, you aren't actually initializing your BatBrain to do anything. By looking at BatMan_RE, I'm assuming what you need to start your main() function with is something like this:
Code:
   string[string] post = form_fields();
   act(post["page"]);
 
From the first post it seems that you're missing a step:

Code:
import <BatBrain.ash>

void main(int initround, monster foe, string pg) {
   act(pg);
  // now you can smack down the monster with BatBrain-powered gusto!
}
 
Ahh, of course. I have to call act() with the current page to get it it initialize all the BatBrain stuff. Thanks. This is a start.

Now, this works:
Attack: 27.37063745602694

However, my attacks are not doing ~27 damage. More like 50 (48, 43, 53, 56, 63, 53...)

Am I missing something else here?
 
Last edited:
Back
Top