AI random walk: keep going in one direction

All new ideas for the upcoming releases of ToME 4.x.x should be discussed here

Moderator: Moderator

Post Reply
Message
Author
jotwebe
Uruivellas
Posts: 725
Joined: Fri Apr 15, 2011 6:58 am
Location: GMT+1

AI random walk: keep going in one direction

#1 Post by jotwebe »

As I understand it, currently when hit from something outside of LoS, actors start moving at random. Usually though, that is less than effective - they tend to dance around a bit, but not move all that much.

My suggestion is to have them pick a direction at random as usual, but then keep moving in it for a bit. Either it moves toward the player, gaining LoS sooner or later, or it moves away, getting out of range. That should tend to be more effective as well as interesting.
Ghoul never existed, this never happened!

SageAcrin
Sher'Tul Godslayer
Posts: 1884
Joined: Tue Apr 10, 2012 6:52 pm

Re: AI random walk: keep going in one direction

#2 Post by SageAcrin »

I think that optimal would probably be moving to the last point you were seen at(as the AI, I believe, does), then, rather than moving around in an increasing circle area(which is, I believe, what the AI does right now), RNGing a random point in that circle area to move to, then picking a random direction from there, then doing the whole thing again after X(20-40) turns pass, with the circle now bigger.

That way, they'd move within a general area, but they'd also spread out some. Then they'd move back in, spread out, move back in, spread out...

Kinda like a real search pattern, only less intelligent. Which feels right.

jotwebe
Uruivellas
Posts: 725
Joined: Fri Apr 15, 2011 6:58 am
Location: GMT+1

Re: AI random walk: keep going in one direction

#3 Post by jotwebe »

I was mainly thinking about the case where you haven't been seen at all.

Not sure a search pattern is a good thing for the AI to use. If it can't close in with the player, the next best thing is to get the hell out of dodge, and going in a straight line has the best chances to do that, I think.
Ghoul never existed, this never happened!

SageAcrin
Sher'Tul Godslayer
Posts: 1884
Joined: Tue Apr 10, 2012 6:52 pm

Re: AI random walk: keep going in one direction

#4 Post by SageAcrin »

If they haven't seen you yet, isn't one place as good as another? Why not have them stand still, if they haven't interacted with you yet?

Having every enemy on the map mill around aimlessly is a notable processor hit-vaults specifically got commanded to stand still because of that. What's the gain?

jotwebe
Uruivellas
Posts: 725
Joined: Fri Apr 15, 2011 6:58 am
Location: GMT+1

Re: AI random walk: keep going in one direction

#5 Post by jotwebe »

No, I don't propose having monsters shuffling back and forth in unopened vaults:
jotwebe wrote:As I understand it, currently when hit from something outside of LoS, actors start moving at random. Usually though, that is less than effective - they tend to dance around a bit, but not move all that much.
Hitting something around a corner with an AoE spell is what I'm talking about. The player knows it's there through whatever method, it hasn't seen the player, cast Glacial Vapours or something similar, profit.
Ghoul never existed, this never happened!

SageAcrin
Sher'Tul Godslayer
Posts: 1884
Joined: Tue Apr 10, 2012 6:52 pm

Re: AI random walk: keep going in one direction

#6 Post by SageAcrin »

Ah, you mean short term handling of out of LoS damage.

Seems like the same solution as was proposed with summons-having your location passed to the enemy, with a fuzz radius-would work for that. Though, you'd have to do something about DoTs constantly passing your location...hmmm.

Really, enemies should have a vague idea of where that Gravity Well or whatever came from. The player does. If it's worse at it than the player...well, that's normal. :)

Maybe your idea does work better in practice, though, for that particular problem. I hadn't thought of the constant location passing...

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: AI random walk: keep going in one direction

#7 Post by tiger_eye »

Aye, yufra or I (or both) will improve the wandering AI (and responses to unseen stimuli, summons, etc.). Wandering was added in a late release candidate for v1, and so was kept simple to avoid possibilities of bugs (didn't want to further delay v1!) and let us move on to other things to fix and improve for v1.
darkgod wrote:OMFG tiger eye you are my hero!

Crim, The Red Thunder
Sher'Tul Godslayer
Posts: 2000
Joined: Fri May 07, 2004 8:26 pm
Location: Nahgharash

Re: AI random walk: keep going in one direction

#8 Post by Crim, The Red Thunder »

tiger_eye wrote:Aye, yufra or I (or both) will improve the wandering AI (and responses to unseen stimuli, summons, etc.). Wandering was added in a late release candidate for v1, and so was kept simple to avoid possibilities of bugs (didn't want to further delay v1!) and let us move on to other things to fix and improve for v1.
So how exactly WILL this impact lag on slower computers? Not dealing with huge lag in vault levels anymore is useful, but if you start tossing huge amounts of complexity into the AI of enemies, every level becomes what Dreadfell used to be, and the infinite dungeon still is...
Currently playing under the name Aura of the Dawn 4 down, 227 to go!
Proud author of Orc Pit Restoration Project, Faction Allies, Dwarven Adventurer addons
SadistSquirrel wrote:DarkGod has two arms, one with an opened hand, one with a closed fist. You got the fist.

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: AI random walk: keep going in one direction

#9 Post by tiger_eye »

Crim, The Red Thunder wrote:So how exactly WILL this impact lag on slower computers? Not dealing with huge lag in vault levels anymore is useful, but if you start tossing huge amounts of complexity into the AI of enemies, every level becomes what Dreadfell used to be, and the infinite dungeon still is...
Shouldn't be much at all. I have already implemented an optimization that results in a noticeable speed gain for levels with many npcs. There are more optimizations that we know we can do, and some that we may be able to do. Again, these were slated to be done post-v1.
darkgod wrote:OMFG tiger eye you are my hero!

Post Reply