Getting the Most out of Unity

BY Arthur Low
My first foray into programming was with a language called QBASIC. The Quick Beginners All purpose Symbolic Instruction Code was a perfect tool for learning the very basics of computer programming. It started innocuous enough, learning the fundamentals of logic, user input, and screen output. My classmates and I would practice by writing simple programs that would let the user guess a number or compute the result of a mathematical equation, but we quickly learned, as children are apt to do, that we could make the computer do anything. If we could imagine it and our logic was sound, we could program it. Our common ground was games, and before us was a tool with which we could create our own. For our naive little group, pushing the limits of QBASIC's simple IDE and interpreter was our new mission. The power was intoxicating.

At the time we likely thought we were utilizing QBASIC for a means it wasn't designed for, but it turns out programmers have been using computer systems as tools for game development since their invention. Believe it or not, the beloved Pong and Magnavox Odyssey [1972], which kicked off the first generation of video game consoles, wasn't the first video game. A full twenty years earlier we had technical demonstrations of tic-tac-toe, checkers, and chess! We've come a long way since the days computers were the size of rooms and data was displayed on 35x16 dot matrix cathode ray tubes. Our tools have evolved over the years: from one needing to be skilled with the properties of electricity and glass blowing, to understanding logic gates and soldering, to instruction registers and high-level languages, to full on game engines and frameworks. Nowadays, games are complicated programs created by even more complex programs designed by highly skilled and creative people.

Making games is a balance of simultaneously pushing the envelope while saving time. We look for ways to write code only once and create tools for the explicit purpose of reuse, especially for the most commonly encountered problems in game development. For example, say you need a 3D model for your game. Typing in every vertex location by hand would be incredibly tedious. I bet someone did that only a few times before proclaiming, "There has got to be a better way!" So software was created to make the process of placing and editing vertices easier. In this example, a dog can quickly be turned into a cat (artists, forgive me). No need to hunt down points in a text file and guess at which one you are editing. One of the most common tools a game developer will use is called a Game Engine.

The engine is a framework of project-tested solutions for things most games have in common, like graphics, physics, or messaging systems. It's common to bring all that code from one game to the next as there is little point in starting over on such generic systems. The game might have different mechanics, or new art, but the skeleton of it all will be near identical. So what tools does Filament use, and why?

To many, it will come as no surprise that Filament does a lot of its work in Unity. Unity is a game engine that exposes many of its features as tools to assist with customization. It's simple enough for anyone with experience in game development to grapple with, but complex enough to serve the needs of skilled developers in creating many different types of games. I was skeptical when I first encountered Unity, and it took awhile for it to win me over. Having been lucky enough to go to a school where I became intimately familiar with a book called Computer Graphics: Principles and Practices [Foley, 1990], I was used to writing everything from scratch - as if using other's code or tools was cheating. I didn't like missing out on developing valuable programming skills and new math by relying on the work of others. But the thing is, I had been subconsciously justifying a whole bunch of tools I used every day that made game development easier. I was using Bjarne Stroustrup's C++. I was using Microsoft's Windows operating system. I didn't invent the monitor I was looking at or the CPU in my computer case.

Progress in Computer Science, like many fields of study, is achieved by standing on the shoulders of giants. To participate effectively you must be a link in an unbroken chain of paying it forward. Here I was, with my bias rooted firmly in the era I first studied computer programming and game development. While learning the fundamentals inside and out is invaluable, too much focus on problems already solved wastes not only your time, but the time put in by all those who came before. Unity Technologies made a really great game engine - therefore we should use it. Unfortunately, time per project is finite, but with Unity solving many of a project's needs out-of-the-box, developers can focus on what they really care about, the player experience. With Unity we can dream bigger, iterate faster, and reach farther.