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.
1 Comment
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.
|
Raymond WeilacherThe official blog of Small Batch Miniatures Games Archives
November 2024
Categories |