Renault on 26/6/2017 at 20:37
I'm creating a stealth game using another game engine, and have a question on Thief alert states. I thought this would be the best place to ask since this is where the more technical folks hang out.
So, that said - guard alert states. On the first alert state above idle - let's call it "suspicious" - the player will usually get an audio cue, such as a guard saying "What was that noise?" or "What did I see there?" This is of course all based on the player's visibility and sound. But at this point, the guard doesn't actually do anything. If they are on patrol, they stay on patrol. If they are just standing in one spot, they won't even rotate toward the player to get a better look. As far as I can tell, nothing really changes.
So my question is - is anything actually happening here? Are the guard's senses heightened, are they more aware? Or is the only purpose of this state to give the player feedback (in the form of audio) to let them know that they are close to being detected?
Another example - let's say for example when the player is less than 100 feet from the AI, they are in the "suspicious" range, but if they get closer than 50, the guard will begin to search. I know you have to factor light and sound into the equation, but let's keep it simple. So once the player gets less than 100 feet away, is the "search" zone still 50 feet? Or does it increase to something more like 75?
Hope this makes sense, if not let me know.
Unna Oertdottir on 26/6/2017 at 20:59
You could load a OM/FM in DromEd and type
set game_mode_backup 0
into the DromEd console
in addition, load public scripts and put the spy script on the NPC.
that way you can see how the alert states of the guards/Ais are changing.
PinkDot on 26/6/2017 at 21:58
Are you trying to recreate the system from Thief? If you're making something from scratch, why not come up with something different? I'm sure there are better ways to do that, these days.
I was always finding it a bit too easy, the way NPC are giving player a clue to stay hidden and quiet. It's unrealistic definitely for a human to verbalize every thought.
Some games, that incorporate stealth gameplay elements, do the suspiciousness levels through HUD (some kind of growing progress bar/changing icons etc..) Be it in the corner of the screen or over the players' heads. If it's done through the HUD, I think it's better as more ambitious players can try ignoring that information and just try to sneak without that extra clue. It might be also an option to turn it off, if somebody wants.
Also - I wish NPC were turning their heads towards the source of sound or suspicious movements. Maybe not on the first level, but on the second level of suspiciousness. That doesn't always mean being detected - if you made noise, but you're in shadow and crouch still, you should be safe. Especially if you delay their reaction by a second or so.
john9818a on 27/6/2017 at 04:33
If you type ai_watch x where x is the object number of the AI you can get a log in the monolog file of what alert or awareness level the AI is at and when. Also the log will contain the sound tags the AI wants to play through the sound system.
From what I have observed is that when an AI goes to Alert_Level_One because of a noise then a subsequent instance of the noise will easily cause the AI to go to Alert_Level_Two. When it comes to sight, as the AI rises above Alert_Level_Zero different vision cones with better attributes are used and the AI begins to focus on you. Alert_Level_One triggers an audible response but anything above that triggers three types of physical responses... Investigate, Combat or Flee.
Daraan on 27/6/2017 at 08:56
A few weeks I digged into this.
First there are the alert levels which work as described above.
Second! There is the AI Awareness of the player. Best way to learn about this is as Unna said with set game_mode_backup 0.
The Awareness has multiple sub properties, for example was the player seen or heard and others I don't understand.
How this is all correlated you can take a look at
M-FrontGateGuard, M-SorryIForgotButSimilar and Teams.
FrontGateGuard will rise the Alert level by sight of the player but will not engage combat.
A Team Good AI will become aware of the player but not alerted, as the player is not hostile as above. AIAwarness Links are always created!
If you now change the Team from Good to Evil (Player not in sight) the AI will instantly aggro to level 3, as it is still aware(linked) of the player.
------------------------------------
This system is not perfect. When I made my Undercover script I stumbled into these problems.
Short explanation, the player can walk freely around but still raise suspicion by different actions and an alert of 2 will break the undercover -> FrontGateGuard method won't work. All AIs need to be in Team Good. Awareness links need to be removed, when the player is not in sight...
john9818a on 27/6/2017 at 10:52
Awareness links do decay and expire over time after the AI lost sight of the player. The AI can still appear to resume their patrol or whatever even though they are still at Alert_Level_Two. If they give up searching for you and walk away and you step out into the light, they will most likely turn back around to investigate again. Their awareness has been restarted. This has been my observation.
Yandros on 27/6/2017 at 11:19
That's correct, John. There is a property on AI called Awareness Capacitor which controls how long it takes an AI to forget about you based on their previous awareness level. I had to adjust this on the craymen in the temple in the Godbreaker swamp mission because otherwise if you took the mask off when they had just seen you but you stepped into a room or into shadow, completely out of their vision, they would instantly go into search mode because they hadn't forgotten about you, even though they never saw you when you weren't the same team as they are. The default capacitor values were much too long for the mask to be of much use - I think I lowered the level 3 time from 45 seconds to 10.
john9818a on 27/6/2017 at 12:13
I needed a refresher on that but now I remember the Awareness Capacitor. :p
One thing I have noticed between old dark and new is that the Zombies seem to give up chasing me sooner after I'm out of sight. I don't think that would be any different from one AI to the next other than with slower AI like the zombie. When I go around a corner they stop chasing me and start looking for me where they stopped.
Btw I remember Thief 1 had awareness links on blood spots but not in Thief 2.
Renault on 27/6/2017 at 14:58
Quote Posted by PinkDot
Are you trying to recreate the system from Thief? If you're making something from scratch, why not come up with something different? I'm sure there are better ways to do that, these days.
That's the eventual plan, but for fun I wanted to try to first recreate Thief's systems for a top down stealth game. Once everything is working, then I would tweak a bit here and there and make it fit more with the type of game I'm doing.
Quote Posted by john9818a
From what I have observed is that when an AI goes to Alert_Level_One because of a noise then a subsequent instance of the noise will easily cause the AI to go to Alert_Level_Two. When it comes to sight, as the AI rises above Alert_Level_Zero different vision cones with better attributes are used and the AI begins to focus on you. Alert_Level_One triggers an audible response but anything above that triggers three types of physical responses... Investigate, Combat or Flee.
This is what I was looking for. Where do I find more detailed info in Dromed about how the vision cones and attributes change as alert levels rise?
Unna Oertdottir on 27/6/2017 at 15:46
After setting game_mode_backup 0 you can watch the ai awareness link data every so often.
I don't think there's a realtime spy script for detailled information, just spy or nvspy.