On this very special Christmas evening, I have added teleporters and a way to support different aspect ratios.
Let’s begin with the exciting feature of supporting different ratios:
The game is based on rooms with a size of 18 x 10 meters. The resolution of the background image is 1920 x 1080 (Full HD). We are using a orthographic camera with an orthographic scale of 5.0625 (IIRC) to fit it all in what can be considered todays standard resolution.
When switching to a higher or lower resolution with the same aspect, we don’t have to do much as everything will scale nicely (except the size of the grain from the post-process stack v2, which I had to scale manually). But if we switch to a resolution with a different aspect ratio, let’s say… 4:3 like 640 x 480, the camera will “misbehave” and cut off the room on both sides.
What we need is a different orthographic scale to “zoom out” a bit (and I’ll be honest: I looked the formula up do calculate it).
Now we end up seeing the whole room again, but at the same time we also see parts of the rooms above and below. And this is not what I want as it will give away too much and will not look nice as the background image changes each floor and you will see the edge of it.
So, in addition to the new scale, I have added black bars on the top and bottom (or left and right in case the resolution is wider than 16:9). To do so, I created quad meshes with a plain black material and position them in front of everything else as children of the camera to hide everything outside of the current room.
Voilà, complete aspect ratio support!
Teleporters!
Teleporters in this game are also checkpoints in case you decide to have an accident. When you reach a teleporter it is discovered and you can reach it from any other teleporter (or from anywhere after you get the teleport cartridge for your exoskeleton).
I liked the idea to select the destination just by its relative direction from your position. You just push the joystick roughly in the direction of the other teleporter and can go there. This will make you memorize the positions of those a bit.
When using the teleporters, there is a placeholder fade out effect now. I plan to deconstruct the player sprite and reconstruct it at the destination (like I have done in Spaß Taxi). I’m also going to create a new post-process stack effect for the fading between rooms here.