Unity Tiny - A Mini Project

Unity Tiny - A Mini Project

A few weeks ago I took an interest in a preview feature of the Unity game engine known as ‘Unity Tiny’. It’s basically a rewritten smaller core, the very base of which comes in at just 72kb.

At time of writing it is has a few limitations and interesting bits about it. The Unity engine itself is primarily written in C++, with developers who use it interfacing with the engine via C# using the Mono runtime. Unity Tiny initially is actually written in TypeScript, at least until it migrates over to using C#. Secondly, Unity Tiny is in an early form of preview and its current feature set allows for 2D games.

I took this as an opportunity to do a few things:

  • Familiarise myself with TypeScript, as it’s a language that I have ‘seen’ but haven’t really had first-hand experience with.
  • Learn about Unity Tiny and try to discover first hand how small a simple game can be.
  • See if I can’t do some trickery to fake a 3D perspective with the 2D API.
  • Become familiar with the Data Oriented Design methodology that Unity is beginning to push with DOTS (Data Oriented Tech Stack). There’s a bunch more abbreviations but that’s probably better described on Unity’s own site.

The end result was this simple little game - a simple ‘cube runner’ clone, where the simple goal is to avoid the cubes by moving left and right.

I’ve actually put the full source code online on GitHub as well:

I only spent a few days on this and was pretty happy with the outcome. I was able to familiarise myself better with TypeScript and the surrounding ecosystem (Node.js, linters, an appreciation for VS Code’s TypeScript editing compared to Visual Studio’s somewhat less ideal alternative (although I still greatly prefer it for everything else.) and a silly little 3D fakery achieved with a projection matrix.

The game can be viewed in full on this page - it works on both regular computers as well as mobile phones surprisingly well:

For further details I recommend visiting the GitHub link above as I posted some more technical notes in there.