Jump to content
The Dark Mod Forums
kcghost

View Stealth Score during gameplay?

Recommended Posts

@Dragofer Not sure what causes it, but I found an issue with the tdm_movers script. If you call the script, then make a quicksave, then load that quicksave, you get an error "Cannot load console". Something doesn't play nice with save/load mechanisms.

  • Like 1

Share this post


Link to post
Share on other sites

Damn, looks like that's a problem with the concept of using the console to call a script. I've made a new script that does nothing but print "test" to the console, even included it the proper way via tdm_main.script, called it both with and without the hotkey, and tried quicksaves & hard saves - the outcome was always the same: you can't load a save that was made after calling a script via console.

At least there's the partial success in that there's now a way to check stealth statistics ingame, but with the caveat that you need to make a save before you press the hotkey and then go back to that save right away. Looks like a gui-based solution is the way to go from here.

  • Like 1

Share this post


Link to post
Share on other sites

If it's a problem with the console text, then you can still get the info in the script and then find some other way to get the information to the player, yes, like a gui-based route. 

  • Like 1

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
Share on other sites

Now then, I've created a new way to show stealth statistics. Simply place the .pk4 in your darkmod installation and you will start every FM with a scroll called "Stealth Statistics" in your inventory, which you can "read" to show a small message with current stealth statistics.

Addon - Stealth Statistics for 2.07

I've taken on some ideas posted in this thread, and was also able to make good use of kcghost's earlier work. The scripts are included via a new tdm_user_addons.script file, which also contains an initialisation script that gets run by tdm_main: user_addons_init(). Any addons that want to be run at map start can be initialised by calling their init script from within user_addons_init(), simply adding one line.

Disclaimer: this addon modifies tdm_main.script in order to better support addons. tdm_main is very likely to get changed in future TDM versions, in which case this addon will need to either get updated or removed. Ideally TDM will support addons better from 2.08 onwards.

The point still stands that a GUI will yield the most polished results, but as an FM author I'd have to put in some time to learn how to setup GUIs, while I've already done more than a few things with scripting.

 

By the way, to anyone who uses this, I'd appreciate if you could share if the scroll shows the same score as is shown at the end of the mission on the statistics screen. I've noticed a few cases where stealth score doesn't seem to get added how you'd expect - got the feeling there might be a bug either in the stealth scoring system or in the commands used by the scroll's script.

  • Like 3

Share this post


Link to post
Share on other sites

This is exciting, if I wasn’t getting ready to go to work right now I’d test it out.

Fantastic work, all involved!

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

I proposed an idea in the early days of Dark Mod (mid-2000s or so) where if the statistics/stealth score screen showed that you had been discovered, it would let you see a short video replay of the event actually happening, or a freeze-frame image, of the moment.

To make it work, as you play the level, if a guard spots you or a body that you should have hid better, then the game would capture the few seconds surrounding that moment, or a snapshot image, so you could watch it/look at it from the post-mission (and death/failure) stats screen to help see where you went wrong. (Because without context, it's hard to learn from your mistakes... or know, from the player's perspective, if the game is being realistic/truthful, etc. Plus, it'd just be cool to see those moments captured and shown to you in a way that doesn't interrupt or intrude with your gameplay while playing the mission.

If implemented, I'd assume this replay video or image could be from the perspective of the guard, or the player, or the body, depending on the situation and what the consensus of the team was. For the UI, you'd be able to jump from one failed situation to the next as you review your failures.

And, actually, since this is a video game, then instead of each failure being a non-interactive 2D video or image, I could see TDM capturing the moment in such a way that when you replay it from the stats screen, the replay/review would be in-engine, whereby you could manipulate the camera (swing or pan it around, zoom-in/-out, etc. in 3D space).

From what I remember, this was, of course, a nice-to-have feature rather than a critical one... and was to be sidelined to maybe be implemented at a future time. I still think this would be a neat feature to have, if it's ever possible.

At the time, I'd never seen any games do this sort of thing, and still haven't seen it since. Maybe there's some one-off games that have done it, but I sure haven't played them. Then again, stealth games ever since Thief I/II have such simplistic stealth mechanics and theme park ride/guided-tour situations, along with contextual music/sounds when you're spotted, that you always know when and where you're spotted and by who; so it hasn't been very needed, in general.

  • Like 2

Share this post


Link to post
Share on other sites
5 hours ago, Dragofer said:

Now then, I've created a new way to show stealth statistics. Simply extract the .zip to your darkmod installation and you will start every FM with a scroll called "Stealth Statistics" in your inventory, which you can "read" to show a small message with current stealth statistics.

Many thanks, that works great and with your permission I will include it in my Unofficial Patch! Maybe there will be a solution like I suggested, but in the meantime this is fine.

  • Like 1

Share this post


Link to post
Share on other sites
14 hours ago, Darkness_Falls said:

I proposed an idea in the early days of Dark Mod (mid-2000s or so) where if the statistics/stealth score screen showed that you had been discovered, it would let you see a short video replay of the event actually happening, or a freeze-frame image, of the moment.

It's a cool idea. The game Noita creates a gif animation of like 10 seconds or so around moment of death, which is often sensational, and it's such a great feature. I think it might be cool if it were a double window from the player's and AI's perspectives at the time. It might be a challenge, but practically anything is possible with the sourcecode and enough effort. 

 

Edit: Just a quick think about it though, it might be some challenges. If you want to actually capture the moment, you should be taking regular screenshots or videos that are regularly thrown away, which would be a performance drag. If it does it at the moment of the alert, then it may miss some of the relevant bit, but that'd be more possible. You can set a camera to get visual info (like how our lightgem works), and send it as an image file, and maybe it could take like 50 of them in rapid sequence, downsize them, and export as a gif. 

  • Like 1

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
Share on other sites
12 hours ago, Darkness_Falls said:

I proposed an idea in the early days of Dark Mod (mid-2000s or so) where if the statistics/stealth score screen showed that you had been discovered, it would let you see a short video replay of the event actually happening, or a freeze-frame image, of the moment.

To make it work, as you play the level, if a guard spots you or a body that you should have hid better, then the game would capture the few seconds surrounding that moment, or a snapshot image, so you could watch it/look at it from the post-mission (and death/failure) stats screen to help see where you went wrong. (Because without context, it's hard to learn from your mistakes... or know, from the player's perspective, if the game is being realistic/truthful, etc. Plus, it'd just be cool to see those moments captured and shown to you in a way that doesn't interrupt or intrude with your gameplay while playing the mission.

If implemented, I'd assume this replay video or image could be from the perspective of the guard, or the player, or the body, depending on the situation and what the consensus of the team was. For the UI, you'd be able to jump from one failed situation to the next as you review your failures.

And, actually, since this is a video game, then instead of each failure being a non-interactive 2D video or image, I could see TDM capturing the moment in such a way that when you replay it from the stats screen, the replay/review would be in-engine, whereby you could manipulate the camera (swing or pan it around, zoom-in/-out, etc. in 3D space).

From what I remember, this was, of course, a nice-to-have feature rather than a critical one... and was to be sidelined to maybe be implemented at a future time. I still think this would be a neat feature to have, if it's ever possible.

At the time, I'd never seen any games do this sort of thing, and still haven't seen it since. Maybe there's some one-off games that have done it, but I sure haven't played them. Then again, stealth games ever since Thief I/II have such simplistic stealth mechanics and theme park ride/guided-tour situations, along with contextual music/sounds when you're spotted, that you always know when and where you're spotted and by who; so it hasn't been very needed, in general.

An interesting idea. Getting images from the player perspective, when the player is seen, sounds doable. You could have the game take a screenshot, each time the player is seen. Getting picutures from the view of the AI is more difficult, bcause you would have to add a camera entity the picture of which you can read out. So you would have to check not only "player is seen", but additionally the AI name and would have to move and rotate the camera in a way that it gets the view of the AI. Getting everything in a 3D environment would require the game to basically record every move the player and each AI takes. I am sure that it is possible, but would require a lot of resources (not to mention, you would actually need a working player model, which we don't have).

  • Like 1

Share this post


Link to post
Share on other sites

I found a new strategy for displaying the stealth stats that some may prefer. The attached addon (just drag into the darkmod folder) overrides the loot inventory gui and associated script.

I got rid of the loot breakdown (jewels, gold, etc.) as well as the loot icon that appears (didn't look right next to longer text). Instead it displays a stealth breakdown and total loot out of the mission's available loot. Suspicions, Searches, Sightings, Bodies, Score, Loot.

Messing with the gui layout is a pain, so it ends up a bit of a tradeoff. It doesn't look pretty, it trades the neat touch of the loot breakdown for something more stark and practical.

Using this you can immediately see the effects of your actions, as well as possibly determine how strange (and glitchy?) the scoring system is. Should look into if the end mission score is calculated differently, since I sometimes see suspicions that count toward the score, and others that don't. As well as sometimes searches get mysteriously forgiven (They tend to do so when you are sighted and are counted there instead, but I have seen it forgiven without a sighting somehow). The strange behavior might just be that we essentially made a debugging tool for the stealth scoring, and the stealth scoring *might* be a little buggy.

 

tdm_loot_stealth_stats.pk4

  • Like 2

Share this post


Link to post
Share on other sites

Level one suspicions are counted for suspicions but not for the score (it starts from level 2) because in some FMs they are impossible to avoid, like you spawn into them or sound through a bottleneck goes through the walls and the player has no indication it happened, and the score is for ghosting, so it's following the ghosting rules, the AI has no idea a person is there. But if you want to be hardcore, you can attempt zero suspicions as well, like super ghosting. 

As for searches, the issue is searches last a long time and cascade, so the first version had scores going into the 100s or 1000s which was absurd (we thought). So we took out cascades and level downs, just counting the highest level in a time frame (the peak in a mountain range), and we counted the duration of a search instead of adding to the score every second he reacquires, which again blows up the score. Basically it packages alert situations into roughly contiguous units in a time frame. An AI has to completely level down and wait a bit before a new search is counted as a second, independent search. A string of 20 searches in microseconds of each other, quick level downs and level ups, are considered part of the same search. (Grayman did most of this with me helping with little things like the gui. But we were discussing the system together.)

It took a lot of tweaking to get it to its current state, but the score explosions were kind of ridiculous, that one minor incident could be a difference of like 80 or 200 in the score.

So if you're independently counting alerts, you could either take the sourcecode algorithm the stealth score uses directly, or just use different terms so it's understood it's different than the score.

All that aside, I'd be interested to see a cleaner gui set up with a little optional light that's off, green, yellow, and red by the current alert. For a ghoster, that light is the measure of a bust, without needing to add it up. But you could add it up with that too. 

  • Like 1

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
Share on other sites
On 2/8/2020 at 5:17 PM, kcghost said:

I got rid of the loot breakdown (jewels, gold, etc.) as well as the loot icon that appears (didn't look right next to longer text). Instead it displays a stealth breakdown and total loot out of the mission's available loot. Suspicions, Searches, Sightings, Bodies, Score, Loot.

I like the basic idea, but not removing cool content like the loot icons from the mod. How about modifying this so instead of loot types the stealth statistics are displayed in the inventory grid? Like in the top line there instead of the loot types or above it?

Edited by wesp5
  • Like 1

Share this post


Link to post
Share on other sites

IMO the death/detection cam is a bit much. It makes perfect sense for highly competitive multiplayer modes or hardcore arcade games, as the amount of failure in these games is high. The main idea is to lower the frustration and make mistakes an opportunity to teach players something they might have missed in the hectic action. In a slow paced stealth game, where designer shouldn't assume player will fail, it will be more of an excuse for poor level design or catering to hardcore crowd only.

  • Like 1

Share this post


Link to post
Share on other sites
8 hours ago, wesp5 said:

Yeah, as promised above in this thread I included the solution of Dragofer :)!

Okay. Can you tell me how the Stealthscore system works exactly? 

Share this post


Link to post
Share on other sites
1 hour ago, D.Brown said:

Okay. Can you tell me how the Stealthscore system works exactly? 

No, I just included Dragofer's item which displays the current score.

Edited by wesp5
  • Thanks 1

Share this post


Link to post
Share on other sites
2 hours ago, D.Brown said:

Okay. Can you tell me how the Stealthscore system works exactly? 

A sound or visual alert that's just enough to cause an AI to stop what he was doing adds 1 to the score ("suspicion"), while a full visual detection adds 5 to the score ("sighting"). Inbetween those extremes the AI searches for the player and a score between 1 and 5 should be added ("search"). If the AI just grumbles a bit while carrying on it's still counted as a suspicion, but nothing is added to the score.

As for bodies, it counts every time an AI discovers a body, so a single body can be counted multiple times. IIRC bodies don't add anything to the score.

The code for calculating the score for "search"  events is more complicated and doesn't always up the score right away. A few posts higher up demagogue, one of the devs involved in the stealth score, provides a breakdown of how it works.

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, Dragofer said:

A sound or visual alert that's just enough to cause an AI to stop what he was doing adds 1 to the score ("suspicion"), while a full visual detection adds 5 to the score ("sighting"). Inbetween those extremes the AI searches for the player and a score between 1 and 5 should be added ("search"). If the AI just grumbles a bit while carrying on it's still counted as a suspicion, but nothing is added to the score.

As for bodies, it counts every time an AI finds a body, but IIRC this doesn't add anything to the score.

The code for calculating the score for "search"  events is more complicated and doesn't always up the score right away. A few posts higher up demagogue, one of the devs involved in the stealth score, provides a breakdown of how it works.

Thank you for the insight.

Share this post


Link to post
Share on other sites

At the end of the mission, on the stats page, you'll see a little down arrow at the bottom. If you click it, then it opens up a new page that gives a complete breakdown of your stealth score by the number of different categories of alerts. 


What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
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.


×
×
  • Create New...