Warning: Declaration of C_DataMapper_Driver_Base::define($object_name, $context = false) should be compatible with C_Component::define($context = false) in /home/geomys0/public_html/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.datamapper_driver_base.php on line 0
Welp, after talking about it and diddling around for years, I’ve finally cinched up my belt and gotten to work. No more grandiose dreamy kitchen-sink projects; no more build-it-all-from-scratch mentality. Just modest and achievable indie ideas, leveraging the latest tools for rapid game development and deployment. This time I’m serious, and I’m doing it right.
I should’ve been blogging as I went along, but… I didn’t. So here’s the last few weeks in a nutshell. About two weeks ago, I downloaded Unity and started going over some basic introduction to unity articles and videos. Evaluated a few other options as well, but Unity seemed like the best option for what I wanted. That Wednesday I started working to learn Unity in earnest. Ran through the official tutorials, and was wowed by how powerful and efficient the toolset seemed to be, so Thursday afternoon, I decided to try to throw together something simple, to test what I’d learned. I quickly realized that I’d hardly learned a thing! The official tutorials I’d done were filled with sleight-of-hand, depending entirely on the pre-fabricated projects where most of the real work had been done already. It’s possible the problem was that I skipped many of the introductory tutorials and went straight into the more advanced ones, I don’t know. In any case, I was discouraged at the end of Thursday, and considering other options.
Went out of town for the weekend to visit family; had a good time, good food, plenty of alcohol, and came back the next Monday ready to get moving again. I decided I would make another effort to learn Unity before abandoning it, and found a tutorial series by Walker Boys Studio. No slight of hand this time; the tutorials started from empty projects, and while their final results were not nearly as impressive as those for some of the official tutorials, they helped me bridge the gap from getting started in a blank unity project to where the official tutorials I’d reviewed had picked up.
The intro videos felt a bit spoon-fed for someone who’d been programming as long as I have, so I skipped the warm-up stuff and dove straight into their fifth video tutorial series on making your first game. Came out the other side feeling like I’d picked up quite a bit, and started on the 2nd game tutorial the next day, filled with enthusiasm and confidence.
During the introduction of the 2nd game tutorial, it became clear how simple the shooter game it was walking me through creating was, and feeling confident as I did, I decided to follow the process from this series, but to make a different game. The tutorials produced a simple vertical-scrolling shooter, I decided to make an asteroids clone instead. 12 hours later, I reached the end of the tutorial and had a playable web build of my asteroids clone. It was amazing. I could probably have produced the same game in the same time using my old from-scratch C++ method, I figured, but Unity let me build web, windows, and mac versions with just a few clicks, without changing a line of code! In the process, I had started learning to think like Unity, and I was liking it. And that 12 hours included a huge amount of time spent watching the tutorial videos and burying my nose in the unity script reference, so in the future I could expect to reproduce the same it in far less time than that!
So by the end of Wednesday, one week after downloading Unity, I was completely sold on it’s virtues. Next up was putting Unity to the test as a mobile platform. Thursday was devoted to setting up an apple developer license and getting my dusty old Mac Mini reconnected, updated, and prepped for work.
So was Friday.
And half of saturday.
Yeah, me and the mac, we were not on the same page, at all. I’d toyed with iOS development before – it’s half the reason I owned a mac mini in the first place – and this was the point where those past efforts had come unravelled. Not this time, though. This was the final battle in a drawn-out war, and I was determined to win. I was committed. I was not giving up. In the end, just getting the entire unity->xcode->iphone build process working at all took around 30 hours, twice as long as it had taken to build my asteroids game for the web. I neglected my body, my house, and my dog. I barely ate, hardly slept, and didn’t shower. I uninstalled and reinstalled xcode at least a dozen times, with different settings, different versions, different orders of installation. Eventually, I emerged on the other side Saturday afternoon with my asteroids clone on my iPhone. It wasn’t playable – it was setup to use keyboard controls, so you couldn’t turn or thrust, just shoot by tapping the screen – but it was still a momentous occassion, which I celebrated by drinking until I passed out – from fatigue, not alcohol, though it was a close race!
Sunday started, obviously, with a hangover, and was otherwise devoted to catching up on chores around the house that had been neglected during the war. Started contacting artists – just a few I was friends with, to start – to get some idea what contracting art would cost me. Realized about this point that I was going to need branding assets for Geomys Games, so started thinking about what I wanted for that. Otherwise, I took it easy: played some video games, watched some tv, played with the dog. Gave my mind and body a chance to recover.
And that brings me to this week, five days ago, Monday. My first priority was making the game actually playable on my iPhone, which meant on-screen controls. I’d researched this a bit over the weekend and had one of two options in mind. First was the joysticks included with Unity in the standard mobile assets package, and the second was the open-source Unity UI Toolkit started by Prime31. The toolkit seemed excellent, but it also seemed like overkill for my immediate touch-thumbstick needs, so I went with the standard asset thumbsticks instead, but bookmarked the site for future reference when my needs were more robust. Dropped them in, wired them up, and they worked like a charm. Strangely, I could not seem to find an equivalent drop-in on-screen game-style button, but making a simple one from scratch didn’t take 10 minutes of scripting. The game was now playable on my phone. Also rebuilt my prefabs to use meshes exported from Blender. The improvement in the game’s appearance was slight, but in the process I learned the ins and outs of importing 3d assets and using them in prefabs. Unfortunately I ran into a problem – my new meshes were having lighting glitches on the iPhone. This is when I discovered UnityAnswers, where I asked my question. No response yet, but I’d already found a work-around by the time I posted the question, so it has not been a roadblock.
Tuesday was a bit of a wash, as I suffered a complete failure of discipline; I was testing on the iPhone, tweaking things, and each tweak required a several-minute-long rebuild-deploy process. It was during these moments that I started compulsively running to UnityAnswers, and long after the build was finished I’d be writing some lengthy answer to someone else’s questions, or just digging through old questions reading up. I learned a bit in the process, so it wasn’t a total waste, but at the end of the day, the measurable progress on my game was close to nil.
Wednesday, I hit the ground running again, avoided UnityAnswers, and focused on cleaning and polishing the game, particularly the iPhone version. Implemented the workaround for my lighting problem with the new meshes under iOS. Many elements were rendering too small on it’s tiny screen, so those got conditionally scaled up or swapped out. Fonts were baked to textures at fixed resolution on mobile devices, so I had to resolve that as well. The quickie buttons I’d made Monday were using simulated mouse input, and needed to be retooled to properly handle multitouch. The biggest task was retooling the thumbsticks.
I took apart the standard joystick scripts and rebuilt them, adding the ability to drag the sticks around with the mouse in editor mode, so I could do some degree of testing of the iPhone input settings without building and deploying the whole app to my iPhone (Unity Remote was just not functioning in a usable way on the terrible wifi in my house). Also added automatic disabling of the thumbsticks when not targeting the iPhone and integrated unity Input axis checks in those cases so that my actual game scripts could just grab input from the Joystick object without knowing or caring if it was an on-screen thumbstick on the iPhone or a game controller connected to the computer in a stand-alone Win/Mac build. Lastly, I tweaked the on-screen joysticks to allow off-center grabs – the built-in behavior could produce unintentional and potentially fatal movement from your character when first touched. Instead, I made them activate when you touched the joystick anywhere, but rather than snapping the stick to that position relative to it’s on-screen center, it retains the initial touch offset and moves the stick relative to that – like a real thumbstick, if you grab the edge instead of the center, you can still operate it normally. This edge-grab behavior seemed like a reasonable compromise between static always-visible joysticks and dynamic visible-when-touched controls, and I was pleased with the results. By the end of the day, I had a project that I could build as-is to web, desktop, and iPhone, with all the necessary platform-specific details changing automatically. It was beautiful, even if it was still an Asteroids clone with crappy programmer art. And it had only been 14 days since I first downloaded Unity and began looking at tutorials.
Wednesday night I made up a big list of things to do to the game the next day; most of with I promptly threw out Thursday (yesterday) morning, when I realized they revolved around improving the Asteroids clone rather than learning Unity3d and iOS development. This was supposed to be a learning project, after all, to be gotten out of the way so the serious development can begin. One item on the list I kept, and it was a big one – Game Center support. Asked google where to start, and spent the morning and early afternoon in iTunes Connect, getting my game defined and adding a leaderboard and some achievements.
That done, I turned back to Unity and, rather than reinvent the wheel myself, looked for existing plugins. I remembered seeing something like this on Prime31’s site Monday when looking at on-screen control options, and after some searching, this seemed like the easiest and best option, so I bought Prime31’s GameCenter plugin. $75 seemed a bit steep at first, but I decided to bite the bullet and try it out. Less than an hour later, I’d dropped the test scene into my game and was successfully interfacing with Game Center, authenticating and setting achievements. Any concerns about that price were gone.
Took a bit longer to get the leaderboards working and the code setup in my game to gracefully handle scores and achievements. In particular, scores were just not showing up properly no matter what I did, even though I was getting success signals. I suspect the GameCenter sandbox was just having difficulty that night, or perhaps it takes more time than I thought for the leaderboards to be up and running after setting them up on iTunes Connect. Achievements were easy, and confirmed I had things basically right. This morning I started testing and found my scores from the night before were showing up, and new scores were appearing almost immediately.
That settled, I implemented a system for remembering achievements and scores earned and re-submitting them to game center in the event of failure, and tweaked these to store unsubmitted achievements and scores separately for each account you used. Then I set up the project to fully automate the whole process, authenticating on start, automatically re-submitting any unsubmitted scores and achievements on successful authentication. Implemented my game’s three simple achievements, and that was that. All that was left was some final polishing of my on-screen buttons and testing gameplay thoroughly, fixing all the minor bugs I could find.
And then I came over here and blogged about it all.
Still some minor things to do to the game, but this weekend I’ll be starting my first original game design in Unity. Fueled with confidence by the success I’ve had so far, I can’t wait to get started!
You can check out the latest web build here. Still missing an instructions screen, but the controls are simple – left/right turn, up thrusts, ctrl fires.