Start Your Engines

Part 2 of the series left us with the urge to pursue a 3D engine, but what can we do to get out of 2D land? In this post, we'll look at some of the options we considered to fulfill our 3D dreams.

Part 3: What Engine Options for 2.5D Game

Truthfully, we didn't look at that many options to satisfy 3D requirements; so I have once again proven that my series outline from Part 1 was not well thought out, but here we go anyway!

Option #1: Full 3D Game

As soon as I start talking about 3D games, the variety that inevitably comes to mind is what I'm going to call that of a "full" 3D game. In a full 3D game, the engine handles 3D physics and 3D rendering via 3D models. Most triple-A games in the current video game industry are full 3D games.

Interestingly enough, the direct successors to both 2.5D inspiration games cited in Part 1 appear to be full 3D games, despite having gameplay that is nearly identical to their true 2D heritage. I think that a lot of game developers wind up going this route because of already-built game engine support.

The Legend of Zelda: A Link Between Worlds
Golden Sun: Dark Dawn

If you really want to stick with the 2.5D look in a full 3D game, you may have to do some interesting acrobatics to get it to look right. For starters, the camera ought to use an orthogonal projection instead of the perspective projection more typically used in 3D games. However, the games aforementioned still use a perspective projection because... well, I guess if you already did the work for 3D, why not? In the case of A Link Between Worlds, the developers apparently tilted a lot of the models in the levels to create the 2.5D effect.

Obviously, I'm not up for the challenge of writing a full 3D game engine from scratch; so I'd be going with a game engine already out there. Based on some recent experience, Godot seemed like it might be a good pick. But this brings be back to reason #1 for not making a 3D game: 3D games are harder to make than 2D games. The prospect of making 3D models for everything in the game does not sound super appealing.

Option #2: 3D Engine with Sprites

A clever little adjustment to option #1 is to use a 3D game engine but 2D graphics. This method is hard to describe; so I'll just demonstrate a toy example from prototyping:

So here we have a flat image for the banner and a flat image for the floor, but we can also put in 3D models like the pillars if we so desire. Notice (somewhat visible in the image) that the camera is oriented at a perfect 45° angle to faithfully replicate the 2.5D look. Unlike some other game examples, we'll also use orthogonal projection to produce the right look. When we run the game...

The images don't look quite like we want them to. :/ They are a bit squashed. If we could only stretch it back to the desired dimensions... Highschool trigonometry comes to the rescue! Let's diagram out our situation with the banner sprite:

We remember from trigonometry that sin(Θ) = opposite / hypotneuse. If we work through the math, we calculate that the image of displayed on the screen is about 71% of the original size. To counteract this shrinkage, we can scale our images (or alternatively the entire viewing window) by 141% (see math). The result is a view with images at their proper height.

Ah yes. Now the images are the correct height, but the image looks bad.

I believe that the recent Octopath Traveler is an example of a game that employed a similar technique to the one described here as option #2. Notice the relative flatness of the character sprites to the most of the world around them. Again, these developers decided to go with a perspective projection, but the idea is still close.

What did we go with?

After spending so much time talking about the first two options, I don't regret to inform you that we went with neither of these options. Instead, we decided to go with something closer to the 2D engine we originally started with. There are a few reasons why making a 2D game is superior to making a 3D game for a 2.5D game.

Reason #1: Assets

3D assets are more work than 2D assets. This reason is somewhat based on personal perspective and not necessarily true in every case, but drawing a 2D image is a less daunting prospect than crafting a 3D model

Reason #2: Level Editor

3D level editors are more difficult to work with than 2D level editors. If the player experiences the game as primarily 2D, why can't the developer create the game as primarily 2D? There are a lot more factors going on in a 3D level editor than a simple 2D editor.

Reason #3: Image Quality

3D games look bad compared to their 2D counterparts. When 3D models are rendered, there is inherent loss of fidelity as the meshes and textures are mapped onto physical computer screen pixels. 2D games, on the other hand, can have images rendered exactly (pixel-perfect) as they were drawn by the artist. To hammer home this point, let me pull a different shot from Golden Sun: Dark Dawn that demonstrates how bad rendered 3D can look:

In practice, 3D games actually tend to produce better graphics than 2D games, but I think that is because they are generally built for smooth interpolation while 2D games tend to rely on choppy frame animations. The inferiority of 3D graphics, though, was particularly evident when exploring option #2 and comparing the quality against the 2D engine used beforehand. Of course, the issues for both 2D and 3D image quality can be mitigated, but I'm sticking with this point.

Wrapping it up

The bottom line is that we want to use a game engine that is designed for the kind of 2.5D game we are making. Most 2D game engines and most 3D game engines are not designed to create these games. 2D game engines do come pretty close in a lot of ways, but we'll need to tweak the paradigm, starting with height. More on that next time.