Player AI: Let the game play itself

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
ooli
Halfling
Posts: 92
Joined: Mon Dec 23, 2013 9:12 am
Contact:

Player AI: Let the game play itself

#1 Post by ooli »

You can download it here:
https://te4.org/games/addons/tome/player-aioo

Once you click ALT-F1 (you can change this key with Keybinding)
it does:

1.Auto explore
2.Fight using the same AI coded for enemies in the game
3.Rest
4. go back to 1

You can weight the talent used by the AI by right clicking on your character and clicking on "Define Player-Aioo" at the bottom of the dialog box.

It will Stop when your character is low on life, when you are on an Exit, when a dialog box open, or you are blinded.
Then you control your character. And once you are healed you can launch the AI again with ALT-F1 (or your key)
You can force the AI to Stop by closing the TOME window. The dialog for saving will appear immediately, stopping the AI (repeatedly bashing ALT-F1 work too)

Warning: Use it at your own risk. This can put your character in a sure death situation

Goal:
It will clear a level in a few seconds.

Known Bugs:
Major
- Any talent who cannot be used with the "Accept auto target" option (e.g: all wild summon, disengage, Dust to Dust, cunning/traps, etc) can get the AI stuck in talent selection and stop. Setting the weight of those talent to 0 should prevent the interruption
-The AI use the "accept auto target-enabled" option. Sometime it cannot revert back to your default option. Manually get back to your option in the gameplay tab, or with your shortcut

Minor
- the AI might use talent with 0 weight when you have few very few other talent available/ to make a stealth-throwing build, set throwing knife weight at 5 or more, and Attack(and other breaking stealth talent) at 0 , should work
-the AI will never use certain talents (the one not allowed for NPC) whatever the weight you set them. Put them on autocast.
-the log show some talent use, when the AI couldn't in fact use those talent, and canceled it to use some other talent instead (e.g: Archery's talent needing a Mark on target, when there are no Mark)
-the AI interrupt itself after opening a door
-the AI interrupt itself randomly in some dungeon corner
(in both case having any action manually done, restart the AI)
- Sometime White worm Mass are not targetable by the AI. It happen often and only with White worm Mass for unknown reason. The AI will stop and complain about it

History:
It is a fork from Player_GAI by Gladius, itself a fork from Player_Ai by Charidan, since those two dont seems to manage it anymore.

EDIT 15/9/21
Last version:
1.2.4: Cool cessation
- fixed a lua error while teleporting even without the AI active
-fixed a lua error while the AI use an instant-talent that kill/teleport-away a creature and the AI cant find the target anymore
-fixed a bug giving infinite resource when the AI used too much talent from item
- the Ai Stop "stuck in talent selection" should happen less often (as long you dont use talents which dont allow for auto-target option , eg: wild-gift summon)
Last edited by ooli on Tue Sep 14, 2021 10:15 pm, edited 23 times in total.
I play Tome on twitch: https://www.twitch.tv/ooli75

ooli
Halfling
Posts: 92
Joined: Mon Dec 23, 2013 9:12 am
Contact:

Re: Player AI: Let the game play itself

#2 Post by ooli »

Version 1.1 log change:

- The AI now follow the tactical AI used by NPC instead of being totally random.
- the AI stop when there is a Dialog box on screen

Now the AI correctly shoot when it has a missile weapon instead of bashing with your bow. And overall do a better job at using your talents. It will no more deplete all your resource with ineffective expensive talents

Known bugs:

- Talents that need confirmation even with Auto-target option, wont be used by the AI. (like Dust to Dust, or anything that can have multiple targeting option)
- AI try to low down the Paradox when too high. Stopping the AI with the new stop-on-dialog (which can be annoying). setting a low Paradox, or having high WIL prevent that to happen
- Same-wise, Wand equipped will cause the AI to stop when it try to change the Damage type of the wand. Dont use wand.
I play Tome on twitch: https://www.twitch.tv/ooli75

ooli
Halfling
Posts: 92
Joined: Mon Dec 23, 2013 9:12 am
Contact:

Re: Player AI: Let the game play itself

#3 Post by ooli »

1.1.2 log change:

- The AI doesnt try to change the wand damage. You can wear wand
-The AI doesnt try to attune spacetime. No more annoying dialog pop up
- Some fix on talents selection

I guess it is fully functional now. Let me know if you encounter some bug, or have idea
I play Tome on twitch: https://www.twitch.tv/ooli75

fidelio
Low Yeek
Posts: 5
Joined: Wed Jan 16, 2013 8:58 pm

Re: Player AI: Let the game play itself

#4 Post by fidelio »

Hi!

Love the addon. I really want to go through the game with an AI mod, doing as little as possible.

I have two bugs: a major one and a minor one.
- Major: It seems that the AI is trying to use equipment I no longer have. When there is a big fight, my character just stands there, doing nothing, for turns on end. The error message I get is "can not use an item in the transmogrification chest," over and over.

- Minor: It would be really nice if, when there is a chest, and a pop-up asking us to open it or not, if the AI could stop and let us respond.

Thanks! Love it! :)

Jerome

ooli
Halfling
Posts: 92
Joined: Mon Dec 23, 2013 9:12 am
Contact:

Re: Player AI: Let the game play itself

#5 Post by ooli »

changelog 1.1.4 : The AI stop when you step on a chest

Thanks for your feedback Fidelio.
I also wish Darkgod made some option to have a player AI in the game. This developer is great for streamlining the roguelike experience (with transmo-chest, auto explore, auto target) , so I hope an autofight option is the next step, since only 1% of the fights really need you to make hard decision.

I just uploaded a version with the AI stopping when you're on a chest.

But I cannot reproduce the Major bug when the AI try to use deleted item.
Does it happen with one item more often, or any usable item?
I play Tome on twitch: https://www.twitch.tv/ooli75

fidelio
Low Yeek
Posts: 5
Joined: Wed Jan 16, 2013 8:58 pm

Re: Player AI: Let the game play itself

#6 Post by fidelio »

Hi!

It happened with a specific game. It's not happening in my most recent game. I'm wondering if there aren't specific activateable items that once you put them in the chest, the AI thinks you still have them and tries to activate them. If it happens with a new game, I'll send you the save file.

Thanks so much for the fix for chests. :)

Jerome

fidelio
Low Yeek
Posts: 5
Joined: Wed Jan 16, 2013 8:58 pm

Re: Player AI: Let the game play itself

#7 Post by fidelio »

Hi!

So... AIoo won the game (normal adventure). :)
https://te4.org/characters/1034/tome/4b ... 1bb585d5e0

I used the AI as much as possible, including for boss fights of all kinds, including of course the final fight. I was worried about the final fight, but it was over in about 2 seconds, and my health bar did not move. Dwarf bulwark on normal is... very strong.

The places where I wasn't able to use the AI:
- Some water levels
- The Sandworm lair, the Charred scar

I did not have the bug of the AI trying to use items from my transmogrification chest.

Things I wish the AI did:
- I wish the AI stopped like autoexplore stops when you see "interesting terrain" because the AI just goes around chests and vaults. So if I happen to see some as the AI is auto-exploring, I kind of have to "go back" once it's at the exit, but sometimes they're hard to find that way, so I miss some.
- I wish there was a way for the AI to not fully rest very-long-cooldown abilites. There is an option in the normal game menu to have autoexplore NOT fully rest before exploring and I actually tried to turn that on, but AIoo seems to ignore that setting. The problem was as soon as I got any ability or item with a very long cooldown, it slows the game down considerably because the AI rests to full after every small fight, so I tried to just avoid getting thos abilities and items, but I eventually did have a 50-cooldown ability, and I basically regretted even getting it at some point.
- I wish there were a way to either tell the AI to ignore certain abilities or to "program" the AI to only use certain abilities. In this bulwark build, there is an awful sustained talent that slows down attack speed by 10%, and the AI just keeps turning it back on, but I would really prefer if it didn't. I would love to turn off escaped like movement infusions as well, and then it would be possible to get those skills but have the AI save them for when at low health. That would be great. I fully understand that this may be unrealistic.

You mentioned how it would be great if DarkGod built AI into the game. I would _love_ that. I would love to pre-program builds or something like that, and have the AI autoplay the game. Would be hilarious.

Anyway, thanks for everything! I really had a blast. :)

ooli
Halfling
Posts: 92
Joined: Mon Dec 23, 2013 9:12 am
Contact:

Re: Player AI: Let the game play itself

#8 Post by ooli »

Congratulation on your win!


The places where I wasn't able to use the AI:
- Some water levels
- The Sandworm lair, the Charred scar
That is a problem even with Autoexplore. I dont think I can do anything about it. I suppose water level with breathing gear should be ok. But sandworm Lair and charred scar must be done by hand

Things I wish the AI did:
- I wish the AI stopped like autoexplore stops when you see "interesting terrain" because the AI just goes around chests and vaults. So if I happen to see some as the AI is auto-exploring, I kind of have to "go back" once it's at the exit, but sometimes they're hard to find that way, so I miss some.
Sound doable. I will check what I can do
- I wish there was a way for the AI to not fully rest very-long-cooldown abilites. ..
- I wish there were a way to either tell the AI to ignore certain abilities or to "program" the AI to only use certain abilities. ...
this one I would like to. Like you can program the clone talent usage for Paradox mage, or the golem talent usage for Alchemist. So may be I can reuse the code there
You mentioned how it would be great if DarkGod built AI into the game. I would _love_ that. I would love to pre-program builds or something like that, and have the AI autoplay the game. Would be hilarious.
yeah!!! Ideally Darkgod use the program used for mob on the character and let us be decide on talent usage, and when to stop the AI. That would be great indeed.


I'm so glad you used the addon, and had fun with it. I'll try to make it better
I play Tome on twitch: https://www.twitch.tv/ooli75

ooli
Halfling
Posts: 92
Joined: Mon Dec 23, 2013 9:12 am
Contact:

Re: Player AI: Let the game play itself

#9 Post by ooli »

ooli wrote: Tue Mar 02, 2021 7:31 pm
Things I wish the AI did:
- I wish the AI stopped like autoexplore stops when you see "interesting terrain"
Sound doable. I will check what I can do
After checking, sound too much hassle (checking every tick for a chest in your field of view) for a rare use
- I wish there were a way to either tell the AI to ignore certain abilities or to "program" the AI to only use certain abilities. ...
this one I would like to. Like you can program the clone talent usage for Paradox mage, or the golem talent usage for Alchemist. So may be I can reuse the code there
The code for golem/Clone is way too complicated for me to reuse.
For a future v2 I might be able to let the player select certain talent that the AI wont be allowed to use.
So when you get the control back (when the AI stop because you're low on life usually), you'll still have those talent available (to flee, or heal). Actually I already prevent the AI to Adjust Paradox (so you wont have a prompt about new Paradox level interrupting every few round). So this can be extended to other talents. It is just a matter of getting the Dialog menu up and running for the player to choose those Ai-forbidden talents
I play Tome on twitch: https://www.twitch.tv/ooli75

ooli
Halfling
Posts: 92
Joined: Mon Dec 23, 2013 9:12 am
Contact:

Re: Player AI: Let the game play itself

#10 Post by ooli »

Last version:
1.1.7: Blurp Blurp
- fix a game killing bug when suffocating

Prior version:
1.1.6: Beware Burning
-cancel random left-over annoying targeting when the AI stop
-Stop the AI when it want to rest but are very low on HP (dont be killed while resting on Lava anymore)

1.1.5 is badly bugged, dont use it)
I play Tome on twitch: https://www.twitch.tv/ooli75

ooli
Halfling
Posts: 92
Joined: Mon Dec 23, 2013 9:12 am
Contact:

Re: Player AI: Let the game play itself

#11 Post by ooli »

Last version:
1.1.8: Bog Breakfree
- Rest when it cannot move, instead of trying (and falling) to Explore
- The AI will stop when it has low HP and try to rest with some active poison/disease (or it is in the middle of a poisoned dark Bog and your promising Madness player die slowly of poison), , or it take too much damage from out of vision enemy
- Try to accelerate rest by using Meditation (to decrease equilibrium faster ) before resting if it know it, and deactivating it after the rest
I play Tome on twitch: https://www.twitch.tv/ooli75

ooli
Halfling
Posts: 92
Joined: Mon Dec 23, 2013 9:12 am
Contact:

Re: Player AI: Let the game play itself

#12 Post by ooli »

Last version:
1.1.9 Blind block
-Being blind will stop the AI. Since there is no easy way for the Ai to know where to strike
-The ontakehit function replacement is ditched since it seems to cause a bug with Flash of the Blade. That mean, it can cause edge case where the Ai take damage out from of visual range, and cant react properly until it die
I play Tome on twitch: https://www.twitch.tv/ooli75

ooli
Halfling
Posts: 92
Joined: Mon Dec 23, 2013 9:12 am
Contact:

Re: Player AI: Let the game play itself

#13 Post by ooli »

I am happy to announce that 1.2.0 is out.

What's new?
You can now tell the AI what talent to use, like with the clone from Paradox/Temporal Guardian

How to do so?
You right click on your character. At the bottom of the dialog box there is a new green button saying "Define Player-Aioo":

Image

Then it open the classic Clone Talent usage dialog box, and you put the weight you want:
Image

Then you just have to launch the A1 (with Alt-F1 by default) and it will fight using your weighted talents.
So any talent with a 0 weight will never be used by the AI (some talents will never be used even with a 1000 weight, because the mob are not allowed to use them. And I use the AI coded for the mob)
I play Tome on twitch: https://www.twitch.tv/ooli75

ooli
Halfling
Posts: 92
Joined: Mon Dec 23, 2013 9:12 am
Contact:

Re: Player AI: Let the game play itself

#14 Post by ooli »

Last: 1.2.3 Carry circle
- fixed a bug where launching the AI while encumbered would crash the game
- The "stuck on talent selection" Stop, will happen less often

Previous: 1.2.2 Cure cleared:
- the AI now try to keep distance with enemy when the player has ranged talents (should help with reloading , and caster survivability)
- the AI try to get out of suffocating or other dangerous area on its own.
- the AI should always respect your weighted option. If you only keep very few available talent for the AI, and no attack (Attack weighted at 0) it might still use attack sometime. Super weighting (weight of 4-8) one or two usable talents should prevent that to happen.
- AI stop at first dialog box on screen. It prevent a rare stack overflow bug while exploring with a dialog box (plus it simplify the emergency stop of a running AI: Just close your TOME window, the "Do you want to Save and exit " Dialog will appear, stopping the AI)



Known Bug:
- Any talent who cant be use with the auto-accept target option (e.g: all wild summon, disengage, Dust to Dust, cunning/traps, etc) can get the AI stuck in talent selection and stop. Setting the weight of those talent to 0 (with Right-click on character / Define Player-AIoo (at the bottom)) should prevent the interruption
- Sometime White worm Mass are not targettable by the AI. It happen often and only with White worm Mass for unknown reason. The AI will stop and complain about it

Previous version, "1.2.1 Coward Caster", Had a Lua error when the AI was low on life, or on the player final death, dont use it.
I play Tome on twitch: https://www.twitch.tv/ooli75

ooli
Halfling
Posts: 92
Joined: Mon Dec 23, 2013 9:12 am
Contact:

Re: Player AI: Let the game play itself

#15 Post by ooli »

1.2.4: Cool cessation
- fixed a lua error while teleporting even without the AI active
-fixed a lua error while the AI use an instant-talent that kill/teleport-away a creature and the AI cant find the target anymore
-fixed a bug giving infinite resource when the AI used too much talent from item
- the Ai Stop "stuck in talent selection" should happen less often (as long you dont use talents which dont allow for auto-target option , eg: wild-gift summon)
I play Tome on twitch: https://www.twitch.tv/ooli75

Post Reply