ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Thu Dec 05, 2019 8:12 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Apr 29, 2011 7:39 pm 
Offline
Perspiring Physicist

Joined: Tue Jul 13, 2010 2:53 pm
Posts: 1332
I was looking into tiger_eye's bug report about fleeing and stealth (link) and tracked it down to how the dmap features are not obfuscated with the aiSeeTargetPos method. How should this work? Should we assume that anything with dmap has a supernatural sense for the player and leave it as is? In that case we should introduce a flee_simple AI routine that uses aiSeeTargetPos, something like this:

Code:
newAI("flee_simple", function(self)
   if self.ai_target.actor then
      local tx, ty = self:aiSeeTargetPos(self.ai_target.actor)
      local dir = 5
      local bestdist = 0
      for i = 1, 9 do
         local sx, sy = util.coordAddDir(self.x, self.y, i)
         local sqdist = math.pow(self.x - sx, 2) + math.pow(self.y - sy, 2)
         if self:canMove(sx, sy) and sqdist < bestdist then
            bestdist = sqdist
            dir = i
         end
      end
      return self:moveDirection(util.coordAddDir(tx, ty, dir))
   end
end)


An alternative would be to add some random values to the move/flee_dmap that takes into account the canSee chance. Thoughts?

_________________
Quote:
<DarkGod> lets say it's intended


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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