BatBrain -- a central nervous system for consult scripts

I can go back to 18899 and it works perfectly fine so I don't think a corrupt file

Yeah, I wasn't suggesting *this* problem was a corrupt file, for that very reason, but I was (mis?) remembering that a similar previous problem was a corrupt file and not necessarily a Java problem.

18903 changed combat modifiers but I see no obvious check ins that would cause this.
 
I don't think I have anything to contribute to this file_to_map() discussion since it seems to go deeper than BatBrain (though I will recommend deleting batfactors.txt so it can be freshly re-downloaded), but I do have other, rather exciting news.

r121 moves SimpleSmack from the first post to the SVN. *pulls out guitar* Ahem.

Home, home in the cloud
Where the updates can freely promulgate
When Sourceforge isn't down
It's the best thing around
And the users are not annoyed all day


It also adds SimplePoke, a basic consult script for Pokefam battles! SimplePoke is basically like BatBrain for Pocket Familiars, and is used by BatMan RE to recommend your best attack in the Quick Menu, so it seemed to belong best here.

SimplePoke also works much like BatBrain, building a list of options and then looking ahead one round to determine the profitability of each action. If using it as a consult script, it simply performs your most profitable action each round until the fight is over. It has a non-trivial flaw -- it overestimates the effect of actions with a target of "random" at the moment, treating them as having a target "all" -- but my last two Pocket Familiar runs were almost entirely automated using SimplePoke and a mood script that swapped Pokefam between battles, so it's working pretty well.

If you don't like how these new files' presence enlarges your script menu, keep in mind that both of the new scripts can be moved to a subdirectory and still work just fine.

Enjoy!
 
Recently my batfactors-testing script revealed that there were so many things missing from batfactors that an unknown amount of the information disappeared off the top of the CLI. We've mostly kept abreast of monsters, skills, and items -- the important ones at least -- but familiars and especially hats/pants were quite lacking. So over the last several days I've been on a crusade to add the missing stuff in.

So r122 brings us up to speed on items, skills, hats, and pants. I added some 150 hats/pants to batfactors and removed maybe 20 or so.

"Removed?" you repeat, aghast.

"Why yes," I say, noting that your phylum is now undead. I pause to see if you will repeat that, but you don't, so I continue: I managed to make some of the handling automatic. Mafia's "Familiar Effect" string modifier contains the results for hants and pants when they are equipped on your hatrack/pantsrack, e.g. "atk, 1.5xPotato". Note that neither the attack formula nor the attack rate are included in that information, but it is sufficient information to handle the Potato aspect (we only care about attack and potatoes, since everything else happens before or after the fight). So batfactors now only contains the attack information for hats/pants, and the stun information is parsed from mafia's modifier.

I also ended up adding support for a very handy new keyword for events in batfactors: mutex. We use this to designate mutually exclusive groups of combat actions, for example all Sauceror curses now include "mutex curse". For any of these actions, happened(the action) will return true if any action in the group has already happened. We've also used this keyword for:
  • Olfaction/odor extractor
  • sixguns
  • katana skills
  • bear arms skills
  • Entangling/Shadow noodles

Are there any other mutually exclusive groups you can think of?

Some actions required special handling:
  • The caret turns your next attack into a crit, much like Throw Shield
  • Silent Knife needs to access your bestknife fvar.
  • toothpaste and golden ring now have the correct results vs. the appropriate pirate
  • The samurai turtle's star-throwing mastery is now accounted for
  • A red button costs 15% of your red buttons.
  • Mob Hit has a daily property; check it to ensure unavailability when unavailable.
  • Extract Oil checks mafia's new "snake" subtype.
  • Bear Hug can evidently convert even normally unzombifiable phyla. Also make it a custom action for now so as not to squander conversions during Zombiecore.

Next on the crusade is adding the 159 missing familiars (many of which are at least deservedly absent, and 119 of which are missing Crown of Thrones data as well).

"119?" you repeat, equally aghast. "That's the emergency number for the fire department in South Korea!"

Why, so it is. Enjoy!
 
Katana skills (and BRC skills, for that matter) are not quite mutually exclusive, in that you can use more than one in a fight if you have more than 1x of the weapon equipped.

Glancing through conditional skills on the wiki:

Tunnel upwards / downwards
Ask the hobo for a drink / something to eat
Ask the hobo to tell you a joke / dance for you
Science! intergnat skills
 
I’m not sure Olfaction and such are actually mutually exclusive: some of them just need you to not have On the Trail. I might be wrong, though.

It has recently been confirmed (on the Speed Ascension podcast by yojimbos_law) that Gallapagosian Mating Call has an effect that stacks with On the Trail, by the way, and he even spelled out the mechanics. So add that to the to-do list, I suppose.
 
Thanks all. The point of the keyword is to put groups of actions on a shared counter for purposes of checking whether they've happened, so Olfaction/extractor counts, and haiku skills can now be made to work correctly (that has never been handled quite right). Not sure what BRC stands for?

It hasn't been a big issue so far since BatBrain parses your available skills/items from KoL's dropdowns, but for queueing up actions or predicting a combat while not in combat, this will be helpful information, in addition to letting us remove yet more custom code. Yay!

Updating the attraction code is on the to-do list, yes.
 
Aha! That would be it.

All the above have been added, along with 15 more effect/equipment sources of passive/retaliation damage.
 
BatBrain treats everything as an event, right? Should you put Slime Tube item engulfing on a mutex? That can only happen once per combat, after all.
 
By the way, this sounds like a lot of straightforward tedium. Want any help? If the work is split up, it could be done in no time.

After all, not all of this require making design choices: most of these will consist of finding numbers on the wiki and converting them to a spread.
 
I’m not sure Olfaction and such are actually mutually exclusive: some of them just need you to not have On the Trail. I might be wrong, though.

It has recently been confirmed (on the Speed Ascension podcast by yojimbos_law) that Gallapagosian Mating Call has an effect that stacks with On the Trail, by the way, and he even spelled out the mechanics. So add that to the to-do list, I suppose.

Olfaction and odor extractor both provide On the Trail, so that's correct to consider them as mutually exclusive.

Aside: Most modern sources just add copies to the zone (e.g. nosy nose = +1 copy; make friends = +3 copies); Olfaction is special in that it also removes queue rejection. I think creamfaction does too, but it's been a while since I last checked.
 
According to AreaCombatData.java, Olfaction adds 3, Nosy Nose adds 1, Gallapagos adds 1, Creamstaff adds 2, Make Friends adds 3, Curse of Stench adds 3, Long Con adds 3, Offer Latte needs spading.

According to AdventureQueueDatabase.java, only Olfaction and Long Con remove queue rejection.
 
Once per combat stuff is already indicated with the "once" keyword. The new keyword is to identify groups of actions where only one can happen per fight.

And thanks for your offer to help! If you're serious about helping, we are presently missing a fair number of familiars (I haven't added a familiar myself in years I don't think) and Crown of Thrones information. The data file is publicly editable on the Map Manager. Check out the batfactors documentation (type "ashwiki batfactors" in your CLI) for how to add stuff. We only care about things that happen during combat, not before (so no barrrnacle-types) or after (no ghoul/fairly/Leprechaun types). If anything's too complicated to be handled by BatBrain's keywords, make a note using the "!!" keyword. Thanks!
 
This, BatBrain giving up after the combat ends while in a SmartStasis loop, happens occasionally and I'm not sure why:

Code:
[18079] The X-32-F Combat Training Snowman
Encounter: the X-32-F Combat Training Snowman
Round 0: Arbos wins initiative!
You acquire an effect: Bad Haircut (1)
Round 1: Arbos casts SING ALONG!
Round 2: You lose 3 hit points
Round 2: You lose 3 hit points
Round 2: You lose 3 hit points
Round 2: You lose 2 hit points
Round 2: You lose 1 hit point
Round 2: Arbos casts POCKET CRUMBS!
Round 3: X-32-F Combat Training Snowman drops 6 attack power.
Round 3: X-32-F Combat Training Snowman drops 9 defense.
You acquire an item: high-calorie sugar substitute
Round 3: Linus climbs up and sits on your shoulder, and hands you some Meat. Huh, where did he find that?
You gain 72 Meat.
Round 3: Arbos casts EXTRACT!
You acquire an item: Source essence
Round 4: You lose 3 hit points
Round 4: You lose 3 hit points
Round 4: You lose 3 hit points
Round 4: You lose 1 hit point
Round 4: You lose 1 hit point
Round 4: Arbos executes a macro!
Round 4: Arbos uses the Rain-Doh indigo cup!
Round 5: You gain 844 hit points
Round 5: Arbos uses the nasty-smelling moss and uses the spectre scepter!
Round 6: You gain 27 hit points
Round 6: X-32-F Combat Training Snowman drops 2 attack power.
Round 6: Arbos executes a macro!
Round 6: Arbos uses the spectre scepter!
Round 7: X-32-F Combat Training Snowman drops 2 attack power.
Round 7: You lose 3 hit points
Round 7: You lose 3 hit points
Round 7: You lose 3 hit points
Round 7: You lose 1 hit point
Round 7: You lose 1 hit point
Round 7: Arbos executes a macro!
Round 7: Arbos uses the spectre scepter!
Round 8: X-32-F Combat Training Snowman takes 10 damage.
Round 8: You lose 3 hit points
Round 8: You lose 3 hit points
Round 8: You lose 3 hit points
Round 8: You lose 1 hit point
Round 8: You lose 1 hit point
Round 8: Arbos executes a macro!
Round 8: Arbos uses the spectre scepter!
Round 9: X-32-F Combat Training Snowman drops 1 attack power.
Round 9: X-32-F Combat Training Snowman drops 2 defense.
Round 9: You lose 3 hit points
Round 9: You lose 2 hit points
Round 9: You lose 3 hit points
Round 9: You lose 1 hit point
Round 9: You lose 1 hit point
Round 9: Arbos executes a macro!
Round 9: Arbos uses the spectre scepter!
Round 10: You gain 5 hit points
Round 10: You lose 3 hit points
Round 10: You lose 2 hit points
Round 10: You lose 3 hit points
Round 10: You lose 1 hit point
Round 10: You lose 1 hit point
Round 10: Arbos executes a macro!
Round 10: Arbos uses the spectre scepter!
Round 11: X-32-F Combat Training Snowman drops 1 attack power.
Round 11: X-32-F Combat Training Snowman drops 1 defense.
Round 11: You lose 3 hit points
Round 11: You lose 3 hit points
Round 11: You lose 3 hit points
Round 11: You lose 1 hit point
Round 11: You lose 1 hit point
Round 11: Arbos executes a macro!
Round 11: Arbos uses the spectre scepter!
Round 12: X-32-F Combat Training Snowman drops 2 attack power.
Round 12: You lose 3 hit points
Round 12: You lose 3 hit points
Round 12: You lose 3 hit points
Round 12: You lose 1 hit point
Round 12: You lose 1 hit point
Round 12: Arbos executes a macro!
Round 12: Arbos uses the spectre scepter!
Round 13: You gain 5 hit points
Round 13: You lose 3 hit points
Round 13: You lose 3 hit points
Round 13: You lose 3 hit points
Round 13: You lose 1 hit point
Round 13: You lose 1 hit point
Round 13: Arbos executes a macro!
Round 13: Arbos uses the spectre scepter!
Round 14: X-32-F Combat Training Snowman takes 11 damage.
Round 14: You lose 3 hit points
Round 14: You lose 3 hit points
Round 14: You lose 3 hit points
Round 14: You lose 1 hit point
Round 14: You lose 1 hit point
Round 14: Arbos executes a macro!
Round 14: Arbos uses the spectre scepter!
Round 15: X-32-F Combat Training Snowman drops 2 attack power.
Round 15: You lose 3 hit points
Round 15: You lose 3 hit points
Round 15: You lose 3 hit points
Round 15: You lose 1 hit point
Round 15: You lose 1 hit point
Round 15: Arbos executes a macro!
Round 15: Arbos casts SUMMON LOVE MOSQUITO!
Round 16: X-32-F Combat Training Snowman takes 15 damage.
Round 16: You gain 15 hit points
Round 16: Arbos uses the spectre scepter!
Round 17: You lose 3 hit points
Round 17: You lose 3 hit points
Round 17: You lose 3 hit points
Round 17: You lose 1 hit point
Round 17: You lose 1 hit point
Round 17: Arbos uses the spectre scepter!
Round 18: X-32-F Combat Training Snowman drops 2 attack power.
Round 18: X-32-F Combat Training Snowman drops 1 defense.
Round 18: You lose 2 hit points
Round 18: You lose 3 hit points
Round 18: You lose 3 hit points
Round 18: You lose 1 hit point
Round 18: You lose 1 hit point
Round 18: Arbos uses the spectre scepter!
Round 19: X-32-F Combat Training Snowman takes 11 damage.
Round 19: You lose 3 hit points
Round 19: You lose 3 hit points
Round 19: You lose 3 hit points
Round 19: You lose 1 hit point
Round 19: You lose 1 hit point
Round 19: Arbos uses the spectre scepter!
Round 20: You gain 5 hit points
Round 20: You lose 3 hit points
Round 20: You lose 3 hit points
Round 20: You lose 3 hit points
Round 20: You lose 1 hit point
Round 20: You lose 1 hit point
Round 20: Arbos executes a macro!
Round 20: Arbos uses the spectre scepter!
Round 21: X-32-F Combat Training Snowman takes 24 damage.
Round 21: You lose 2 hit points
Round 21: You lose 3 hit points
Round 21: You lose 3 hit points
Round 21: You lose 1 hit point
Round 21: You lose 1 hit point
Round 21: Arbos executes a macro!
Round 21: Arbos uses the spectre scepter!
Round 22: X-32-F Combat Training Snowman takes 22 damage.
Round 22: You lose 3 hit points
Round 22: You lose 3 hit points
Round 22: You lose 3 hit points
Round 22: You lose 1 hit point
Round 22: You lose 1 hit point
Round 22: Arbos executes a macro!
Round 22: Arbos uses the spectre scepter!
Round 23: X-32-F Combat Training Snowman takes 20 damage.
Round 23: You lose 3 hit points
Round 23: You lose 3 hit points
Round 23: You lose 3 hit points
Round 23: You lose 1 hit point
Round 23: You lose 1 hit point
Round 23: Arbos executes a macro!
Round 23: Arbos uses the porquoise-handled sixgun and uses the spectre scepter!
Round 24: X-32-F Combat Training Snowman takes 43 damage.
Round 24: You gain 26 Muscularity Points
Round 24: X-32-F Combat Training Snowman takes 11 damage.
Round 24: You lose 3 hit points
Round 24: You lose 3 hit points
Round 24: You lose 3 hit points
Round 24: You lose 1 hit point
Round 24: You lose 1 hit point
Round 24: Arbos uses the porquoise-handled sixgun and uses the spectre scepter!
Round 25: X-32-F Combat Training Snowman takes 24 damage.
Round 25: Arbos wins the fight!
You acquire an item: iced plum wine
After Battle: Linus shuffles around in his snow suit, helping you find extra stuff.
After Battle: Linus sits on your fallen opponent's body, blows a smoke ring, and winks at you.
You gain 426 Meat
You gain 15 Meat.
After Battle: You gain 13 Strongness
After Battle: You gain 4 Magicalness
After Battle: You gain 6 Chutzpah
You won during stasis!
You're on your own, partner.

The last time this happened was weeks ago. Since I can't reproduce it with regularity running with higher levels of logging would be problematic.

The constant is that it seems to happen only in the Snojo. Do you have any ideas?
 
Last edited:
I've seen this occasionally for a very long time. Since combat was finished I always took it as a misleading status message "You're on your own, partner." rather than a problem.
 
Back
Top