Tales of Maj'Eyal

Tales of Maj'Eyal

Not enough ratings
Player AI
File Size
0.091 MB
Sep 23, 2015 @ 6:48pm
Sep 12, 2020 @ 3:49am
8 Change Notes ( view )

Subscribe to download
Player AI

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

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.

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.

  • 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.

  • 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.

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

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.

Stuff I want implemented soon:
  • 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).
< >
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
MoistYaourtEau 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
MoistYaourtEau 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.
MoistYaourtEau Oct 17, 2020 @ 12:30pm 
I started a new character and it still won't work im confused
Charidan  [author] Sep 12, 2020 @ 4:02am 
@Howl at the Moon
No idea! I have never tested adding the addon to an existing save, so I'm not sure how that even works. I don't know if the ToME engine even allows for loading a save with mismatched addons - I tried just now and my save without the addon simply was not available to be loaded. It's possible there's a trick to adding an addon to a save file, or that I need to do something to the addon to allow it to be added, but for now I think that the TE4 engine requires that a save be loaded with the same addons it was created with (likely because of lua bundling).
Charidan  [author] Sep 12, 2020 @ 4:02am 
Good point. I've been pretty dissatisfied with how effective Hunt state is and regretted leaving it there without me working on it. I've added an option to ignore Hunt state entirely, which causes the AI to respond to unexpected damage by stopping and asking for human help. This can be a little annoying in places like Trollmire where it gets attacked walking around a tree and is gets confused, but it's probably going to be an appreciated option for a lot of purposes.
Howl at the Moon Sep 11, 2020 @ 3:01pm 
Thank you. Great mod.
Does it work only with new game? Can't activate after loading previously game.