NPCs and Locked Doors

Feedback on past, current, and future development.
User avatar
Greendogo
Posts: 1467
Joined: 26 Aug 2011, 02:04

NPCs and Locked Doors

Post by Greendogo »

Sometimes you get between an NPC that actively wants to attack you and a locked door (say you lock a door using a spell). If that NPC has a lockpick or an unlocking spell (that they can use given adequate skill, I guess), when the NPC makes a check to open the door initially (which is something I expect all aggressive NPCs do when there is an unlocked door between them and their target), if it is locked and they possess a way to open the door themselves, they should try to do so until they run out of lockpicks or magicka or if the door opens in another way or if they get interrupted by something else.

All this requires is a change to the code dealing with NPCs opening regular unlocked doors to check if the NPC has a way to open the door themselves and then to tell the NPC to use that method until they should stop.

You'd probably start by putting in an "else if" option in this code here:
https://github.com/OpenMW/openmw/blob/m ... ge.cpp#L87
I imagine the NPCs would only want to open a locked door when they are attacking someone, not when they're just walking around.
Cramal
Posts: 186
Joined: 19 Sep 2014, 13:37

Re: NPCs and Locked Doors

Post by Cramal »

I'm not sure this is a good option because it will open door that the PC couldn't open on his own.

For example in the Vaults in Vivc there is a lot of highly locked door and a bunch of guard inside. If you attack a guard and then all guard leave the valut opening all dors to fight you, the vault will be left totally open and much easily accessible than in Vanilla MW
Golken
Posts: 27
Joined: 04 May 2015, 05:03

Re: NPCs and Locked Doors

Post by Golken »

Cramal wrote:I'm not sure this is a good option because it will open door that the PC couldn't open on his own.
It is a potential downside, but it would happen rarely, and most likely wouldn't be possible in your example, because none of the guard NPCs would have a lockpick and/or good Security skill, neither would they have high Alteration and an Open spell or scroll (I guess the spell part would be okay to abstract away though - if their respective magic school skill is good enough then they're automatically assumed to have a spell - or include spells in autocalc'd NPCs, but that would miss some).

Hmm, I heard that in vanilla Morrowind, NPCs already automatically unlock doors to get at you, if they have the key to the door in their inventory. Could very well be, as the key-unlocking could be part of the normal activation function. Interesting.

Anyway, NPCs having more options and being smarter, and being able to do more stuff that the player can, should be a goal. :)
Another potential thing to do is to have fleeing NPCs use a Lock spell on doors to prevent the player from following them, if the player is far enough while the NPC is crossing the door threshold.
User avatar
DestinedToDie
Posts: 1181
Joined: 29 Jun 2015, 09:08

Re: NPCs and Locked Doors

Post by DestinedToDie »

/me pictures NPCs bunny jumping around caves in 1.73B.
User avatar
Jyby
Posts: 408
Joined: 10 Dec 2013, 04:16

Re: NPCs and Locked Doors

Post by Jyby »

Perhaps there could be some spiffy AI written to do this right. We currently dont have a way for NPCs to communicate with each other and strategize. This has major potential for OpenMW 1.0 as this will allow for some complex fight scenarios and could tip the combat balance in the NPCs hands.

EDIT: For example the AI could ask the question, "What are my friends doing? Should I leave my location to help them fight?"

EDIT EDIT: Correction there is basic communication for reporting crimes and asking friends for help. It exists in a horrible part of the code right now though and it should be moved to AI logic.

If we decouple AI from the rest of the game mechanics we can do some pretty advance stuff.
User avatar
DanielCoffey
Posts: 43
Joined: 20 Jun 2015, 11:14
Location: Edinburgh, UK

Re: NPCs and Locked Doors

Post by DanielCoffey »

What is OpenMW's self-imposed remit for being faithful to Morrowind behaviour vs "improving" on it?
Cramal
Posts: 186
Joined: 19 Sep 2014, 13:37

Re: NPCs and Locked Doors

Post by Cramal »

Because "improving" a behavior is always subjective.

Copy MW avoid endless debate about if this feature have to go this way or this other way.
User avatar
sjek
Posts: 442
Joined: 22 Nov 2014, 10:51

Re: NPCs and Locked Doors

Post by sjek »

without even going to AI pursuit and door handling :lol:

magic system overhaul easiest maybe. if somebody sneaking to your back and pickpocket while casting paralysis and is the guards better just use line of sight or randomises success at spotting

one mod adds dozens but it ends up no good filters when to steal so thief hunting extravaganza

with new MWSE array, string and inventory functions it could be possible with referencing unloaded cells and using same functions for unlocking doors adding maybe open lock spell 100 pts. there would have to be then some way to suppress that from the AI in other situations. or just a handle opendoor or something. which would be most perfomance friendly
User avatar
Jyby
Posts: 408
Joined: 10 Dec 2013, 04:16

Re: NPCs and Locked Doors

Post by Jyby »

DanielCoffey wrote:What is OpenMW's self-imposed remit for being faithful to Morrowind behaviour vs "improving" on it?
I understand some people will get upset if we change the game. I think all extra features we add (except for no brainer improvements) will be turned on in the settings files. For example you can show the time you've spent playing the game by turning on a setting.

In general, it's up to all of us to determine what gets added to the game.
User avatar
sjek
Posts: 442
Joined: 22 Nov 2014, 10:51

Re: NPCs and Locked Doors

Post by sjek »

and once in dehardcoding it will be a modded game :D
Post Reply