Jump to content
The Dark Mod Forums

AI closing (or not closing) doors


grayman

Recommended Posts

In 1.04, AI always close doors, whether they find them open or closed. I thought this was useful for performance, but there might be cases where this behavior isn't desirable.

 

A little while back, Tels and I were discussing how to give more control of this to mappers. We concluded that a door could have a spawnarg defining its need to stay closed, which could be expressed as a probability between 0.0 and 1.0. And an AI could have a spawnarg defining how often it closes doors, which also could be expressed as a probability between 0.0 and 1.0.

 

If an AI's setting is "0.0", he never closes doors, and it wouldn't matter what the door setting is--the AI would not close it. This is useful for zombies, who don't know doors from ... well ... whatever. (They still use the door-opening animation, but that's a different problem.)

 

If an AI's setting is something other than "0.0", and the door's setting is "1.0", the AI will close the door regardless of his own setting.

 

For any other combinations, the probability of closing the door would most simply be the average of the door and AI settings.

 

Since AI on a door queue will defer to the last AI in line, this behavior only pertains to the last AI through the door.

 

This would allow mappers to make specific settings for AI and doors as needed.

 

Any comments or other situations you can think of?

 

Thanks.

 

 

Link to comment
Share on other sites

Offhand, no, apart from the "do not close door in some special circumstances" (like running, fleeing, combat etc), which I think would be a sep. code branch, anyway.

 

Well, ok, one thing *might* be useful, namely controlling this setting dynamically (e.g. "make the AI leave the door open at map start during the cinematics, then set the setting to 0.9" so that later this AI closes doors normaly, just not the special door at the start (and if later any AI comes to that door, they'd also close it).

 

However, this just needs either a new scripting event, or the spawnarg must be read out every time the AI decides whether to close the door, both cases would work without any change the the setup you lined out above at all.

 

(One more thing, how does this pertain to "close this door if you do not have enough space"? For instance, if an open door blocks the AI, they would need to close the door. Do we want to keep this sep?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

In my opinion, it's overkill to have a random chance on both the door AND the AI.

 

I'd do it like this:

 

Doors are set to "always close" by default. Mappers can set them to "never close" if they wish to have a special door not be closed by AI for some reason.

 

AI would work as you mention, with a spawnarg ranging from 0 to 1. If set to 0, he opens doors but never closes them. If set to 1 (presumably the default), he always closes doors (unless door is set to "never close", or he is running). If a value in between, he has a random chance of closing the door (unless door is set to never close or he is running).

 

If running (regardless of the reason), AI should never stop to close doors. Probably he should not close doors if searching, either.

Link to comment
Share on other sites

Seems a bit like a solution/feature for a problem/gap that doesn't really exist. It also sounds a bit too 'random' for a fairly important design area, probability is something players dont like having to guess in most situations. (edit: beaten)

 

However if it could be expanded to include the investigation of doors that should be open/closed, we already have this, however it seems underused and slightly frilly to really use... Then I could see it being a good idea :)

 

My version would amalgamate the ideas into something like this :

 

door:

  • 3 - Completely ignore, should always be closed
  • 2 - Should be open
  • 1 - Should be closed
  • 0 - Default (close if not chasing/fleeing/searching)
  • -1 - Investigate if close (and make sure its open)
  • -2 - Investigate if open (and close once done)
  • -3 - Don't close when traversing (you seem to want this, I guess storyline areas it has a role)

npc:

  • 2 - Only deal with doors which should be open/closed explicitly (see above), useful for important patrols/nobels
  • 1 - Alerts guards rather than investigating a door which should be open/closed explicitly (see above), useful for Civilian/unarmed
  • 0 - Default
  • -1 - "Born in a barn"

 

As always : It's really late, I don't actually have any say in these matters and my design ideas are generally questionable :)

Link to comment
Share on other sites

In 1.04 (and earlier), AI don't close doors when their alert level is 'Investigating' or higher. This covers combat.

 

 

And just today I added not closing doors when running, for whatever reason.

I'm not sure how "door's in the way" matters, because from what I've seen in testing, AI will try to open the door to clear the condition. Perhaps I need to chart out what the code is trying to do.

 

 

Since we have such varied ideas on this topic, I'll need more people to chime in before deciding what to do.

Link to comment
Share on other sites

In 1.04 (and earlier), AI don't close doors when their alert level is 'Investigating' or higher. This covers combat.

 

 

And just today I added not closing doors when running, for whatever reason.

I'm not sure how "door's in the way" matters, because from what I've seen in testing, AI will try to open the door to clear the condition. Perhaps I need to chart out what the code is trying to do.

 

I was more thinking along the lines "door is half-open" and the half-open door blocks a corridor, but when you open the door, this does not get better, only when you close (!) it. I had such an issue in my old mill map where an open cupboard blocked the AI path upstairs, here the AI needs to close the cupboard (or jump over the small 20cm high cupboard door, which I don't think they can do) to go upstairs.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I'd like to add to the above that, if it's possible, alerted and possibly running AI slam the door behind them. That is, just cut out the close door animation but don't cut out the actual closing of the door. If I see an alert AI running to a door and opening it then running through and the door shuts immediately behind them I'm sure it would look like they just gave it a pull as they went through.

 

Also if undead did the above all the time that would be fine by me.

 

I stressed 'add' because you can still have spawnargs to do other related stuff. We've already got quite a few.

Link to comment
Share on other sites

i don't know if is already in this way(because i played on TDM for a little) but i think it would be more realistic, if AI try to investigate on a door (open or closed) who is in a "wrong position"..

 

if it has to be closed (because i forgot it), and AI find it open ..investigate and close it after

 

if it has to be open (because i closed it in order to get the room dark, for example) , and AI find it close ..investigate and open it after

 

 

even if AI don't investigate..i think they should put doors at the "beginning conditions"...more realistic

Edited by guido81
Link to comment
Share on other sites

i don't know if is already in this way(because i played on TDM for a little) but i think it would be more realistic, if AI try to investigate on a door (open or closed) who is in a "wrong position"..

 

That functionality is already in place.

The mappers can flag doors to be important and AI will react if the player leaves them open.

 

Many mappers haven't used it so far, though.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Many mappers haven't used it so far, though.

 

Or rather: Only a few select mappers have used it so far. I can only name Carnage right away, and I seem to remember that one or two other FMs where that feature was used, but it's always surprising to me that it's not more heavily used.

My Eigenvalue is bigger than your Eigenvalue.

Link to comment
Share on other sites

Or rather: Only a few select mappers have used it so far. I can only name Carnage right away, and I seem to remember that one or two other FMs where that feature was used, but it's always surprising to me that it's not more heavily used.

 

I haven't used it due to AI flaws. AI spots door open, goes into alert and searches around 5m radius of the door, almost 100% fruitfully, because the player is never hiding at the door. He is hiding in the room to which the door leads but the AI does not search the room, only the immediate surroundings near the door. This is if I remember correctly. This may have been changed into more intelligent behavior in later updates.

 

The suspecting door search would be better if the AI could somehow was clever enough to check the shadows near the door instead the door surroundings. This applies to general AI searching too, for example when an AI spots a corpse: they search the well-lit areas near the suspicious object but do not examine the shadows, which would be the most obvious thing to do. The system should somehow be able to put search waypoints more likely in darkness.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

if it has to be closed (because i forgot it), and AI find it open ..investigate and close it after

 

I would also love to see this for containers. It always annoys me in T1/T2 that AI's don't take notice of treasure chests being open. Would be cool if AI's in TDM could take notice and start search. Or is such AI behavior already possible but up to the mapper to implement and not used so far?

Edited by fllood

"To rush is without doubt the most important enemy of joy" ~ Thieves Saying

Link to comment
Share on other sites

I would also love to see this for containers. It always annoys me in T1/T2 that AI's don't take notice of treasure chests being open. Would be cool if AI's in TDM could take notice and start search. Or is such AI behavior already possible but up to the mapper to implement and not used so far?

 

or also for big treasure on tables ecc (like a mission of a crown..i don't remeber the name).....

Link to comment
Share on other sites

This applies to general AI searching too, for example when an AI spots a corpse: they search the well-lit areas near the suspicious object but do not examine the shadows, which would be the most obvious thing to do. The system should somehow be able to put search waypoints more likely in darkness.

 

They're actually supposed to do exactly that, though I'm not sure they are atm.

Link to comment
Share on other sites

The mappers can flag doors to be important and AI will react if the player leaves them open.

How do I do that? I fail finding the info on the wiki or here.

(suspicious triggers seam not to work on doors or chest lids unless I do something wrong)

 

btw. I like that planed control settings in the initial post grayman.

Edited by fllood

"To rush is without doubt the most important enemy of joy" ~ Thieves Saying

Link to comment
Share on other sites

How do I do that? I fail finding the info on the wiki or here.

 

"shouldBeClosed" is used to see if the door is supposed to be closed. AI will be alerted by "AIUSE_DOOR" entities that are open and have this spawn argument set to a non-zero value.

 

http://wiki.thedarkmod.com/index.php?title=AI_Use_Tags

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

How would you actually get an AI to notice treasure be gone, as a condition on treasure could not be read by the AI after you've taken it as there would be nothing there. It would mean having to put a invisible entity there with the treasure that could only be seen by the AI, and would get the condition treasureherebegone true condition set on it when treasure get taken.

 

But should a AI notice when a locked door has been unlocked, or when a key they had for locked door that's now unlocked is no longer being carried by them. As if they still have the key then the door was unlocked by another AI with the key.

Link to comment
Share on other sites

Link to comment
Share on other sites

Somewhat related to this discussion, is there a way to configure AI so they don't turn around (and briefly face the direction they came from) when closing a door? It's weird bouncing between Thief and TDM, this completely takes me off guard when playing TDM and I'm trailing a particular AI.

Link to comment
Share on other sites

Closing the door involves reaching toward the door, and it's most natural if they face the door when they do that, so it's coded that way. There is no way the user can alter that.

 

I don't recall what Thief AI do when they close doors.

Link to comment
Share on other sites

Thief AI don't turn around at all. In fact, I don't think they even stop when going through a doorway (they might pause a bit while opening a door, but not when closing it). This seems far more natural to me than what TDM AI do, which is - stopping, opening a door, walking thru, stopping again, turning 180, closing the door, turning 180, continue walking. Does anyone IRL ever do this when not locking the door behind them?

Link to comment
Share on other sites

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

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...