A new update for Tilt Arena was released today which includes some graphical enhancements and the unlock system I’ve been wanting to introduce. New weapons (and bombs!) are unlocked at set score intervals, a great way for me to add even more weapons over time.
Tilt Arena has been updated to include a global leaderboard (which I am currently rocking, I’ve had practice) and a new input system that makes tilt more precise and lets users invert both the horizontal and vertical inputs. I’d hoped this update would also fix tilting for people with Nook color and Xoom devices, but it appears some are still having problems.
Lately I’ve been working on a game for Android based devices as I believe in the Android platform and wanted to show it some developer support. In the few weeks I’ve spent with this project I’ve learned about some performance bottlenecks the hard way so I’m putting together a quick list of things to be aware of that may help out other Android game developers.
Memory allocations are slow
One of the worst things that will hurt performance are memory allocations. These will produce noticeable pauses when many or large objects are instantiated all at the same time, and if you are using Java collections like ArrayLists they will even slow down item enumeration in loops. Keep collections away from your main loop to keep speed up – this also ties into the next item:
Just like memory allocation, memory deallocation by Dalvik VM’s garbage collector will also affect performance. The main symptom of creating objects during your game loop or calculations will be regularly spaced jitters during executation. The garbage collector will run intermittently to clean up any objects that are no longer in use, how often this process occurs depends on how much memory is being left behind.
Java’s collections will also create and leave behind memory during add, remove, and even enumeration which are other good reasons to leave Java collections behind in favor of fixed size arrays.
Logcat is your friend!
The adb tool that’s installed by the Android SDK will let you view the live log being written by the connected device. Most importantly this will show garbage collection events and crash logs being written by your application which will point you at the line in your code that caused the exception.
The latest iteration of Ubuntu, Maverick Meercat, is the first release where Canonical took a real interest in making it look and feel better and it shows – the prepackaged Ambiance and Radiance themes look great out of the box. But what’s the fun in running a linux install without customizing anything? We can make things look even better by taking a few minutes to install a new theme, icon pack, and dock.
What we’ll use
Elementary theme (including Elementary-Nautilus)
Faenza icon pack
Docky in replacement of the bottom panel
The latest Elementary theme for Gnome can be found at author DanRabbit’s Deviant Art page or it can be installed using via the terminal (Applications → Accessories → Terminal).
After running the commands above the Elementary theme will appear as a choice in Appearance Preferences, under System → Preferences → Appearance. The Elementary developers have built their theme to work best with the pared down Elementary version of the Nautilus file browser that 10.10 comes packaged with. The lightweight Nautilus-Elementary stands alone even without the new theme so this is just a great excuse to start using it.
After installing Nautilus-Elementary logout and log back in to start using the new file manager. Making the folder breadcrumbs appear correctly using the Elementary theme will require a small fix: In Nautilus head to Edit → Preferences → Tweaks and check the ‘Show like breadcrumbs’ checkbox.
The Faenza icon pack has been gaining some notoriety as one of the best looking icon packs available, if you haven’t already done so this would be a great time to check it out. The easiest install of this pack is, again, via the terminal.
Finally we can install the Docky application dock to infuse a bit of OSX flavoring to things. My favorite feature of Docky has to be it’s window dodge style hiding, with that setting enabled the dock will only be visible when not obscured by a window but is always accessible by moving the mouse to the edge it’s been attached to.
Head to Applications → Ubuntu Software Center
Search for Docky, and install it
Remove the default bottom panel (Right Click → Delete This Panel)
Now you should have a desktop that rivals anything this side of the desktop world so stand back and enjoy your handiwork or, better yet, keep on customizing.