Page 1 of 1

Tactical AI

Posted: Fri Jan 28, 2011 4:54 pm
by yufra
Currently low health will guide the talent selection towards either HEAL or ESCAPE talents, but it will not actually switch the movement over to "flee_dmap". Only moving closer than ai_tactic.safe_range does that. I have whipped together an untested patch that will will run the tactical check every turn rather than every talent_in turns, and changes to flee_dmap if you want to escape. The patch is: http://pastebin.com/48zb6sFM

I'll test and play around with it a bit, but I think this is more flexible. Cheers!

Re: Tactical AI

Posted: Sat Jan 29, 2011 4:40 pm
by darkgod
The problem is that a creature can not want to flee unless it has a talent allowing fleeing.
PS: also, pastebin seems to break all diffs :/

Re: Tactical AI

Posted: Sun Jan 30, 2011 8:11 am
by yufra
Yah, the pastebin patch has a bug, it should be:

Code: Select all

	-- Keep your distance
	local special_move = false
	if want and want.escape then
		special_move = "flee_dmap"
	end
I am currently testing this patch in-game and will let you know how it works out: http://pastebin.com/8b44J7iD