Announcement

Collapse
No announcement yet.

AI guards opening non-guard-openable doors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • AI guards opening non-guard-openable doors

    Ok, basically, there is a known bug that lets an AI open any door regardless of its lock status. It wasn't fixed in 1.3.

    So, what causes this bug? Here's the offending code from the ThBot.uc script, in the function GoThroughDoor:

    // Thievery doors
    if(door.IsA('ThDoor') && ThDoor(door).OpenDoor(self) != 0) //<== This is the buggy line
    {
    //SpecialPause = door.DelayTime + door.MoveTime;
    DropHeldFlare();
    GotoState('FrobDoor');
    return true;
    }
    // Normal Unreal doors
    else if(door.HandleDoor(self))
    {
    GotoState('FrobDoor');
    return True;
    }

    What happens is that because of the AND in the if statement, if the door is a ThDoor, and it fails to open (due to being locked and not openable by guards), it will just drop down to the next if statement which treats the door like a regular mover. It makes the bot totally disregard the lock status, and let's them waltz right through a locked door with no problem.

    So, how to fix it: Here is a reworked bit of the above code, which I belive fixes the bug.

    // Thievery doors
    if(door.IsA('ThDoor'))
    {
    if (ThDoor(door).OpenDoor(self) != 0)
    {
    //SpecialPause = door.DelayTime + door.MoveTime;
    DropHeldFlare();
    GotoState('FrobDoor');
    return true;
    }
    return false;
    }

    The two changed lines are all that is needed to keep an AI guard from opening a door he shouldn't be able to. I've tested the script and it seems to work, but I'm not sure I can fully qualify this as perfect...maybe Joel can say for certain.

    I would like to hear some feedback on if this bug is actually serious enough to require inclusion in a patch. The map I'm designing does have some doors I want to keep AI from going through, and I can subclass the ThDoor script easy enough to keep this from happening, but that in itself has some serious problems.

    Also,this would fix the apartment doors in ThSpider.

  • #2
    I have been waiting for you to post this. Good work MO. If it works properly, I hope Dalai and the Boys take a good look at it.

    Kiech
    www.thecrackaz.com
    Kiech

    Comment


    • #3
      Just a clarification, in case there was any confusion, I didn't remove the unreal door handling script bit in the fixed code, I just included it in the original to illustrate what happens with the bug. The unreal door mover handling should remain in the fixed code.

      So um, yeah...just so you know I didn't fix it by clobbering the unreal door code...

      Comment


      • #4
        The code was by design, in that I'd rather have bots walk through locked doors than have them get 'stuck' on a door that they are trying to go through.

        I had looked into ways of making them choose alternate paths, but gave up after a fair whack of effort and moved on to other things.

        Seeing as you've gone to the effort of producing a solution, I'll put your code in and see what behaviour the bots come up with. I don't think there are too many doors the guards cannot pass through that would also give cause for a bot to try to enter, so this will probably be implemented in 1.4. The apartments shall be safe again!

        Thanks for the info, eagle-eye
        AI Programmer,
        Thievery UT

        Comment


        • #5
          Originally posted by ElJoelio
          The apartments shall be safe again!
          Dang
          "There's no problem that can't be solved with a big crate!"

          Comment


          • #6
            Originally posted by Bloody-Reaper
            Originally posted by ElJoelio
            The apartments shall be safe again!
            Dang

            Oh go build something with a crate.
            Genius is a blink before a moment of insanity.
            "Dream is Destiny"
            Waking Life

            Comment


            • #7
              Originally posted by Curunir
              Originally posted by Bloody-Reaper
              Originally posted by ElJoelio
              The apartments shall be safe again!
              Dang

              Oh go build something with a crate.
              The only crates in Spiders are so big they cant be moved... Not even by the builder.
              (How the hell did they get in there in the first place?)

              Comment


              • #8
                Some say it was the Gods, some say it was Merlin, some say that it was aliens, some say it shall never be explained... I think it had to do with someone named Joel Malone...
                Genius is a blink before a moment of insanity.
                "Dream is Destiny"
                Waking Life

                Comment

                Working...
                X