Tales of Maj'Eyal

Tales of Maj'Eyal

Not enough ratings
Player AI
File Size
0.066 MB
Sep 23, 2015 @ 6:48pm
Oct 16, 2015 @ 11:41am
5 Change Notes ( view )

Subscribe to download
Player AI

TOME FORUM LINK: http://forums.te4.org/viewtopic.php?f=50&t=45000

This addon adds a keybind to activate the new player AI. Set to Alt+F1 by default.
It will clear an entire floor or stop when it hits 1/4 health in the presence of enemies.
This AI has undefined behavior in the Sandworm Lair, use it there at your own risk.

COMPATIBILITY WARNING: This addon superwrites Player:act(). If another addon also touches Player:act() change the load order so that the Player AI addon loads *last*.

  • Rests!
  • Autoexplores!
    • Uses autoexploration from ToME core
  • Uses talents!
    • No exceptions yet for talents like Meditation or Phase Door to use them intelligently
    • Chooses talents at random
  • Attacks enemies!
  • MAJOR: Any skill which causes a menu to be opened (like Command Staff) will crash the game when used by the AI.
  • Sometimes the AI will start bouncing between the entrance and exit of a level. If it does, hold in ESC and it'll stop once it hits an endpoint.
  • The AI still has trouble understanding water. It doesn't know about waterbreathing, and it doesn't recognize "bubbles" as air. So it's going to complain about suffocation constantly while it's underwater, but paradoxically seems to always move in the intelligent direction while doing so.
  • The AI assumes it is safe when attacked from unseen enemies, including when it is blinded in combat
  • The AI sometimes falls through to its "wait a turn" case when it doesn't seem necessary

  • Updated the cast tracking system to check if a talent has failed
    • If a talent fails, the AI will not try to use that talent again that turn
  • Fixed a bug with "waiting" where the AI called the wrong function to wait and ended up hanging.

Stuff I'm Working On (NOTE: Development suspended, see below):
  • A "hunting"/"fleeing" AI state(s) to react to damage taken while out of combat
  • Configuration settings for various talent uses, the low-health exit threshhold, etc.
  • Stopping the AI when in sight of a Boss.

So I could beat around the bush and say I'm on "indefinite hiatus" but let's be real I am probably never going to develop this mod ever again. If you want to tweak it, there's a link to the github with the mod code if you clickthrough to the forum page at the top.
< >
Charidan  [author] Oct 28, 2017 @ 2:40pm 
You're welcome!

Wanting to speed through the early game is pretty much why I made it. I kept noticing myself essentially just holding in arrow keys and I would say "you know, I could just write a script to do this", and eventually I said it enough times that I just... wrote the script. Good to hear it's useful for other people too.
Tarsis Oct 28, 2017 @ 6:27am 
I still love this mod. Either speeding through the early game I've been through dozens of times for "serious" plays, other times building a character around what I think the AI will do best with just to see how far it can go.

It has brought me much entertainment. Thank you.
Charidan  [author] Mar 24, 2017 @ 2:14pm 
Thanks for the tip, I'll check it out.

I've seen a few "configuration menus" but they've mostly been smallish things where you click on a field and input a single value; really clunky to work with on a large scale and impossible to just see all the values. I'm ambitiously going for something more like the main game's settings panel with two-column format.
Yusu Mar 24, 2017 @ 4:16am 
Actually, codefly has made mutliple mods with configuration menus. (Turn Seperator, Improved Combat Text, Streamlined Early Game)
Charidan  [author] Mar 23, 2017 @ 7:51pm 
The next major change is going to be configuration options, but I haven't worked out how to get a menu to work (and I haven't been actively investigating). I don't think anyone has bothered making a fully featured options menu, and i'm not sure there directly exists support for one. I think I'm going to have to dig into the core game and steal the menu code manually, so I keep putting it off. Which is why there's been 6 months with no word from me. Sometimes I tell myself I'll actually work on this mod again but I don't always believe myself.
Yusu Mar 22, 2017 @ 3:23pm 
For example, I would love the AI to stop not only on sight of bosses, but also rares and everything above.
Yusu Mar 22, 2017 @ 3:22pm 
I would love to see work on this guide continiued, as it potentially improves the early game by a LOT :) Unfortunately, you die way too often on higher difficulties with this and disabling the AI is WAY too unresponsive to help against that.
Charidan  [author] Jul 11, 2016 @ 9:54am 
Stopping when in sight of bosses is a good idea. I also need to add a fix someday so that it breaks when taking damage with no enemies in sight, to prevent the "being attacked by an unseen enemy" death spiral. This will have the irritating side effect of breaking when poisoned though, so maybe there is a better fix for that.

I still don't have any time scheduled for developing this mod, but these tantalizingly realizable fixes have tempted me.
Turambar Jul 11, 2016 @ 8:56am 
And I found another bug: my character began to rest in sight of an immovable ranged enemy, so he would rest/lose life/rest/lose life/... The only way to stop it was right click on a tile, then "move to"
Turambar Jul 11, 2016 @ 8:25am 
It is very useful! Aside from the bouncing bug (you'll figure it out, I'm sure, courage!), you should add the option to stop when a boss is spotted (maybe even for rare/elite enemies, or when X enemies are visible, but for bosses it is really important)