NAME

TAEB::AI::Demo - a demonstration autonomous AI

DESCRIPTION

This exists so we include have something that *plays* NetHack in the core TAEB distro: a default AI. We could use TAEB::AI::Behavioral but that is a separate distribution, one that depends on TAEB at that.

This is also an example AI for people interested in writing one.

EXERCISES

If you're interested in bot development, here are some recommended enhancements to make to this demonstration AI. You can use these exercises to get accustomed to the TAEB codebase.

If you get stuck, one place to look is TAEB::AI::Behavioral, where we've implemented all of these behaviors.

  • Have the bot write Elbereth if its HP is less than 50%.

  • When there's an adjacent Elbereth-ignoring monster, don't write Elbereth (so that you fall through to melee).

  • Design a sane policy for writing Elbereth and meleeing monsters when there are both Elbereth-respecters and Elbereth-ignorers.

    Implement this policy.

  • Pick up food (but not corpses). Is "is_safely_edible" in TAEB::Role::Item::Food::Corpse sufficient to determine which food to pick up?

  • Eat food from inventory before resorting to prayer.

    Be sure to support eating inventory food while standing on a tile with food (recall that NetHack asks you if you want to eat that floor food).

  • Dip for Excalibur when appropriate.

  • If you have projectiles, throw them at enemies.

  • Retrieve projectiles you've thrown.

  • Pick up and wear armor.