Jump to content
The Dark Mod Forums

Recommended Posts

Posted

I'm doing the final passes on a map I'm working on, but I've encountered a behaviour that I'm not sure how to deal with.

Whenever AI try to pathfind through locked doors they can't open (for example fleeing to a flee_point, guards searching after spotting the player) my framerate drops dramatically. I can usually get a pretty consistent 50-60 fps, sometimes small dips to 30-40 when looking at complex/distant areas, but when the pathfinding problem happens the framerate drops down to 10 or 11, noticeably slowing gameplay.

The framerate dips are temporary, and usually end when the AI either stops trying to go through a locked door or just gives up and returns to patrol. This is generally happening in the "outdoor" part of my map. I admit I've made a cardinal error in not properly optimizing the outdoor areas as per best practices (visportals and dividing areas into blocks with curved entrances etc), but the map runs just find when AI are on their regular patrol routes. Only when they're trying to get through a door they can't open do I have problems.

I would have thought the AI wouldn't even try to pathfind through a locked door, but in any case... is there anything I can do to address this? Any flags I can put on doors or visportals to discourage AI from even attempting to go through doors they aren't supposed to?

Posted
3 hours ago, Jnon said:

I would have thought the AI wouldn't even try to pathfind through a locked door, but in any case... is there anything I can do to address this? Any flags I can put on doors or visportals to discourage AI from even attempting to go through doors they aren't supposed to?

You can give the doors in question the following property and check if it makes a difference:

ai_should_not_handle - 1

 

 

Posted
16 hours ago, datiswous said:

monsterclip?

Unfortunately, this would block all the AI, and there are some I'd like to still be allowed through.

 

16 hours ago, JackFarmer said:

You can give the doors in question the following property and check if it makes a difference:

ai_should_not_handle - 1

 

 

I assume this would also block all AI and not just those without keys or a can_unlock flag...

Thank you for the suggestions. For the time being, I'm going to just give all AI in the same area as that door the "can_unlock" flag and hope nobody from too far away gets kited into that area.

I assume what's happening is that the AI wants to get to the other side of the door, can't, and tries to map alternate paths to get inside which ends up scouring the entire "outdoor" area (one large zone for the entire map not including visportaled/location boundaried "indoor" areas) which taxes system resources. In future I'll make sure to read the fine manual before I sink six months into a map 😅

Posted

Actually, I take it back. ai_should_not_handle on a few key doors is a much better solution. Inside guards stay inside, outside guards stay outside. Doesn't make sense for the City Watch to burst into a manor house uninvited just because they think they saw a thief on the ledge outside after all.

Posted (edited)

What is the effective difference between setting ai_should_not_handle - 1 and putting some monsterclip around the door?

Also does a guard take ai_should_not_handle into account when alerted?

Edited by datiswous
Posted
53 minutes ago, datiswous said:

What is the effective difference between setting ai_should_not_handle - 1 and putting some monsterclip around the door?

From what I could tell, ai_should_not_handle prevents the AI from ever trying to open the door and prevents it from considering the area behind it traversible, so long as the door remains closed. If it's ever opened (by the player) they are then able to pathfind through it. Monsterclip would be a permanent invisible wall for them, even if the door were opened.

 

54 minutes ago, datiswous said:

Also does a guard take ai_should_not_handle into account when alerted?

Based on my last round of tests, even when alerted they couldn't open the door or go through it. There was some odd behaviour where they milled around in front of the door as though they wanted to go through it, but they never actually tried.

  • Like 1
Posted

Just to follow up on this, in case anybody has similar problems in DarkRadiant and needs to troubleshoot, I found several other instances of massive framerate drops. While I originally thought they were caused by AI trying to navigate busy terrain, I found that in almost every instance so far they're caused by vocal alerts from AI being heard by other AI on the far sides of doors, which they could not traverse (either because of locks and keys, because of monsterclip, or because of ai_should_not_handle flags). The AI trying to run and investigate the suspicious area could not pathfind to it, and the game suffered sharp lag because of it.

I found an easy fix for this was to use sound_loss on the infoLocationSeperator for visportals on doors causing problems. I set them to 60, which made it impossible for AI on the far side of the door to hear anything. So far, this has reliably fixed all my framerate drop troubles.

  • Like 2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
    • JackFarmer

      What do you know about a 40 degree day?
      @demagogue
      · 4 replies
    • jivo

      I just uploaded a new version of the Visible Player Hands mod. It's been updated for TDM 2.13 and has new animations. Check out the post if you're interested!
      · 0 replies
    • datiswous

      I moved from Manjaro Linux (rolling release) to Linux Mint (LTS). One of the reasons was that I found the updates a bit too often and long. But now on Mint I get updates every day, although they're usually small updates.
      · 6 replies
    • JackFarmer

      "Hidden Hands: Vitalic Fever" - new update available including subtitles & compressed briefing video (thanks to @datiswous) and several fixes.
      · 0 replies
×
×
  • Create New...