A big part of my day job is making sure that I run designs past people before releasing anything. I almost inevitably learn a ton from just a few sessions (the UX industry standard is 5 testers).
An important part of my design strategy is to get builds into people's hands early and often. So far I've tapped some friends for feedback and this example shows how that feedback translates into design iterations.
I sent a couple friends a link to a test build and jumped on separate Discord calls to get their reactions. I had them share their screens and encouraged them to speak out loud about their experience and specifically whether the guards were behaving in accordance with their expectations.
Observing my friends play and getting their feedback, a persistent theme was the guard's searching behavior was not working the way the players expected. Rather than a systematic search, guards just kind of ran about randomly, as in the clip above. In fact, they were programmed to do just that: run around systematically.
I was unsure how exactly to create a search behavior that would be scalable and work in different environments and levels so I looked into some other stealth games for inspiration.
In this (rather funny) example of enemy search AI in Metal Gear Solid 2, the guards have particular places they search for the player in a way that seems believable (except for the hilarious bug at the end). They check behind objects and in containers where the player can hide. This system most likely relies on designers manually setting up each room to tell the AI where the door is, what objects to search behind, and what lockers to open. I decided to set up a test using similar, manually placed points of interest.
In the above example, the green rectangle is the Search Area and the green circles are the search waypoints. When a guard is alerted near the Search Area, he goes to the closest waypoint then begins a search at each of the waypoints until his awareness level drops to 0, at which point he returns to his patrol. Here's a clip of the guard following this behavior after spotting a dead body.
Many gamers, myself included, use a variety of controls to play PC games. The two control devices I decided to support right from the beginning are the keyboard and mouse as well as the Xbox controller, which Steam data reports as the most popular gaming controller by a large margin.
Thankfully Unity makes it easy to support multiple control setups simultaneously, but I wanted the user interface of Sneak 'Em Up (working title) to also adapt in real time to the user. To do so I created a script which detected input from either the keyboard or an Xbox controller. This script then sets a global variable which other objects in the game reference. This global variable acts as a signal telling the rest of the game whether the last input made by the player was made on a keyboard or an Xbox controller.
Button prompts show up several places in Sneak 'Em Up's levels. Most obviously, they appear on the HUD UI, reminding the player which button is responsible for using equipped weapons and items.
Prompts also appear above the character's head when they are close to an interactable object such as a body or a switch. And finally, button prompts can exist in the game level itself as a "sign" during the tutorial. In the future, button prompts may also be seen in dialogs, when characters help explain how to play in the early tutorial levels.
Putting this all together, the control manager script described above sends information on the player's last input to all these systems, giving the player real time contextual prompts that make playing intuitive.
Awareness is a key feature of enemy AI in Sneak 'Em Up (working title). Once a player is detected (see the last post), the guard's awareness "meter" fills (there's no visual meter for each guard's awareness but this is something I plan on testing eventually). Awareness starts at 0 and goes to 100.
Both the detection system and awareness system are designed to be target-agnostic--in other words, the AI does not solely respond to the player. This is to allow for emergent or systemic gameplay, in which the player manipulates the game world indirectly. The AI for each character is seeking out, not just the player, but anything that is suspicious, alerting, or on a different "team." The player will be able to use this to their advantage by arranging for opposing factions to fight it out, luring wild animals near enemies, or perhaps mind controlling enemy guards to cause mayhem.
The rate at which awareness raises is based on several variables. Visibility (formerly called Size) is a variable on every character or notable item in Sneak 'Em Up. Highly visible objects, like the standing player character, raise awareness faster than small objects such as a pack of cigarettes tossed to lure enemies. To mimic human sight, the target's speed is a major factor in awareness as well. Finally, distance to the target raises the awareness rate exponentially. This way, if the player runs up on a guard standing around the corner, the AI will go to 100% awareness almost instantly, but a distant player will cause a slow creeping awareness.
Each enemy type has a "Suspicion Threshold" and an "Alerted Threshold", which define at what Awareness level a character will go check out a suspicious sight, and what level they will become alarmed and search the area. An alerting sight that the enemy identifies as a character from another team will be met with hostility.
One way to test and tweak my AI was to build a "playground" level where I could test enemy detection and awareness at different distances and with the player character in different states such as prone or hiding in tall grass. Initially enemies had a detection area that was circular in shape (see the enemies on the left in the above screenshot). However, through playtesting my own levels and watching users try the game out, I realized that the enemy was often able to see the player before the enemy was even on the screen, causing frustration for players.
In the illustration above, the grey rectangle represents the aspect ratio for the vast majority of PC game players' monitors: 16:9. With a circular detection radius, guards who are to the left and right of the player work as expected, meaning they can't see you from off screen. However guards above or below your position can see and attack the player from off screen, which feels frustrating. The solution, after much tweaking, was to make the detection shape a capsule shape:
Even though a player's expectation is that guards see in an even circle around them, this caused a lot of frustration and instead, a capsule shaped vision area feels more fair to the player.
The core system in any stealth game is the guard AI, specifically visual acquisition and detection of the player.
In Sneak 'Em Up (working title), the guards start in a patrol or standing state, while constantly scanning objects that enter a circular trigger around them.
Once an item enters the green circle, it goes through a gauntlet of questions to filter out only the items the guard should respond to:
In this way, fast-moving objects that are close to the guard fill his Awareness exponentially faster than stationary targets that are far away.
The visual acquisition system is designed to not be specific to just the player, to allow guards to react appropriately to characters from different factions or wild animals, as well as objects like distractions or dead bodies. Systems like these will provide more chances for the player to use the world itself as a tool of chaos and destruction.
As awareness builds, the guard moves into first the Suspicious state, then the Alerted state. Taking--ahem--inspiration from the Metal Gear Solid series, the player receives visual feedback as to which state the guard is in. The Awareness system will be covered in more detail in the next Devlog.
This post will introduce my latest game project - a top-down third person stealth action game tentatively titled Sneak 'Em Up. Currently it's a one-man-project, with me trying to tackle all aspects of game design and development.
2D stealth games are rare, and top-down stealth games even more so, and those that are top down are likely to be squad combat or turn-based. Sneak 'Em Up, on the other hand, is a top-down action game with strong stealth mechanics. The most well known games of the same style, and the major inspiration for Sneak 'Em Up, are the original 2D Metal Gear games of the late 80s and early-mid 90s. In the early Metal Gear games, you control your character from above, distracting guards and finding hiding places. Since the advent of the 3D stealth genre in 1998, 2D top-down stealth action games have been rare.
Sneak 'Em Up is built in Unity utilizing the Bolt visual scripting plugin. Bolt offers me several advantages:
Throughout design and development, I'll be using the "find the fun" strategy of game design--that is, iterate on the basics of gameplay to find what mechanics "work" and are enjoyable for the player, then worry about the overall game story, theme, pacing, as well as details like art style, animations, lighting, etc.
My plan is to use very basic assets to prototype mechanics and interactions and iterate/tweak those to find what type of gameplay is satisfying. Once the core gameplay loop is established, I'll then design the rest of the game around that loop, providing the player with a story arch, a possible leveling system, varied tools and weapons, and special sections that twist and vary the core gameplay loop.
High fidelity art will also wait until after the core gameplay loop has been discovered. I will be creating some sprites in the meantime to practice my pixel art skills. I'm particularly proud of this guard, my second pixel art character ever!