Jump to content
The Dark Mod Forums

Should AI be given better long-term alertness?


MirceaKitsune

Recommended Posts

TDM was never meant to be fully realistic, it would become impossibly difficult were that the case. None the less I still find myself wishing more could be done to make AI feel less like AI, especially when handling hostile encounters (usually the player). While like most aspects this could never be truly perfect, one area feels like it could be noticeably improved: Giving AI some form of long term memory, rather than just one alert level which goes back to zero after a short time.

Here is the reason why I'm saying this: Walk inside your average heavily guarded mansion and step into the bright lights, making all the guards clearly see you and chase after you to attack. Once you've had enough fun repeating the process, hide somewhere and give everyone enough time to cool down. At the end of it all, hide somewhere in the shadows where you can barely be seen and let a guard walk past you: The guard will just say "is there something over there", at best waiting a few seconds and saying "probably just the shadows" before walking away... the same man that may have chased after you for 30 minutes and should by any logic know an intruder is still in the house, I mean come on :D

Now I'm aware we have a basic persistence system: If I remember correctly an AI that's encountered the player and was alerted enough to draw their sword will have its acuity permanently increased by a slight amount. This however makes no noticeable difference as the AI behaves mostly the same. They'll keep telling fellow AI an intruder is in the area, this definitely helps but it's only a dialogue change not accompanied by noticeable modifications in behavior as you'd expect.

Obviously massive modifications might be hard to do now without upsetting existing players since it would make everything harder. As such any such attempt would likely be an experiment and, if successful, a new menu option for the difficulty settings. Still I felt like suggesting my imagined solution just in case there's a point in considering tackling this.

My idea: Replace the one-time bump in acuity with a paranoia level independent from the alert level... think of the existing alert system as short-term alert and the new one as long-term alert. The standard alert level of guards is slowly added to their paranoia level, thus the more time a guard spends being alert and the higher that alert is the more fear increases. Paranoia level may be allowed to decrease over time but at a far slower rate than the alert level: If an alert guard will typically take 3 minutes to fully calm down after losing track of the player, the paranoia level should take at least 30 if not 60 (real life) minutes to fully go down to minimum... even then it shouldn't drop below a certain degree after that point was reached, for instance just 50% of the maximum paranoia. This long-term fear level would have several effects on an AI as they patrol on their normal route... the ones I've thought about are:

  • Increased acuity as they'll be more alert. This system would replace the existing simple bump we have in that regard, with a more fluid effect and also stronger effect.
  • Increased playing of voices and idle animations: Due to being afraid the guard may talk to themselves or others a lot more frequently and babble excessively.
  • Walking could be replaced by running for a while, even on path nodes that don't have the run flag. The AI would still patrol that same route just at a faster pace.
  • As a map feature set by FM's: Some path nodes can be filtered by fear level, may already be possible with the simple system but I never tried it. An AI paranoid the player is still around but having resumed their normal patrol route may choose to patrol a more sensitive area it normally wasn't going to, which would be a fair way of punishing the player for being seen by having that AI start guarding a sensitive location from then on. If the paranoia level is allowed to slowly decrease, the guard may decide to go back on this decision... the player could then do something else for 15 minutes around the map till the guard abandons the paranoid patrol route.
  • Here's an idea I like: AI randomly getting scared for no reason, thinking they see the player in every shadow even when there's nothing there. A scared guard normally walking on their patrol route would randomly become alert for no reason, typically when walking through a dark area, causing them to draw their sword or randomly run around for a second. The problem here is this effect would be random: Imagine you're hiding accordingly but a guard randomly freaks out and bumps into you, most players would find this unfair.
  • Like 1
Link to comment
Share on other sites

Edit: Spoilered because no one likes hearing Casandra's prophecies. I'll just say some of you guys need to get your heads out of the sand on what's happening with AI. It's not the end of the world, but it could definitely be the end of your world if you fail to heed the steamroller rumbling towards you. There is ample evidence out there to determine who is being honest and who is spreading self-serving lies, you just need to get over your own biases and look for it.

Spoiler

If anyone thinks this is derailing this very worthy thread just say so and I will delete it… but I’ll tell you what leapt into mind upon reading the title: fully sapient GPT AI powered guards!

Imagine the possibilities. NPCs who react realistically to discovering their numbers being thinned out; grouping up to hunt the player, running to alert their command chain or guard the treasure, and maybe retreating entirely to hide in some defensible corner once enough of them are picked off. Hell, it would even be possible to hold natural conversations with them like those Skyrim demos. Maybe you could bribe a guard into giving you a hint or looking the other way. Maybe you could scare them into running off just with threats from the dark.

 

I couldn’t resist picking GPT-4’s circuits about it. Check out the conversation: https://chat.openai.com/share/2b7626fd-307b-4c8c-bb58-780056d1303a

The technology to do this is not here yet. The AIs are more than smart enough if you use good prompt engineering (see GPT-4’s plan for being a guard) but the latency is prohibitive. (Plus the server time is not cheap.) But it is coming, probably in as little as 2-3 years. If TDM could capitalize on this it could make serious waves! It’s also something you guys should start thinking about now. Murdering vaguely human automatons is one thing, murdering NPCs with unique thinking and speaking personalities might be something else. What was it that Dr. Ian Malcolm said?

 

Edited by ChronA
  • Confused 1
  • Sad 1
Link to comment
Share on other sites

Isn't it already possible to modify ai alertness behavior via scripting? I thought @Dragofermade modifications for Iris for example.

It would be nice if it's possible to implement different ai profiles via prefabs or other ways.

(Btw. I think your topics and posts tend to be very long, so often I don't read everything of it)

Edited by datiswous
Link to comment
Share on other sites

4 hours ago, datiswous said:

Isn't it already possible to modify ai alertness behavior via scripting? I thought @Dragofermade modifications for Iris for example.

It would be nice if it's possible to implement different ai profiles via prefabs or other ways.

(Btw. I think your topics and posts tend to be very long, so often I don't read everything of it)

Sorry for that: I try to be short but at the same time detailed and it ends up as the later. Scripting can accomplish some of this if you need it to, such a core change should of course be done in root if possible, not sure how radical it would be at this point in time though given it would involve gameplay / difficulty changes. Curious what others think and if anyone has even better ideas on the basis of my suggestion.

Edited by MirceaKitsune
  • Like 1
Link to comment
Share on other sites

I like the idea that AI should remember things longer and get alerted if e. g. other guards are disappearing. Still this would probably make the original game much more difficult if the KO-immunity is turned on by this which means once alertness is high, you are forced to ghosting because nobody can be knocked out anymore! As for the CPT AI idea, this would make TDM be online always which I don't think is a good idea for a single player game...

Edited by wesp5
Link to comment
Share on other sites

5 hours ago, wesp5 said:

I like the idea that AI should remember things longer and get alerted if e. g. other guards are disappearing. Still this would probably make the original game much more difficult if the KO-immunity is turned on by this which means once alertness is high, you are forced to ghosting because nobody can be knocked out anymore! As for the CPT AI idea, this would make TDM be online always which I don't think is a good idea for a single player game...

Definitely no KO immunity per say, don't think that would even make sense here. The idea is for guards who have seen you to show signs of persistent awareness, behaving in a different way from how they normally act before knowing there's an intruder. Some could be mechanical and difficulty altering changes, like guards drawing their sword and searching over circumstances that would have initially made them mumble and move on... others could be cosmetic behaviors that don't much affect gameplay but add more realism, like making paranoid guards use different animations or look around constantly or randomly interrupt their walk cycle to show nervousness and confusion, which would also help the player gauge their long-term alert and know when to avoid a guard that knows what's up.

Also my idea may not require a separate alert field after all. Alert levels are floats: I believe guards still patrol normally until alert reaches 1 which is "AI stops and looks around", we could activate such behaviors at say (alert < 1.0 && alert >= 0.5) then make the alert level taper off more slowly at low values (decreases fast from 5 back to 1 but very slowly from 1 toward 0).

Link to comment
Share on other sites

29 minutes ago, MirceaKitsune said:

Definitely no KO immunity per say, don't think that would even make sense here. The idea is for guards who have seen you to show signs of persistent awareness, behaving in a different way from how they normally act before knowing there's an intruder. Some could be mechanical and difficulty altering changes, like guards drawing their sword...

As far as I know KO immunity is connected to the alert level and when they have their sword out, most of them have it.

Link to comment
Share on other sites

14 minutes ago, wesp5 said:

As far as I know KO immunity is connected to the alert level and when they have their sword out, most of them have it.

That is correct: That's the normal short-term alert level which wouldn't change in functionality. My point was long-term alert shouldn't give an AI KO-immunity directly. If it's one of the desired effects, it would make the AI draw its sword more easily, in which case it would become KO-immune during that time as a consequence.

Link to comment
Share on other sites

On 6/5/2023 at 9:57 AM, MirceaKitsune said:

I try to be short but at the same time detailed and it ends up as the later

Personally I applaud your approach. You take care to to lay out all your premises, inferences, deductions, and conclusions in a comprehensive and well organized sequences. Yes it takes a bit more time to read, but I don't think some of these more complex proposals could be broached any other way. 😁

And despite my digression, I think this idea is a good one. As far as I know, much smarter guard behavior is unexplored territory for FM design. There could be some really cool opportunities for smaller FMs that focus in on the experience of being hunted by a reactive enemy force. (And opportunities for smaller FMs to make waves is something we need, since not every one can make an Iris or a Volta for their first mission.)

I'm with what seems to be the prevailing mood that this behavior should be customizable by the FM author rather than applied across the board. Otherwise you could destroy the difficulty calibration of a lot of old missions (although conversely, some old missions might get an injection of new life from some difficulty tweaks). But either way the first step is to make sure there is engine level support for the options.

On 6/5/2023 at 10:13 AM, wesp5 said:

As for the CPT AI idea, this would make TDM be online always which I don't think is a good idea for a single player game...

This is a good point. Single player games using online infrastructure pisses me off to no end. It's a preservationist's nightmare. But... this might be one case where an exception should be considered. TDM is non-commercial, so it wouldn't be some nefarious dial home to play situation. If someone wants to make a single FM that requires plugging into an online AI service to work that might be considered a worthy experiment...

Spoiler

I understand hesitating to jump onto popular, new technology bandwagons, I have been right there with you guys... microtransaction, 3d screens, VR, NFTs... challenging novelties at best and scams at worst. But this feels profoundly different to me. Human level AI is an enabling technology that I can only describe as ecological in scope. We have never experienced anything like this. Not in our lifetimes, nor in any of our ancestors' going back even to prehistory.

Taking about finite-state behavior trees for game AI right now strikes me as a bit like gathering sticks to sun dry your zebra jerky on when Ugg in the next cave over just discovered fire. It's not necessarily wrong, but you are missing out on a world of new possibilities. TDM is such a perfect community project, it would be a tragedy if it slept through what could be the biggest transformation in digital technology since the PC.

OK... enough AI evangelism out of me! Carry on! 🤐

Link to comment
Share on other sites

I might be wrong, but GPT-kind AI could easily be just another hype like all the others you listed. Yes, they can talk now, but to simulated guard behaviour in TDM, the AI would need to learn this somewhere or look it up. So who would train them for hours?

Link to comment
Share on other sites

Don't want to comment on that chatbot / spambot thing, to me it's just the latest mass hysteria created overnight to further shove the world into madness. But like I said the main reason for my idea is I find the lack of a permanent alert level too unrealistic, even by game character standards; It would be nice if this could be solved without altering difficulty but universally to all FM's. I'm just hoping there's a satisfactory way to avoid having guards literally chase you, you hide and wait 3 minutes for the whole crew to calm down, then 5 minutes after you were just being chased a guard will calmly go "what was there in the shadows, probably just the rats"... that behavior makes them almost as dumb as "chat GPT" :P

For now I wonder: The current behavior to boost NPC acuity after a level 3 alert... is there a spawnarg to customize the amount or is it hard-coded? It would help if at least the FM can increase the offset and make a guard super-alert once they saw you.

I believe another suggestion I made long ago might also be relevant: We have difficulty settings for AI sight and hearing in the menu, but could we have a third option to multiply how quickly enemies give up on searching for you? If you're impatient you could set it to low so AI forget you in just a minute, whereas if you want maximum realism have them still looking even 10 minutes later! Wouldn't be a fix to the unawareness issue once they calm down but this could improve it.

Link to comment
Share on other sites

Things like these add complexity, make missions much more difficult, and also create chaos for players who like order and predictability. Games like these have to be predictable to some degree. E.g., I also never found that long patrol routes, and multiple guards who patrol the same are makes sense. Gameplay has to be predictable to some degree, otherwise it's no fun.

Imagine a game like Splinter Cell with chaotic A.I. behavior. It would be unplayable. And no fun at all.

I already find the cool down phase of A.I. alertness in TDM way too long, at least on the default difficulty and A.I. settings.

Edited by chakkman
  • Like 1
Link to comment
Share on other sites

1 hour ago, MirceaKitsune said:

It would be nice if this could be solved without altering difficulty but universally to all FM's.

Maybe you can modify the AI def files and do some experiments. I just took a look and for example in tdm_ai_base.def there are a lot of alert state parameters:

    // alert_time: is the time it takes for the alert level to ramp down from the upper to the lower threshold (in seconds)
    // alert_time_fuzzyness: applies some randomness to the alert times (in seconds)
    // alert_gracetime: after being alerted, the AI will ignore additional alerts during this time, to avoid adding up the alert level too quickly
    // alert_gracefrac: an alert that is higher than the last increase * fraction will terminate the grace period
    // alert_gracecount: If the number of additional alerts during grace period exceeds the grace count, the grace period will be terminated

 

  • Thanks 1
Link to comment
Share on other sites

On 6/8/2023 at 2:48 AM, ChronA said:

If someone wants to make a single FM that requires plugging into an online AI service to work that might be considered a worthy experiment...

Does it need to be connected to an online service?

I'm not against ai tools, but I think you should only talk about it if you have a good detailed idea how it works and how it could be implemented, especially if you're derailing a forum topic for it. Otherwise it's just buzztalk.

Link to comment
Share on other sites

On 6/8/2023 at 6:59 AM, MirceaKitsune said:

I believe another suggestion I made long ago might also be relevant: We have difficulty settings for AI sight and hearing in the menu, but could we have a third option to multiply how quickly enemies give up on searching for you? If you're impatient you could set it to low so AI forget you in just a minute, whereas if you want maximum realism have them still looking even 10 minutes later! Wouldn't be a fix to the unawareness issue once they calm down but this could improve it.

That sounds like a good proposal to me, since it places responsibility for modulating the difficulty effects fully in the player's hands. I think that is a good solution to the authorial intent problem. However, if you go that route I think a certain amount of cleverness is needed to really make the feature successful.

In most situations, whether guards remain alerted for 30 seconds, 30 minutes, or 30 years makes no difference at all to difficulty. If you successfully get away, you will have plenty of maneuvering room and/or combat tools at your disposal to deal with the heightened threat. It just requires a bit more caution and patience. And if you don't get away, or just can't be bothered, then you will reload and the guards will switch back to unalerted regardless.

Absent a carefully engineered scenario where guard activity patterns adjust depending on alert state (and save scumming is inhibited somehow), this proposed behavior amount to a cosmetic adjustment that most players will never even notice.

15 hours ago, datiswous said:

Does it need to be connected to an online service?

Right now, as a practical matter, yes. There are currently some open source language models that can run on local hardware, but all the ones I have seen lack the ingenuity and self-awareness of GPT-4, which remains the gold standard. I do not think they could make very good guards.

That said, I think it is reasonably likely that we could get to that point with local, consumer grade hardware within 3-5 years. There are a lot of signs suggesting GPT-4 is poorly optimized as neural networks go. Its brain contains a lot of connections that chew up compute resources, but only a small proportion of them do anything useful.

Edited by ChronA
Link to comment
Share on other sites

On the other hand, I can imagine lots of scenarios where the guards wouldn't need to remain extra vigilant. Maybe they're used to turning away beggars, drunks, and nonviolent grifters and therefore don't dwell on it every time they have to chase someone off.

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                                                                                  A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 0 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...