Page 1 of 1
AI random walk: keep going in one direction
Posted: Sun Feb 17, 2013 10:19 am
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.
Re: AI random walk: keep going in one direction
Posted: Sun Feb 17, 2013 12:09 pm
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.
Re: AI random walk: keep going in one direction
Posted: Sun Feb 17, 2013 1:29 pm
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.
Re: AI random walk: keep going in one direction
Posted: Sun Feb 17, 2013 2:30 pm
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?
Re: AI random walk: keep going in one direction
Posted: Sun Feb 17, 2013 2:55 pm
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.
Re: AI random walk: keep going in one direction
Posted: Sun Feb 17, 2013 3:28 pm
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...
Re: AI random walk: keep going in one direction
Posted: Sun Feb 17, 2013 5:32 pm
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.
Re: AI random walk: keep going in one direction
Posted: Sun Feb 17, 2013 5:42 pm
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...
Re: AI random walk: keep going in one direction
Posted: Sun Feb 17, 2013 6:23 pm
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.