Who shot me?

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
Charidan
Higher
Posts: 64
Joined: Wed Jul 22, 2015 8:12 pm

Who shot me?

#1 Post by Charidan »

Is there a way to look up all the recent damage events and figure out who attacked you?

The player AI has an interesting flaw in that getting hit by enemies out of its vision range confuses it greatly, and it ends up trying to rest off the damage while getting continuously attacked, and dies. A way to recognize that it is being range attacked (and not just taking DoT from bleed or poison) would be great.
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.

Radon26
Sher'Tul
Posts: 1439
Joined: Mon Jun 23, 2014 11:50 am

Re: Who shot me?

#2 Post by Radon26 »

well, maybe on taking damage you could disable the rest option for.... 10-20 turns or so, meanwhile force the AI player to do a patrol?
perhaps, if something like "track" or "vimsense" is available, it should be instantly activated?

edit
also a little check.
on killing enemy, scan for visible enemies. if there are none, the "10 to 20turns of no rest" will be reset.

another edit.
the golem's eye beams continue past the target, and always travel the maximum length, so it is possible.
if projectile is visible before it hits, you could make the AI player project a line to where the projectile come from, and explore that area.

or you could just select a random tile within range 10 and go there. if AI player ends up behind a corner, the stealthy enemy archer will have to come into the range of the light. and if the AI player ends up bunping into the stealthy enemy archer, the the archer is going to die. probably.

Charidan
Higher
Posts: 64
Joined: Wed Jul 22, 2015 8:12 pm

Re: Who shot me?

#3 Post by Charidan »

Decent workarounds Radon.

I'm looking for something a little more concrete though. For example, there's a function Actor:takeHit(value, src, death_note). One of my branches of research is trying to figure out what the src object is (whether it represents the attacker or a projectile) and how to get the identity of the assailant from it so the AI can target them or take them into account or whatever.

EDIT: A little more detailed reading has shown that some src have a function resolveSource() which seems to return the actor responsible for the damage source.
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.

Radon26
Sher'Tul
Posts: 1439
Joined: Mon Jun 23, 2014 11:50 am

Re: Who shot me?

#4 Post by Radon26 »

unfortunately (for reasons) i was unable to start coding myself, so i am unable to provide any tight solutions, but, should work until you have a better way right? well... if i read it correctly it seems you do. "src.return source" or whatever.
it is good to have some other options if you cannot find the perfect answer so, if i have an idea on how to resolve your problems, i will make sure to toss it in here.

also, i assume you are going to make an item selection eventually right?
are you trying to make an AI player beat the game?

Charidan
Higher
Posts: 64
Joined: Wed Jul 22, 2015 8:12 pm

Re: Who shot me?

#5 Post by Charidan »

Originally I was just making an AI to sweep through dungeons you're overleveled for and clean them out for you. Naturally I then immediately said "but I can make it better". Who knows where it will go.

If you want to download it, you can get it off the T-engine site here: http://te4.org/games/addons/tome/player-ai
Or from the steam workshop here: http://steamcommunity.com/sharedfiles/f ... =523638132

You can also view my live repository of the code on GitHub: https://github.com/Charidan/Tales-of-Maj-Eyal-Player-AI
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.

Post Reply