[CF-Devel] (old) bugs

Mark Wedel mwedel at scruz.net
Wed Feb 21 00:31:24 CST 2001


Andreas Vogl wrote:

>
     
      > > o CF server (attack code): I've noticed that multisquare monsters
     
     >
     
      > >   sometimes don't attack me with melee. They move next to me, cast
     
     >
     
      > >   spells at me, but no melee attack. Any idea why this could happen?
     
     >
     
      >
     
     >
     
      > Where is the monsters logical head located relative to you (logical head
     
     >
     
      > always being the upper left corner of the monster).  I wonder if perhaps
     
     >
     
      > the code is thinking that the monster is not directly adjacent (of which
     
     >
     
      > the head is not), even though it is due to the rest of its body.
     
     >
     
     
     >
     
      This bug doesn't seem to depend on my relative position to the monster's
     
     >
     
      head. I noticed it very clearly when testing "Lorkas", the multi-square
     
     >
     
      angel (and final boss) in Warrior Proving Tower.
     
     >
     
      Sometimes he attacked melee, sometimes not. But he always casted spells and
     
     >
     
      moved around.
     
     >
     
      I'd love to tell you a "reason" for this to happen, but I can't yet.
     
     
 I did notice some suspect code in the move monster area.  The logic is
basically:

 1) Go through all the parts of the monster, seeing if it wants to use any of
its range type attacks from that part.
 2) find the part nearest the enemy, and apply the special movement rules.

 IF the monster does not have any special movement rules, it would use the
direction value from the last part of the monster, which I would think should
work, but result in some odd things.  Think of this case:

 PMMM
  MMM
  MML

 P is the Player, M is the monster, with L being the last space processed.  In
this case, the monster may very well want to move northwest (which I'm not sure
if it would attack the player or not).

 I did add a call in so that we calculate the direction from the closest monster
part, and I think that should make it more intelligent.


>
     
     
     >
     
      Sorry, you completely misunderstood my point (my fault).
     
     >
     
      I referred to the attack-movement here. Not "monster relative to walls",
     
     >
     
      but "monster relative to player".
     
     >
     
     
     >
     
      For example: When I set a certain attack_movement number (think that number
     
     >
     
      was 1), the monster tries to maintain a distance of two squares to the
     
     >
     
      player.
     
     >
     
      But the distance is counted only from the monster's head. Thus, when I
     
     >
     
      approach a 3x3 monster from above (north) - fine it will step away from me.
     
     >
     
      But when I approach it from below (south) - it doesn't step away because
     
     >
     
      head is in 3 squares distance north since monster *is* 3x3. Monster stands
     
     >
     
      close
     
     >
     
      to me, I can easily attack with melee, thus attack-movement algo has
     
     >
     
      completely
     
     >
     
      failed it's purpose.
     
     
 Yes - it was being calculated from the head, and not the nearest part.  that
was easy to change.

 I do notice that even with that change, once the player has closed to be right
next to the monster, the monster will not move away at that point and instead
attack.  But if its a few spaces away, it will try to keep that distance.

 This is probably an intelligent approach - most players move faster than the
monsters, so if the monster tried to move away, chances are the player would
pound it while it does so.

    
    


More information about the crossfire mailing list