How can I improve this sneaking behavior?

● ARCHIVED · READ-ONLY
Started by whitesphere 4 posts View original ↗
  1. I'm currently working on a script which performs stealth.  I've used the helpful suggestions from the community and come up with some sneaking logic.  I'd like to know what fans of stealth/sneaking missions would like to see added/changed in this logic:

    1. Guards have a hearing radius.  If they hear the player (player makes a noise when he moves, based on the tile he's on and equipment being used), they turn to face the noise.  If they can't directly see the player, they begin walking slowly towards the location of the sound.    I assumed this would be larger than the 2 vision radii

    2. Guards have 2 vision radii.  The outer one is "Guard sees the player but isn't sure he's hostile." This causes the guard to walk at normal speed towards the player.  The inner one is "Guard sees the player and knows he's hostile."  This causes the guard to race towards the player.    To be seen, a player must not be behind a wall and must be within the guard's field of view (180 degrees based on the guard's direction)

    The player has the following optional Defenses:

    1. Disguise.  Each guard might have an "alliance."  If the player is wearing at least 1 piece of equipment from the same alliance, and NO equipment from another alliance, the guard thinks the player is friendly --- and will continue patrolling UNLESS the player gets within the visual detection radius (disguise isn't perfect)

    2. Tiles and equipment can make the player easier or harder to see/hear (padded shoes and, say, leather vs iron armor, and walking over a carpet vs walking over stone tile)

    3. Sleep gas.  Using an item, player can make all guards within a radius go to sleep

    4. Stun item.  Using an item, player can stun the guards, reducing their vision/hearing acuity for some time

    5. Distractions.  Using an item/throwing a switch, player triggers noise and light elsewhere, causing the guards to investigate IF the player is quieter and less visible than the noise.  These last for a short amount of time or until the guard touches the distraction

    All behavior is deterministic -- a guard will always respond the same way, if the guard is looking the same way, player is on the same tile, wearing the same equipment, and the guard is in the same state.

    Am I missing anything in my stealth script?  If not, is this an ideal set of behavior for a stealth mission?  

    Obviously, I need to make certain compromises such as:  Guard should not be able to detect the player before player can see him --- otherwise player can't observe the guards' patrol routes.

    Thanks.
  2. If you're able, you should add a customization option for when the player is spotted.

    That is to say - use note tags or something for making event commands happen upon being spotted. This way your script will be much more versatile, because people could choose what sort of behavior they want from alerted guards.

    Again, if you're able, add a customization option for adjusting the radius for hearing and vision on individual guards. That way one can make different kinds of enemy units with different stats for different kinds of challenges.

    Also, and adjustment option for the shape of the vision of guards - cone-shape, line, and full circle.

    I don't necessarily think guards shouldn't be able to see player off screen. If vision length can be adjusted, then you can leave that up to anyone using the script. Besides, this depends a lot of map design and other gameplay mechanics.

    It's perfectly possible to make an item with a common event that allows players to look ahead by scrolling the screen back and forth, so having enemies with beyond the screen vision is not something that can't be overcome.

    Also, if guards can't see through walls etc, it's perfectly possible to construct maps and guard routes so that they won't generally see the player off map, even if they have long enough vision to do so in theory.

    Finally, I think you should link the block for guard vision to a terrain - this way people can chose for themselves which walls and objects should block vision or not. After all, a glass wall or wall with a window in shouldn't block vision like a regular wall. Bushes and tall grass etc should also have partial block only, so maybe you can have several terrain numbers represent different degrees of vision blockage.

    That's all I can think of at the moment.

    Most of this options should be doable, as many of them are already a part of a stealth script I'm currently using.
  3. The script uses note tags, tagged to each map, so I can tweak the per-guard guard behaviors: field of vision, the radii, etc.  Never thought of the type of detection --- line, cone or circle.  I'll definitely add that. I always consider hearing circular (as long as the sound isn't blocked).

    When a guard is alerted, currently, the script sets Self-Switch D for the guard as well as a variable to the "highest current detection state".  The exact switch ID is in the note tag.

    And, yes, guards cannot see you if you are behind a wall, or something which cannot be seen through.  Sound and sight visibility (and degradation) is determined by Region IDs, whose behavior is defined in the note tag.   So, it's up to the game developer to set the proper Region IDs.
  4. Ok, sounds really good.

    Yeah, sound should be circular I think. But, vision shape can be important.

    A final thing I thought of, that can be useful, is a crouch setting.

    Link one button to "crouch" which reduces sound and visibility, but also lowers walking speed.

    Have an option for change of hero graphics upon crouch for visual effect, and the option of binding a sound effect to the crouch command, because it's aesthetically pleasing :p