Jump to content
The Dark Mod Forums

New way for AI of closing doors


SeriousToni

Recommended Posts

I don't know if this has ever been discussed or if it came to your mind, but what if there were two ways for an AI to close a door behind it after walking through?

 

At the moment the AI opens a door, walks through it, turns back to the door, closes it, turns around again and walks away. This has the advantage for the player that he has a chance to blackjack the AI from behind, while it is busy closing the door.

 

An alternative could be that the AI opens a door, walks through it, makes a "walk-by-and-close" animation and walks straight on while the doors slaps behind it.

 

I can imagine to use this for the "expert mode" where the mapper can set a spawnarg that activates the "slap the door mode", which woudl make it harder for the player. I even could imagine give this spawnarg only to some AI and to others not in a map. I would not recommend a random approach where the player never knows, though.

 

This was just a quick and silly idea, maybe you guys had the same thoughts someday and want to share them here :)

  • Like 1

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

the object door_handling_position controls where ai stands to open and close doors, and it can also be added to spawnarg's on the door object. so you would have to add spawnarg's to those to objects for the AI to slap the door shut, or maybe not, not sure. Doors auto shutting is controled by a spawnarg on the door.

 

Although in real life, most of the people I known must live in barns, as they never shut a door after they go through it. Doors are usually shut in TDM because too many open doors cause too much to be drawn at one time game lag.

Link to comment
Share on other sites

1 - We need 2 animations for the AI to slap the door shut as he goes through: one with his left hand, and one with his right. The right-hand animation would need to account for carrying a weapon.

 

2 - We need a spawnarg on the AI that says this is his preferred method of closing doors

 

3 - We need to change the door handling code to recognize that spawnarg and do the right thing

 

If someone would make the animations, I could handle the rest.

Link to comment
Share on other sites

"I would not recommend a random approach where the player never knows, though."

 

I would. That would be more realistic and make the AI that much more unpredictable. Sometimes they would turn around and close it, sometimes they would just flip their arm to close it while they're continuing to walk away, the way a lot of people do in the real world.

--- War does not decide who is right, war decides who is left.

Link to comment
Share on other sites

"I would not recommend a random approach where the player never knows, though."

 

I would. That would be more realistic and make the AI that much more unpredictable. Sometimes they would turn around and close it, sometimes they would just flip their arm to close it while they're continuing to walk away, the way a lot of people do in the real world.

 

If I imagine, what would happen if it would be chosen randomly, it will outcome for me that this is not a good idea, because:

  • When you never can be sure that the ai will turn around or just slap the door, you will never even try to black jack it, because
  • you tried in the beginning and got lucky sometimes and other times not which caused you to,
  • get frustrated and reload, or
  • get busted and hunted down just because you tried to black jack the enemy for browse, and
  • you get even more angry everytime you see you would have had the chance to knock him out but you didn't because you could not be sure to do it.

If you CAN be sure that this ai only slaps the doors, and this one does not, then you know how your chances are, which wouldn't be frustrating.

 

Imho it isn't all about being realistic, but being more varied and gameplaywise. :)

 

EDIT: When I remember the black jack bug, it was the same situation: I could never be sure if the bj works or not, so I was very frustrated at the start, and I didn't even try it in the end anymore.

Edited by SeriousToni

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

Another thought: I'm not even sure I support it, but I want to bring it up for analysis.

 

Non-combatants would, by default, walk through the door and just slap it shut. They are busy to get to the next location to do their non-combatant stuff.

Guards, etc, would walk through and turn to close the door to make sure it is closed. Security is their job, after all.

 

Special case: locked door would have a special animation. AI grabs something from his belt, reaches his hand at the door and does turning moves with his hand as if he is unlocking the door. Then he walks through and does the same "lock door" animation on the door before leaving. The animation could be accompanied by loud chime of keys and key turning in lock sounds. This would give locked doors new gameplay purposes: the player hears the keys chiming in advance before the guard pops into a room the player is hiding in (if the door is locked). Also player could lock doors deliberately and exploit the time AI uses to unlock/relock the door to get a sweet KO. If the AI is fleeing, they would still get to open the door quickly like they do now so that locked doors would not break entirely AI flee behavior.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

AI grabs something from his belt, reaches his hand at the door and does turning moves with his hand as if he is unlocking the door. Then he walks through and does the same "lock door" animation on the door before leaving. The animation could be accompanied by loud chime of keys and key turning in lock sounds. This would give locked doors new gameplay purposes: the player hears the keys chiming in advance before the guard pops into a room the player is hiding in (if the door is locked). Also player could lock doors deliberately and exploit the time AI uses to unlock/relock the door to get a sweet KO. If the AI is fleeing, they would still get to open the door quickly like they do now so that locked doors would not break entirely AI flee behavior.

 

We already have something like that, but it doesn't work properly as I remember, see here:

http://forums.thedarkmod.com/topic/13084-ai-attach-keys/page__view__findpost__p__276059

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

I think AI using their keys to unlock doors works fine, if everything's set up correctly. If you have a test map that shows otherwise, I'll be happy to look at it.

 

I like the idea of adding the jingling and the wrist turning before the door starts to opens, or after it's been closed. We'd need a new animation: copy the current "reach out" animation, and add a wrist turning bit with jingling at the point where the hand is farthest from the body. (Or we can skip the turning wrist; might look okay w/o that.) The door handling code would decide whether to play the current animation (door unlocked) or the new one (door locked). If locked, delay the door opening for the length of the jingling sound.

 

All we need is the new animation.

Link to comment
Share on other sites

I tried to make a testmap regarding http://forums.thedar...post__p__276059 but I can't reopen it in Dark Radiant after the first test again. Parsing error! What is this?

Rename it to keybelt.map to work.

keybelt.txt

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

I tried to make a testmap regarding http://forums.thedar...post__p__276059 but I can't reopen it in Dark Radiant after the first test again. Parsing error! What is this?

Rename it to keybelt.map to work.

 

Open the map in a text editor

Under both entity 4 and entity 11 change

"set inv_name on door_key" ""Door Key""

to

"set inv_name on door_key" "Door Key"

without the double quotes

 

edit: too late

Edited by Jesps
Link to comment
Share on other sites

In your test map, the guards go back and forth through the door, unlocking it and locking it as expected.

 

If I steal both their keys when the door's locked, neither can open it.

 

If I steal both their keys when the door's open, it doesn't get locked again, and they open and close it w/o any problem.

 

This is what I would expect to see.

 

Were you expecting something different?

Link to comment
Share on other sites

Can't say I agree that random slamming of door would be that bad.

 

But I don't wait for them to play the close door anim to bj (if i bj at all). Maybe it should just be hard difficulty?

 

I also don't think only guards should do it. Some guards are lazy...

Dark is the sway that mows like a harvest

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

    • 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
       
      · 1 reply
    • 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
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...