Our game is actually in 3D! “What is this powerful magic you wield?!” you may ask yourself. 🀯 Read below to find out.


What is this about?

Project Ghost is a multiplayer horror game focusing on lighting and shadows. In this progress update, we will dive into our journey in refactoring our game from 2D to 3D in Unity


How we started

We started by sketching a concept piece for the lighting behaviour and dynamic shadows to nail the game’s atmosphere early. This example below is hand-drawn and was our starting point for prototyping in Unity.

Image showing the different concepts we started with.

Our first prototype

As we started experimenting in Unity 2D, we quickly realized that the results did not embody our early concepts’ realism. For example, the gif below shows how flat the shadows appear in 2D. So we started searching for a solution.

GIF of 2D lighting from our prototype

One of our early inspirations for our art direction was Enter the Gungeon. Through research, we stumbled upon this image of their Unity scene and could not believe the magic they were wielding. πŸ§™β€β™€οΈ

Screenshot from Enter the Gungeon

It turns out that tricking players into viewing only a 2D plane of a 3D scene leads to much more realistic dynamic shadows. So we set out to implement this technique for our game.


How we switched to 3D

We created a brand new 3D Unity project, and instead of using tile sheets, we used 3D walls and floors like in the red/left side of the picture below. We used a Unity plugin called ProBuilder to help us with that.

Image comparing the locked 2D view and the 3D world

To make 3D look like 2D, as shown in the blue/right side of the picture above, we used an orthographic camera in the scene and angled it at 45 degrees. See our camera settings below.

Screenshot showing the camera angle at 45 degrees and the projection as Orthographic

Since these settings made our 2D sprites look squished, we either angled our sprites to 45 degrees like the camera or multiplied the Y axis of our assets by a factor of √2.

Image comparing the normal, stretched and tilted sprited

Tilted sprites can lead to an issue where the asset will clip into boundaries, like in the picture below. Choosing between tilted or stretched is a case-by-case situation.

Image showing a sprite clipping into a wall

Dynamics shadows

We are also adding 3D objects behind our 2D sprites for them to cast the right shape of shadows when a player shines their lights on them.

Image of tilted sprite and the invisible game object that casts the right shadow

Again, tilted sprites were causing issues. They may clip into the 3D invisible object and cast a shadow on itself, like in the picture below. Knowing when to use tilted or stretched is often a trial-and-error process.

Titled sprite casting a shadow on itself

We also use 3D models for particular game objects like our interactive cabinets. It allows our animations to cast the correct shadows and not clip into walls. See the resulting shadows below.

Gif of dynamic shadows of one of our interactive cabinets

Dynamics shadows

Depending on the design of your game, it’s essential to choose the right tools to achieve your goals. Indeed, our refactoring to 3D was necessary for Project Ghost.

In the next edition of the newsletter, we will dive into the issues we encountered in achieving a pixel-perfect look for our game in a 3D environment. SPOILER ALERT! 🚨 It involves a magic number… Stay tuned.


Subscribe

You can sign up to receive updates and special announcements directly into your inbox every month! By signing up, you will also be registered to be a playtester for our upcoming community playtests!