Updating The Infinity Machine


Pixel Perfect Setup

Since I first worked on this game, I've become more aware of how units work in Unity. When I created The Infiity Machine, I would throw images and text into the scene and resize them to my liking. The problem with this is that you get pixels of all sizes, which kinda ruins the immersion if you're trying to emulate a retro gaming style.

I've learned a little from each game I have worked on since and here is my cheatsheet for setting up a Unity project to be pixel-perfect.

Setting Up the project for pixel perfect.

Sizing the canvas

  • Create a Game View set to 180 x 320
  • Only ever view your project at 1x, 2x etc

Sprite Settings

Create a Sprite Import Preset with the PPI set to 32

Camera

Camera type should be orthographic.
Set camera size to SCREEN HEIGHT / (PPI * 2)
In our case, this translates to 320 / (32 *2)
=320 / 64
=5

For a Moving Camera

A script which moves the camera in increments of one pixel.
1 pixel is world units is 1/PPU
So like, 1/32 = 0.03125f public static float RoundToPixelValue(float value) { Float value = 1/32f; float remainder = value % multiple; float roundedValue = value - remainder; if (remainder >= multiple / 2f) { roundedValue += multiple; } return roundedValue; }

Fonts

Create a font asset with set pixel size
https://www.youtube.com/watch?v=rMYBnxuSPnI
You can only use the font in multiples of the point size you set.

Exporting

Set size of window in build settings

Post Processing

I've applied bloom and some chromatic aberration to give the game the feeling of  being played on an older device. To this end I've also added a scanlines texture in the 'Lens Dirt' field of Bloom to emulate a CRT screen

Before After

New Content

In addition to all that cosmetic stuff, I decided to add an element of backstory for The Infinity Machine. Try collecting the pages scattered about the room and check them out on the upgrade screen by clicking on the highlighted books.

Files

TIM_WEB.zip Play in browser
Jun 11, 2024

Leave a comment

Log in with itch.io to leave a comment.