Tales of Maj'Eyal

Tales of Maj'Eyal

30 ratings
Player AI
File Size
98.942 KB
Sep 23, 2015 @ 6:48pm
Mar 1, 2022 @ 1:30am
9 Change Notes ( view )

Subscribe to download
Player AI

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

Credit to Doctus[github.com] and jnday[github.com] for contributing to and indirectly causing this release. Huge thanks to them!

Adds a keybind to activate the new player AI. Set to Alt+F1 by default.
This player AI rests, auto-explores, and attacks enemies (using most talents when possible).
It will clear an entire floor or stop when it hits a configurable health threshold (default 25%) in the presence of enemies.
Configurable rank stop to cancel the AI in the presence of a sufficiently high rank enemy (such as a boss).

Check the Game Options menu: there is a Player AI tab for settings specific to this AI.

This AI has not been tested in the Sandworm Lair; use it there at your own risk.
The AI doesn't know not to use menu-opening abilities (e.g. command staff) so it's probably unhelpful to use with classes that have those abilities enabled. I've also gotten reports of gamebreaking problems with Chronomancer, which should surprise nobody.

Compatibility note: This addon superwrites Player:act(), so if your addon also touches Player:act() change the load order so that the Player AI addon loads last.

Not under active development.

  • Rests!
  • Autoexplores!
  • Attacks enemies!
  • Uses talents randomly!
    • No exceptions yet for talents like Meditation or Phase Door to use them intelligently.
  • Options tab in the Game Options menu!

  • It can get stuck in infinite explore loops, so I added a setting for max turns it can run in a row (default 1000) so it will eventually cede control back to you.
  • 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 sometimes falls through to its "wait a turn" case when it doesn't seem necessary. This will be awful to debug.

v.1.7.0 PATCH NOTES:
  • Added Rank Stop! Credit to jnday.
    • The AI can be configured to exit if it detects an enemy of certain rank or higher, e.g. bosses.
  • Fixed a typo preventing Hunt mode from working at all. Credit to Doctus.

v.1.6.2 PATCH NOTES:
  • Added configuration to disable the Hunt state, since it often is less smart than not having it. Default disabled.

  • Added configuration for the AI runtime timeout. You can now adjust to match your patience with the AI getting stuck in loops.

  • Added framework support for configurations!
    • There is a new tab in the Game Options menu for "Player AI" settings.
    • Configurable percentage health thresholds for disabling the AI or fleeing in "hunt" state.
    • Configurable timeout on "hunt" state.
    • Just three settings for now, will definitely be more later.
  • Added a primitive "hunting" mode.
    • If out-of-combat and attacked by an enemy it cannot see (including when it is blinded; the AI is dumb), it will check if the enemy position is known and rush them.
    • If the attacker's position is unknown, the AI will randomwalk instead of standing still.
    • Configurable health threshold to instead avoid the engagement and lose its pursuers so it can rest safely.

Stuff that probably should be implemented but hasn't been:
  • Smarter "hunting" state.
  • Assay practicality of per-talent settings to control usage.
  • Improve understanding of talent types (such as which talents heal/defend you and should be used while resting/hunting).
< >
雾雨 Nov 23, 2023 @ 8:36pm 
Thanks for the great work!
Is it possible to disable some talent from auto-using ?
things that popup a dialog will break the game.
DiddyDivine Jul 16, 2023 @ 1:50pm 
Have been playing the game for only a few hours, but quickly recognized that fighting in lower level areas would be a chore.

Having this is in my active mod-list is great boredom insurance. Thank you!

Also, I love all the useful options to tweak the settings. I truly only want the AI to handle the easy stuff for me. Glad to see it can be configured to stop at the certain enemy rarities, health thresholds, etc.
Lestat2150 Apr 10, 2023 @ 7:28am 
This is unplayable using an archmage yeah becaues of the spamming of command staff. It actually crashes the game. Normal auto explore will have to do with anyone with the command staff skill.
Squircle Mar 18, 2023 @ 1:43pm 
When I first spotted this mod a few years ago, I remember wondering who in their right mind would ever use it. After all, who'd want to play a game that plays itself?

After sinking nearly 200 hours into ToME, I have found that person: Me.
Charidan  [author] Nov 7, 2020 @ 5:57pm 
Generally speaking no, I don't actively maintain this. If I was going to come back to it, configurations on individual spells would be the next step. Honestly the hardest part is getting the UI so you can actually set the settings.

I tend to revisit this for touchups every year-ish, so maybe it'll happen. The github for it is public though, if anyone feels like contributing (ha!).
Guedez Nov 7, 2020 @ 4:11pm 
I also would like to reserve some spells for myself to decide when to use as a panic button
Guedez Nov 7, 2020 @ 4:11pm 
Is this still updated? Can we get an option to disable spells for the AI? Some spells crash the game through a stack overflow, seems to be the chronomancer spell that asks for a number
MoistWater Oct 17, 2020 @ 8:08pm 
I restarted the game a few times and now it works but i have to start with a new character it seems
MoistWater Oct 17, 2020 @ 4:22pm 
it is enabled and i just clicked subscribe and it downloaded thats it
Charidan  [author] Oct 17, 2020 @ 3:09pm 
Check your addons menu and make sure it is enabled? If you open the in-game options menu you should be able to find the tab with the configurations for the mod. If not, you haven't installed it correctly.