Dynamic-Stealth icon indicating copy to clipboard operation
Dynamic-Stealth copied to clipboard

[Suggestion] Make light gauge easier to read

Open dominik-ro opened this issue 5 years ago • 3 comments

I love this mod, especially with Custom NPCs, but I'm not a fan of the light gauge. In my opinion, it should tell the player exactly two things:

  • if it is so dark that they can not be seen
  • if it's not dark enough, give a rough estimate how easy they are to see

The light gauge has 17 states and it's not clear where the visibility 'thresholds' are. Additionally it appears to show the block light level, not the actual (configurable) visibility. I would like to suggest something akin to the light gem in Thief 1/2. The gem goes from almost black to brightly lit, depending on the player's light level and it only has about half a dozen states (different textures). What's really genius about it is that it has a second indicator that clearly communicates the visibility: dark = you're safe, yellow = you might be seen, red = you will be seen.

Here's a gif of the light gem.

dominik-ro avatar Jan 02 '20 23:01 dominik-ro

Unfortunately, the same style of gauge would not work with DS, due to the complexity of the stealth algorithm. There simply aren't any clear-cut visibility thresholds to show in the first place, so this is an impossible request.

I've avoided 3D FOV renders so far for the same reason; it would be very difficult to display the FOV correctly, because any time one entity tries to see another, there is effectively a different stealth level for every possible point in the world, based on a multitude of factors.

Ie. the FOV is not an on/off type thing. If you were to draw a 2D cross-section of it in terms of how visible something is within it, it would be a gradient, fading out from center line of sight to sides, and from origin (eyes) to the maximum distance.

So even with the same light level, same distance, and same enemy, you may or may not be detected depending on how far you are, angle-wise, from their center of vision...and that calculation can go in different directions based on any one factor (there are many more factors than I've mentioned).

So instead of all that, I've stuck with the "simple" display; the light gauge displays the brightest light level among the grouping of points used by DS for entity light level detection, taking into account DS ambient light level settings for different dimensions and such...and the stealth gauge displays your highest visibility (lowest stealth) among all things trying to see you right now (you do have the stealth gauge enabled, right?)

I literally cannot use the same display as far as the 2nd part goes (the part that shows whether you won't be seen, might be seen, or will be seen).

I could do the 1st part, where it displays via a single light gem that goes from dark to bright, but I think the current display is more meaningful in this case, as it shows the exact light level (0-15), and still works well for estimating at a glance. It may not be a bad idea to have a literal number displayed in the center though in addition to the graphical display...

But yes, despite being "just a minecraft mod", DS has a more complex stealth system than almost any AAA game you can throw at me. Probably more complex than any I've played. I do like stealth games though, so feel free to throw some at me if you think they have good systems.

I'm going to close this because if I understand correctly, this cannot happen. But I will still see and read any responses here, if I misunderstood something, or if you have a related request / question, etc, etc.

Also, just for kicks, if you're interested in the genre, here are just a few that I consider quite good... Mark of the Ninja Shadow Tactics Aragami Pixel Shinobi

Sorry for the long response

Laike-Endaril avatar Jan 03 '20 01:01 Laike-Endaril

Sorry for the apparent misunderstanding. I don't ask to factor in other entities (that would suggest a clearvoyant player character), only to present the information in a clearer manner. Instead of displaying the absolute light level, show the player's relative visibility, using the config settings for I:"000 Light Level (High/Bright)", I:"040 Light Level (Low/Dark)" and their respective multipliers.

Let me explain what I mean by 'relative visibility' (code for illustration purposes only):

// get config:
lightLevelLow = config(I:"000 Light Level (High/Bright)");
lightLevelHigh = config(I:"040 Light Level (Low/Dark)");
multiplierHighLight = config(D:"020 Multiplier (High/Bright)");
multiplierLowLight = config(D:"060 Multiplier (Low/Dark)");
crouchingMultiplier = config(...);

// value between 0..1
relativeLightLevel = lerp(lightLevelLow, lightLevelHigh, currentLightLevel);

// value between multiplierLowLight..multiplierHighLight, assuming both values to be in [0,1] interval (probably wrong)
relativeVisibility = (crouching? crouchingMultiplier : 1d) *
    lerp(multiplierLowLight, multiplierHighLight, relativeLightLevel);

double lerp(double min, double max, double t) {
  double u = (1d-t)*min + t*max;
  return Math.max(min, Math.min(u, max);
}

Now I suggest relativeVisibility would be mapped to a set of discrete light gauge states that fall into three clearly distinguishable categories:

  • 0: can not be seen under normal circumstances (Thief: unlit light gem)
  • (0..1): relative uncertainty expressed in a handful of states (Thief: dimly to brightly lit light gem and yellow secondary indicator)
  • ~1: is totally exposed; player can expect to be seen by almost anything that has LOS and is not too far away (Thief: bright gem and red secondary indicator)

The thing with complexity is that unless you can convey (a reasonable simplification of) the governing rules to the player, a system's behaviour may be conceived as mere chance or erroneous, both can cause frustration. Take Mark of the Ninja, for example. It goes even further than Thief in terms of streamlining information, having only three distinct light levels (as far as I remember). While I prefer a bit more complexity (and I'd say Thief 2 is the gold standard here), this is a very good example of how to visually communicate game rules.

Sorry for rambling, I hope I could make myself somewhat clear this time :)

dominik-ro avatar Jan 03 '20 12:01 dominik-ro

Hmm, well it looks like I got the main idea the first time, but may not have lined up some of the DS-specific details in my mind. This idea hinges on having stealth factors filtered in ways I haven't done yet.

Theorycrafting...

Factors that would need to be accounted for:

  • Your light level
  • Whether you're sneaking or not
  • Armor
  • Invisibility
  • Whether you're on fire
  • The highest maximum view distance among mobs...maybe ignoring certain ones...this could be tricky to define
  • Creative mode
  • Glowing
  • Visibility reduction attribute

Factors that would need to be ignored:

  • Actual entity distances
  • Actual entity angles
  • Soul sight
  • Blindness
  • Night vision
  • Vision attribute
  • LOS
  • Disguise (currently only mob heads)
  • Sense of touch
  • Tremorsense (not yet implemented)
  • Sense of hearing (not yet implemented)
  • Echolocation (not yet implemented)

I...think that's it. There are some additional special case, but I'll leave those out.

So the question comes down to whether the combination of the first set is useful or not. The 2nd set gives an idea of what the gauge would not account for.

This is what I would call a "passive stealth gauge", not a light gauge, so it would be a new gauge if implemented.

I'll need to mull this one over for a while, but feel free to post any additional thoughts / ideas while I do so.

Laike-Endaril avatar Jan 03 '20 19:01 Laike-Endaril