logo80lv
Articlesclick_arrow
Research
Talentsclick_arrow
Events
Workshops
Aboutclick_arrow
profile_loginLogIn

Developing an Escape Room-Inspired VR Game in Unity

Vladimir Koščica talks about the intricacies of designing a multiplayer game that also supports VR and explains why lighting and texturing are crucial for setting the mood in the game.

Introduction

My name is Vladimir Koščica, and I am the Art Lead of the Escape Simulator (ES) game project. The game was developed by Pine Studio. The studio was founded in 2014 doing what we all love — puzzle games. Our previous titles — FARAWAY and BIRDCAGE — are our biggest earners, with FARAWAY being Casual Game of the year and BIRDCAGE being shown in all major Apple retails stores. 

Working on Escape Simulator

Real-life escape rooms inspired the game. We took gameplay to another level by allowing things you cannot (or are not allowed to) do in real life: smash vases and look at what is inside, burn the box instead of finding the key for it, drag furniture, break locks — all of this for the sake of solving challenging (and fun!) puzzles. 

The rooms have been designed to be enjoyed in solo mode, but they also shine when more players join in for a co-op experience. 

Eight people had been working on the project for two years. The team consisted of 4 artists, 3 programmers, and an audio specialist. We also had a nice collaboration with local Room Escape designers on room and puzzle design.

The Physics of AR/VR

AR and VR have been the key features of Escape Simulator from the start, and the game will be out for these platforms after the PC and Steam release. Players in AR/VR will have a full range of motion. They will be able to duck down, go behind the objects, look at them from any angle which works wonders for immersion and is a strong differentiator in the genre.

Physics in VR and AR work similarly as on PC, and the main differences are the interactions with it. Transforming screen-based interactions to 3D came naturally since the game was imagined for those kinds of motions. For example, throwing is much more natural in AR/VR environments than in standard PC controls.

In VR, the experience has to be smooth to avoid discomfort, so we had to adjust how we handle physics, so it is not too expensive for the CPU. In the game, we do not have colliders that line up perfectly to objects, but we approximate with collider shapes that are easier to process. That proved to be a great solution since we encountered fewer bugs in physics and had a faster workflow. 

For physics simulation, we use Unity’s built-in physics engine called Physx. Although there are some edge cases that we had to handle ourselves, it proved to be a solid out-of-the-box solution. For VR, we had to increase how often Physx updates the physical state of the level, which was a few clicks of work.

Designing the Environments

When designing for AR/VR, we had one major constraint or rule we had to follow and that was the 3x3 m measurement of the walking area. The reason for this is that we wanted the players to be able to play the game in a typical house room. Also, we tried to put most of the interaction puzzles on either crouch height or the normal standing one.

We had some fantastic ideas at the start of the project, like climbing up the stairs or standing on some moving platforms, but we were not satisfied with how that turned out, so we had to abandon the ideas. But one cool thing our programmers have been able to pull off is interaction with the game objects via your hands and your legs in AR mode. That is something new, and we cannot wait for the players to try it.

Interacting With Objects

Most items in the room can be picked up, except for the bigger scenography elements.
When you pick up the item you can have further interactions with it. An example is this suitcase. You can turn it around to see if there is some hint on it and then you can open it to pick up the items it holds. Then, every item in the suitcase can go through the same set of interactions.

Adjusting the Lights

NGSS is a Unity lighting plugin that enabled us to create optimized and high-quality soft shadows, which were essential to us because we were trying to create a comfortable feel in all the rooms. Harsh lighting with crisp shadows would interfere with that goal.

As for the light technicals, we managed to get great results with only one real-time light. The main reason was that it would give the players a smoother gameplay on mobile devices. So one real-time light (wide spotlight) is always in the center of the room, shooting down to create good contact shadows. The trick here was lowering the strength of this main light so baked lights can take their part because they were mainly responsible for creating mood. We did all of the baking in Unity. Room walls and big stationary models were all baked to only one 1024 px lightmap. Dynamic objects (objects you can pick up, move, rotate) could not go in static lightmap, so they were getting light information from the light probes.

Creating the Atmosphere

As I mentioned, we wanted the players to feel comfortable in all rooms. So the graphics had to follow this direction. We decided to go with slight stylization to distinguish ourselves from the classic, sometimes cold architecture renders. To achieve it, three things were used. The first one is the lighting/shadow part we mentioned earlier. The second is the edges of the models. We needed to exaggerate thickness using weighted bevels. Giving the edges more roundness helped us achieve an overall feeling of comfort (as with shadows, sharp shapes are mainly considered uninviting or dangerous, so we were avoiding them). 

The third thing is using simplified textures with increased saturation. We removed a layer of realistic small details in the textures because we felt it was too distracting. Removing unnecessary visual noise from the surfaces was done pretty simply by just overlaying clear color layers on top of the original textures, thus reducing detail in them. Saturation was tweaked using layer adjustments. These three things were enough for us to feel like we stepped back from realism.

Multiplayer

Multiplayer was also one of the core pillars when designing Escape Simulator. We wanted the game to feel like a real-life escape game, and that includes being able to be there with your friends. Because of that, the levels are designed in such a way that multiple people can contribute to the final escape.

Multiplayer development came a bit later in our development cycle. We had our core systems set up and did a few levels. But since the constant thought was "We need multiplayer in this", we wrote systems and code, so it was easier to add it eventually.
That being said, it was not a completely smooth ride. In the first multiplayer iterations, we used a third-party networking solution. It was relatively easy to implement, and we shipped the demo of our game with it. But as time passed, the cracks in the solution became apparent. It was full of code for different types of projects, workflows that we did not support or did not want to support, and probably most importantly, when we had a bug with it, we had to spend a lot of time finding and fixing it.

To combat this, we started working on our networking solution in the game. In our solution, we have two layers: one that is dedicated to transporting network data and one that uses the data and applies it to the game. For transporting, we are using Steam's peer-to-peer networking solution. As time passes and we deliver the game to other platforms, the transport layer will change, but for now, Steam networking is an excellent solution for us. The primary relationship we needed to achieve was one between our networking stack and physics engine. Syncing physics states between players is not a trivial task in Unity or in general terms. In the implementation, we used interpolation or smoothing out pose changes and extrapolation that tries to guess the next best physics state. For performance reasons, we do not sync physics in every frame, but only the ones that are desynced. 

Conclusion

Thanks to everyone for taking the time to read this article about our workflow, and we hope that you find it helpful or inspiring in some way. Also, be sure to follow us on Twitter and Facebook for updates about the game and the studio. You can also join our Discord. And do not forget to wishlist Escape Simulator on Steam;)

Vladimir Koščica, CEO at Pine Studio

Interview conducted by Kirill Tokarev

Join discussion

Comments 2

  • Anonymous user

    Amazing work! Already played the demo and it looks promising. ?

    2

    Anonymous user

    ·3 years ago·
  • Anonymous user

    The art looks really good. Vibrant colors. I tried the demo allready and the game is promising. Good luck finishing!

    2

    Anonymous user

    ·3 years ago·

You might also like

We need your consent

We use cookies on this website to make your browsing experience better. By using the site you agree to our use of cookies.Learn more