Tuesday, August 20, 2013

Square 1.2

As my old PC lay dying, I had the foresight to upload my Unity project files to a server where I could retrieve them later. A month or two passed.

I got a new PC, downloaded and installed Unity, downloaded my game project from the server where I'd stored it, and fired the whole thing up. I had lost all references.

All references. Materials no longer referred to textures. Prefabs for players and props no longer referred to the scripts that gave them motion and logic ("empty monobehavior" said the inspector). Core game objects no longer displayed UI, or tracked time, or responded to events. Everything was bright pink. Not one stone remained atop another.

If there was a way to protect against this, I still don't know what it was. The good news is that all my animations and calculations and pixel-nudges, all that information was still there. Not a single asset was lost. All the transfer did was sever every strand of the delicate spiderweb that held it all together.

Thoughts I had, working on Humpty Dumpty:

"I wonder if my increased ability to resolve common errors is less true learning and more memories of a series of brute force tricks used against the problem previously. It's not really like I understand computers a whole lot better than I used to."

"Once again I have lost work due to making changes while the game is running, and forgetting that when the game stops running all those changes go away. You would think I would remember that after a while. Unity's greatest prototyping asset is my Achilles heel."

"It's continuously weird how computer processes can echo the natural world, at least in the way things decay. Somewhere in this process something went wrong with some sprite sheets (import settings? Still don't know) and now there are blotches of discoloration on the player sprites, looking for all the world as though I'd moved them in cardboard boxes which got rained on."

"I wonder there's a difference between true learning and memories of a series of brute force tricks used against the problem previously."

"I wonder (and this is uncharitable and tinfoil-hatty I admit) if all these broken references are an unnecessary, deliberate feature, supported in order to drive users into the arms of Unity's for-pay version control system. Like the performance monitor, it's one of those things you won't notice isn't free until you're invested to a point where it's painful to live without." (Or maybe, says a contrary voice, you lack the skills to control the integrity of your own file systems! This is the curse of the semi-educated techie: we never know for sure whether it's all our own fault, but by some definition it almost always is).

"I should just chuck this and go make some simple games that use squares and circles or whatever and then I wouldn't have these kinds of problems."

"Perhaps this pain will finally make real to me those abstract concepts of OOP hygiene like encapsulation and abstraction. The player holds a reference to the hud for updating the score. Pick ups hold a reference to the scene manager object so they can flips the scene state when enough are collected. I know that somehow this is all wrong, and the way I know is that I can't get anything back online in isolation. It's like a beach-ball sized knot of Christmas tree lights with a few bad bulbs."

"Huh, the Unity folks released their Android support features for free? That shit was four hundred dollars! I wonder what it would take to put this thing on my phone?"

Not much, as it turns out. Sure, there are no onscreen controls so nothing actually works, but just the fact of this game I've been fooling around with suddenly being available in my hand is enough to give this project a much-needed adrenaline boost. This is actually kind of cool, and I applaud Unity for making it so easy. Still a little touchy about the broken references, but let's just move past it.