ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Thu Oct 19, 2017 11:24 pm

All times are UTC




Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: RELEASED: Player AI
PostPosted: Fri Oct 09, 2015 2:09 am 
Offline
Higher

Joined: Wed Jul 22, 2015 8:12 pm
Posts: 56
TE-4 ADDON LINK: http://te4.org/games/addons/tome/player-ai
STEAM WORKSHOP LINK: http://steamcommunity.com/sharedfiles/f ... =523638132
GITHUB LINK: https://github.com/Charidan/Tales-of-Maj-Eyal-Player-AI

Version 1.5.1 has gone live.

The Player AI is intended as a lazy way to clear easy dungeon floors, not a competent combatant who will win the game for you. I might make that AI later, or just keep improving this one until it's actually good at the game.

Have fun, and tell me what you think. I accept comments, criticisms, and bug reports.

Current Status: This addon is not currently under active development. I keep telling myself I'll come back to it some day, but haven't yet. I am accepting pull requests to the git if other people want to continue development and help me along.

-------------

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

VERSION 1.5.1 FEATURE DESCRIPTION:
  • 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!
CURRENT BUGS:
  • 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

v1.5.1 PATCH NOTES:
  • 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
v1.5 PATCH NOTES:
  • Fixed a bug with "waiting" where the AI called the wrong function to wait and ended up hanging.

Stuff I'm Working On:
  • A "hunting" AI state to react to damage taken while out of combat
  • Configuration settings for various talent uses, the low-health exit threshhold, etc.

_________________
Currently developing the Player AI addon. You can get it from the T-Engine Addon Hub or Steam
You can also view the source code.


Last edited by Charidan on Mon Apr 18, 2016 5:16 pm, edited 9 times in total.

Top
 Profile  
 
 Post subject: Re: RELEASED: Player AI
PostPosted: Sun Oct 11, 2015 6:04 pm 
Offline
Low Yeek

Joined: Mon Mar 23, 2015 10:26 am
Posts: 6
My character seems to be tinkering with her sustains, it'd probably be best if only active skills were used.

An error log:
Quote:
error = "Lua Error: /mod/class/Actor.lua:1556: stack overflow\
At [C]:-1 \
At /mod/class/Actor.lua:1556 reactionToward\
At /mod/class/Actor.lua:1571 reactionToward\
At /mod/addons/player-ai/superload/mod/class/Player.lua:88 \
At [C]:-1 calc_circle\
At /mod/addons/player-ai/superload/mod/class/Player.lua:86 spotHostiles\
At /mod/addons/player-ai/superload/mod/class/Player.lua:219 player_ai_act\
At /mod/addons/player-ai/superload/mod/class/Player.lua:274 player_ai_act\ (repeated thousands of times)
At /mod/addons/player-ai/superload/mod/class/Player.lua:339 act\
At /engine/GameEnergyBased.lua:126 tickLevel\
At /engine/GameEnergyBased.lua:62 tick\
At /engine/GameTurnBased.lua:46 tick\
At /mod/class/Game.lua:1259 "


Hope this helps!


Top
 Profile  
 
 Post subject: Re: RELEASED: Player AI
PostPosted: Sun Oct 11, 2015 6:54 pm 
Offline
Higher

Joined: Wed Jul 22, 2015 8:12 pm
Posts: 56
EDIT: It looks like the steam version of the addon is out of date. I will bargain with the steam gods to try and get that fixed.

_________________
Currently developing the Player AI addon. You can get it from the T-Engine Addon Hub or Steam
You can also view the source code.


Top
 Profile  
 
 Post subject: Re: RELEASED: Player AI
PostPosted: Mon Oct 12, 2015 7:17 pm 
Offline
Higher

Joined: Wed Jul 22, 2015 8:12 pm
Posts: 56
I properly uploaded version 1.2 to steam, so it should be fixed now.

_________________
Currently developing the Player AI addon. You can get it from the T-Engine Addon Hub or Steam
You can also view the source code.


Top
 Profile  
 
 Post subject: Re: RELEASED: Player AI
PostPosted: Tue Oct 13, 2015 10:38 pm 
Offline
Higher

Joined: Wed Jul 22, 2015 8:12 pm
Posts: 56
I'm going to start cataloging old patch notes in posts so people can find them.

v1.2 PATCH NOTES:
  • Complete backend rewrite of the action and decision code
  • Addition of AI states so it stops trying to rest and autoexplore in combat
  • Implemented Talents

v1.3 PATCH NOTES:
  • The AI now responds to suffocation
  • If air is less than 75, it seeks tiles with air
  • If it can't see air and air is less than 75, it exits with a suffocation warning

_________________
Currently developing the Player AI addon. You can get it from the T-Engine Addon Hub or Steam
You can also view the source code.


Top
 Profile  
 
 Post subject: Re: RELEASED: Player AI
PostPosted: Thu Oct 15, 2015 3:17 am 
Offline
Higher

Joined: Wed Jul 22, 2015 8:12 pm
Posts: 56
v1.4 PATCH NOTES:
  • AI will no longer attempt to cast 0% of a turn talents or talents that fail twice in a turn
  • This fixes some infinite loops with talents like Cauterize Spirit with 0 cast time and 0 cooldown.
  • Talents don't universally "fail" properly in the code, so Rush can still cause infinite loops in bad terrain
  • Credit to steam user Elana for suggesting the change

_________________
Currently developing the Player AI addon. You can get it from the T-Engine Addon Hub or Steam
You can also view the source code.


Top
 Profile  
 
 Post subject: Re: RELEASED: Player AI
PostPosted: Thu Oct 15, 2015 8:40 pm 
Offline
Higher

Joined: Wed Jul 22, 2015 8:12 pm
Posts: 56
v1.5 PATCH NOTES:
  • Updated the cast tracking system to check the cooldowns and energy (time) cost of talents
    • If a talent with a cooldown fails to go on cooldown, it is assumed the talent cannot be used
    • If a talent with an energy cost fails to expend energy, it is assumed the talent cannot be used
    • If a talent has no cooldown and no energy cost, it is limited to a maximum number of uses per turn, currently 5
  • Fixed a bug with "waiting" where the AI called the wrong function to wait and ended up hanging.

_________________
Currently developing the Player AI addon. You can get it from the T-Engine Addon Hub or Steam
You can also view the source code.


Top
 Profile  
 
 Post subject: Re: RELEASED: Player AI
PostPosted: Fri Oct 16, 2015 2:18 pm 
Offline
Wyrmic

Joined: Wed Aug 08, 2007 12:23 pm
Posts: 256
I'm using a lot of addons, so difficult to see if one is affecting it, but the latest version sees to have entirely disabled talent use for me


Top
 Profile  
 
 Post subject: Re: RELEASED: Player AI
PostPosted: Fri Oct 16, 2015 6:59 pm 
Offline
Higher

Joined: Wed Jul 22, 2015 8:12 pm
Posts: 56
My first advice is gonna be to try again, because I just posted a patch to the previous version that cleans it up. If that doesn't work, then it's probably an addon conflict since it works fine for me. There's a few tests only you can run if you want to diagnose further.

  1. Clarify if AI-used talents aren't working or all talents, even user-initiated casts
  2. Distinguish whether talents don't work ever or work for a bit and then stop working
  3. GOLD STAR BONUS: Try disabling addons in the main menu to see if that makes it work, so we know that the problem is:
    1. an addon conflict, and
    2. which addon(s) it's conflicting with

-----------------

And for everyone else, the patch notes.

v1.5.1 PATCH NOTES:
  • Replaced the cast tracking system with a fail catching system
    • Grayswandir pointed out that there is a function which tells me if a talent failed, so I now mark talents as failed if they fail, as opposed to the complicated stuff I'd been doing.
    • This mostly just makes my code look cleaner without effecting gameplay, although it removes some weird edge cases.

_________________
Currently developing the Player AI addon. You can get it from the T-Engine Addon Hub or Steam
You can also view the source code.


Top
 Profile  
 
 Post subject: Re: RELEASED: Player AI
PostPosted: Fri Oct 16, 2015 8:22 pm 
Offline
Wyrmic

Joined: Wed Aug 08, 2007 12:23 pm
Posts: 256
Seems to be working now, with the updated version.

For reference, in the last version I found that talents on auto-use were activating at appropriate times, but were not targeting opponents, and would otherwise ignore talent use and bump attack everything to do death.


Top
 Profile  
 
 Post subject: Re: RELEASED: Player AI
PostPosted: Fri Oct 16, 2015 9:14 pm 
Offline
Higher

Joined: Wed Jul 22, 2015 8:12 pm
Posts: 56
I think I understand why. While I was rewriting everything for the patch I found a bug in the old version where an if statement had one of its conditions reversed. Still, if the patch fixed it, then it's fixed.

_________________
Currently developing the Player AI addon. You can get it from the T-Engine Addon Hub or Steam
You can also view the source code.


Top
 Profile  
 
 Post subject: Re: RELEASED: Player AI
PostPosted: Sun Nov 01, 2015 3:07 pm 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2257
some suggestions:

(a) 1/4 health is way too low for most characters - either let user set it, so it can be adjusted according to level and character, or set it to 1/3 or 1/2
(b) please get it to stop when you level up. atm, it just keeps running
(c) get it to stop when you encounter boss, or at least, make this an option for the user
(d) when a zone is completely cleared, and you run this, you can't stop it, it goes forever. so please make it so ESC stops the ai running.

enjoying seeing how this works, but it needs some basic refining still :-)

_________________
MADNESS rocks


Top
 Profile  
 
 Post subject: Re: RELEASED: Player AI
PostPosted: Sun Nov 01, 2015 5:09 pm 
Offline
Higher

Joined: Wed Jul 22, 2015 8:12 pm
Posts: 56
Configurations are scheduled for the patch after next, because that will be a completely new feature.

The current setup for the AI doesn't allow for button presses while it's running, not consistently. The short explanation is that ToME doesn't accept input while it is executing a turn, and the AI is always taking a turn. If it gets in a loop between exits try and hit an arrow key a lot of wait for it to time out. Once timeout is configurable it'll be less bad.

Hadn't considered stopping on level up or on boss sighting. I think it's possible.

The bad news is I'm in the process of getting a job, so my work on the addon is going to be delayed a bit.

_________________
Currently developing the Player AI addon. You can get it from the T-Engine Addon Hub or Steam
You can also view the source code.


Top
 Profile  
 
 Post subject: Re: RELEASED: Player AI
PostPosted: Sun Nov 01, 2015 9:51 pm 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2257
Charidan wrote:
Configurations are scheduled for the patch after next, because that will be a completely new feature.

The current setup for the AI doesn't allow for button presses while it's running, not consistently. The short explanation is that ToME doesn't accept input while it is executing a turn, and the AI is always taking a turn. If it gets in a loop between exits try and hit an arrow key a lot of wait for it to time out. Once timeout is configurable it'll be less bad.

Hadn't considered stopping on level up or on boss sighting. I think it's possible.

The bad news is I'm in the process of getting a job, so my work on the addon is going to be delayed a bit.


i hope you can still fnid some time for this.

I am trying with solipsist and with thought forms, rather than put one on and leave it on, it changes them as soon as possible. This is not good at all. I imagine it might do the same thing with mind slayer shields and auras. So it needs to understand sustained talents better.

_________________
MADNESS rocks


Top
 Profile  
 
 Post subject: Re: RELEASED: Player AI
PostPosted: Sun Nov 01, 2015 9:55 pm 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2257
It is also not using runes that do damage.

_________________
MADNESS rocks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group