What: Dynamic Detection in Shadow Tactics
In
Shadow Tactics, players control a squad of characters, each of which has its own specialization (there can be up to five characters in a squad). Their task is to sneak around a huge level filled with enemies, and quietly kill the victim. Each level is a puzzle with many solutions. One of the most important player tools is the ability to display the enemy's field of view in the form of cones, which we call cones of visibility (Viewcones). Cones of visibility have areas of different colors that determine the behavior of enemies.
Figure 1: Shadow Tactics visibility cone.For those who are interested in how this is implemented technically, I will quote our lead technical engineer Frieder Mielke, the person who created the entire system: “The basic principle used in calculating visibility cones is the use of shadow maps. First we render the texture depth from the position of the eyes of the selected character. Then, when rendering the main camera, based on the previously created depth texture, we generate a mask containing information for different scopes (for example, “full visibility”, “completely hidden”, “invisible when the character crawls” and “out of sight”). Using this mask in the last pass, we can color the cone of visibility. In this pass, a stencil buffer is used to exclude objects that do not need to be rendered and add information about light sources. ”
')
From a design point of view, we analyzed how these cones were used in old games, and saw a way to improve them. This led us to revise some aspects of character detection in this genre.
Who: Moritz Wagner, Lead Designer, Mimimi Productions
My name is Moritz, I'm the lead designer at
Mimimi Productions . I have been working in the company since the very beginning, when our studio originated while studying game design at the Munich-based
Media Design Hochschule . In the third semester, we began to develop early prototypes of our first big game,
The Last Tinker: City of Colors , which was released after the foundation of Mimimi in 2011. Besides her, we worked on several mobile games.
Now there are 16 people working in the studio, and our last project is
Shadow Tactics: Blades of the Shogun , a real-time tactical stealth game (RTT) tactical stealth game with an isometric view in the style of the
Commandos and
Desperados series.
What for?
Like many developers, we decided on a pair of design pillars for
Shadow Tactics . Both pillars are connected with the use of visibility cones.
- Preserving the basic game cycle: Commandos gameplay today is just as interesting as it was 16 years ago. It is critical that, regardless of the decisions made, the basic game cycle remains unchanged. Shadow Tactics should deliver the same pleasure (that is, incredible torment, alternating with satisfaction) as the old games.
- Improved usability: although the gameplay of old games is still interesting, in terms of convenience, the interface is already outdated (surprise!). Management is slow, often not enough feedback, and important information reaches the player indistinctly. Shadow Tactics should be like a modern version of old RTT games.
Basic principles of visibility cones
Since the visibility cone displays the enemy’s vision, it is used to determine the level space in which the player can move and interact. The alignment of enemies creates the following types of space:
- There are no visibility cones: as you might guess, in such areas, players can do almost anything. Usually it is here that the guards meet their premature death. Players can either create such areas themselves, distracting enemies, or lure opponents into them. Particularly reckless guards can even pass on their own.
- Dark green cone of visibility: in order for characters not to be discovered here, they must crawl. Any action in which characters must stand up will lead to problems. Such areas are easily passed, but killing the guards is usually impossible without distracting other guards.
- Bright green cone of visibility: in such areas no entry. With the low complexity of the game, players can quickly run through them, unnoticed, but they are almost impossible to perform any actions without getting into trouble.
- Dotted Cone of Visibility: Used for shrubs or tall grass. Here, the player’s lying or crawling characters are always invisible if enemies do not enter the bushes (they always warn about this with a voice and only do this when they are lured or when they are looking for a character). We decided that these types of shelters never revealed their full potential in old games. Therefore, we added them to create a contrast between the sensations of security inside the hives and the risk of being in other areas.
The cone of visibility is the most important factor in creating interactions with enemies in
Shadow Tactics . Some guards move along patrol routes, that is, spaces constantly change their condition. It's pretty simple, but I wanted to talk about it first.
What are the cones of visibility
There are no gradients or other design, the most important - contrasting edges and clearly marked areas.
The size of the cone of visibility affects the immersion in the game, the complexity and design levels.
By itself, this function can create situations that destroy the feeling of immersion in the game. They are often found in stealth games, and therefore players are partially resigned to them. But still it is important not to go too far. Although looking at the cone of visibility and it is clear why the enemy does not notice the character crawling three meters away from him, still this situation looks unnatural and stupid. We all met this in games.
Partially solve the problem by increasing the cones of visibility. The closer a player can get to the enemy imperceptibly, the more it looks like gameplay mechanics, which can prevent immersion in the gameplay. However, too large cones of visibility strongly influence the complexity of the game, the level design and the size of the maps, so it takes time to find a compromise.
Figure 2: at night levels, the cone visibility parameters change. The cones become smaller, the dark green area is very large, but the lighting always creates a bright green field of view.Integrity is also an important factor. We decided that all enemy guards should have the same cone size, angles of movement and speed. Visibility cones are fixed only in certain situations (for example, when guards are talking to each other). Therefore, players can predict the behavior of cones and build their tactics on this without fear of a sudden change of behavior. Gradually, they are better at mastering this function, which causes a feeling of satisfaction with the game. We also decided to keep the parameters unchanged for different levels of complexity so that players who started at low complexity should not be retrained when moving to a higher one.
Here, the attentive reader may ask: “But Moritz, you did say that there is no appearance in the cones of appearance. What is this strange pattern on the dark green part? ”I will explain: it was added because the clear contrast between the bright and dark areas was not noticeable, so it was difficult to determine what kind of color it was. This happens on elevations and in cases where parts of the cone of visibility overlap with large objects or shelters.
Figure 3: in the left picture I turned off the pattern. It shows how difficult it is to determine the brightness of the cone of visibility. When the pattern is turned on (in the picture on the right), everything becomes obvious.One cone to rule everyone
We decided that it was possible to display only one cone at a time, as in the old RTT games.
In terms of design, there are two main reasons for this:
- Information: Shadow Tactics provides almost complete information. The game has no fog of war, enemies are never created by chance and their behavior is always predictable (as long as they do not begin to actively look for a player). Players can fully analyze the situation if they have time for it. The restriction of one visibility cone is the only half-hidden information when solving a puzzle. By making players memorize the field of view of the guards, we create tension and make the gameplay of avoiding the cones of visibility more intriguing.
- Visibility: a single cone of visibility allows you to not get confused in the interface and increase visibility. Although for some players huge amounts of information are familiar, for most they will be too complicated. In addition, it looks unpleasant in the screenshots and in videos.
Even ninja can be detected
Figure 4: Character Hayato was discovered by one of the first guards on the first level. Noob!
Handling the moment when an enemy detects a player’s character is very important in any stealth game. We went back to this part of the gameplay many times, I will tell you about this process and about what we came to the end. This part is devoted not only to the cone of visibility itself, but also to the different mechanics and systems that were used ... and then they were cut out.
First, let's see what happens when a player’s character falls into a cone of visibility and is close to detection:
- Sound: a unique sound effect is played. He tells the player that he was discovered.
- Focus: the cone of visibility of the enemy focuses on the character and automatically turns on, even if another cone is selected. This immediately tells the player who discovered it.
- Slow motion: the game goes into slow motion mode to allow the player to react better. Later I will talk about the evolution of this function. It was an agonizing, error-full process.
- Yellow color: if the cone of visibility was green, it begins to fill with yellow, starting from the eyes of the enemy. As soon as the yellow part touches the player’s character, the enemy actually detects him, starts shooting and turns on the alarm. If the character enters the yellow part, the guards discover it immediately. This is similar to the function in Desperados, where the visibility cones gradually turned yellow, but moving the yellow part to the player made it possible to create a clearer feedback on the moment the threat was detected. This allows the player to better master the function and use it to their advantage.
Slow path to slow motion
Samples and errors are an integral part of this genre, supported by the ability to quickly save and load at any time. Although it is obvious that we wanted to preserve this aspect, we were wary of how modern gamers would react to it. Of course, those who played the old games will not experience problems, but will it not frighten the new generation? Do not critics consider it outdated?
We thought a lot about this topic and came to the conclusion that we would leave the functions of quick save and load part of the game. But we still need to give players more opportunities to avoid detection. The yellow part of the cone of appearance also corresponded to this philosophy and we liked how it works.
Note: the addition of an interesting time rewind function not only became a huge technical difficulty, but also changed the aspects that we, as newcomers to the genre, were afraid to change. We discussed the function, but quickly abandoned it. It would take too much time and be too risky for profits.Given these prerequisites, we began to think about different functions. Thus began the odyssey into the world of ideas: each of them had problems and through many iterations we cut them off. It was a painful process, especially for our programmer Philipp Wittershagen (Philipp Wittershagen), who had to implement them. I think he still has nightmares.
Freezing mode
This infernal creature had to use ninja forces and prevent detection, so that players had to use fast downloads less often. This is how it worked: as soon as the player’s character reached the yellow part of the visibility cone, the game paused and shifted the focus to the character. This was already a big problem: stopping the game at a stressful moment kills the streaming state and feels bad. The pause always turns on unexpectedly and confuses players. In addition, if, after a pause, the game was waiting for the player’s commands, then he gave them away by chance, because most frantically started to click the mouse, trying to escape. (I blame mainly Diablo and MOBA for this feverish clipping habit. Thank you so much.)
The freezing mode had more strange features. I will consider chronologically the main iterations and briefly tell you what did not work in them:
Perform one action: in this iteration, the player could only perform one action after pausing the game. This was designed so that, for example, a character could bend if he was in a dark area, or simply remove a guard with a distance attack if only one enemy saw him.
However, problems arose. It turned out that this possibility is too powerful for some characters (who had good distance attacks) and almost useless for the rest. In addition, very often there were no options to save the character. Have you been spotted in a bright area and several guards? So, no luck, you can do one action and still then die. When such an insurance mechanic works, the player expects that it will always be useful, but she had weaknesses. Therefore, we abandoned it and decided to try something else ...
Teleportation within circles: the idea arose that cool ninja characters could teleport with smoke grenades to avoid detection. There are already questions with style: why would a samurai Mugen use smoke grenades and teleportation? And why do all these characters use smoke grenades ONLY when detected and the player cannot use them in other cases?
Of course, we decided to ignore these questions for a while and focus on the mechanics:
When it detects a character around the circle appears, and the player can click anywhere in the circle to teleport to this point. So he can either get into the dark area of ​​the cone of visibility, where you can duck, or even move to the shelter. And, of course, the players started using this feature to teleport directly to the guards and kill them.
Therefore, we replaced the circle with a cone, allowing players to teleport only from the enemy. And again there were problems. It was useless even more often than the previous concept (there was no safe point for teleportation? Boom, headshots.), And the players thoughtlessly teleported the teleported characters to random places. In addition, the cone mapping confused the interface.
Figure 5: freezing mode: when detected, the player can teleport the character to any point in the cone (screenshot taken in the pre-alpha version).Fake rewind
For some reason, we still thought teleportation was a good idea. Since the movement of the character was too strange and difficult, we wanted to simplify this moment. When found behind a character, a line appeared showing where it was before. Players could teleport to any point on the line, as if “rewinding time” for this character.
And there were problems again. Feedback did not work very well and the players did not understand what they needed to do. But I still think that after several iterations we could improve this function. Unfortunately, there was one huge problem: if a player chose a character that he hadn’t managed for a long time, then this function looked very ugly. Of course, the players did not remember where the character was before, and they were surprised by what principle this strange line was created. In addition, she could cheat on snow levels. Here, the guards follow you, seeing your prints ... I think it is easy to imagine further. Show your prints to the enemy, make you move behind you and teleport behind him. All honest.
Figure 6: fake rewind: players can teleport to any point where the character was before (alpha version screenshot).And I have not yet mentioned the dirty tricks that had to be applied when several characters were found, or, worse, they were at different points on the map. I still remember with dislike this dark time for us.
New approach
Finally, we realized that it would not work. When you go down in a spiral, it is best to step aside and look at what you really want to achieve. We started with good ideas, and gradually we went down. We are constantly based on the previous failed attempt, but did not draw conclusions from it. This did not allow us to approach the problem with a fresh look, to come up with something simple and clear. Do not repeat our mistakes. Sometimes it is worth taking a step to the side. In theory, we all knew it, but for some reason we did it not early enough, and it seems to me that this happened too often.
Looking at the problem from a different angle, our creative director Dominik Abé suggested a simple slow-motion feature that turns on when a character hits the visibility cone and it starts to fill with yellow.
Again, some problems. First, to test the function, we simply slowed down the whole game. This gave the players more time to react. The problem was that they perceived the function as a punishment and a hindrance. It seemed to them that they were being slowed down when they were trying to escape from the approaching yellow line, and that was not fair. We tried to rectify the situation by making the player's characters faster than the rest of the game, but the problem persists. In addition, there were problems with animations and video effects.
Therefore, we decided to stick with the slow motion, because this type of problem could definitely be solved. In addition, this approach seemed to us the most simple and elegant solution of all. Another factor was the budget - the moment came when we had to stop at something.
In the end, the solution to these problems seemed very simple. Basically, it concerned fine-tuning the game slowdown parameters and changing the balance of filling the visibility cones with yellow so that an attempt to escape from them in slow motion would bring satisfaction. To make it work, we didn’t even have to force the characters to move at different speeds. Some players are still disappointed in slow motion, so I think that someday we will need to return to setting it up again.
Conclusion
Visibility cones are the base part of the game, so in this article we could not consider the rest in detail. I decided to focus on the moment of detection, because this is one of the areas in which we have experienced the greatest difficulties, and it seemed to me that this particular process would help other developers who encountered similar problems.
We tried to find a single powerful solution for Shadow Tactics that will provide instant response when a character is detected and allow it to magically escape. As a result, instead, we created a function that slows down the detection process and gives players more time to react and solve the problem creatively. It is wonderfully combined with the essence of the game, and in the future we want to consistently improve it.
I am sure that the cones of visibility and the moment of detection can still be improved.
For new games, I would love to experiment with the fact that the interval before discovery has more diverse consequences (for example, triggering an alarm), and would not consider only the moment of detection. There are many possibilities for this, especially when studying the behavior of security guards. Such experiments will add a new dimension to the game, allowing the player to actively interfere with the onset of catastrophic consequences.