Wednesday 22 August 2012

Mr Nibbles, Free on iOS, Android & Browser



Finally! Apple approved the iOS version of the game this morning, and this evening I finished off the site, so the holy trinity of game availability; iOS, Android and the browser is now complete!

Check it out:

app store
google play

or at: http://www.mr-nibbles.com



For once I actually finished one of my projects :) Im really happy with how the whole thing went, sure it went a couple of weeks over my original three-week estimate but still im happy with the result. Of course there is so much that could be improved, but for a free game made in a very short time I think it has done its job and shown what is possible thanks to Haxe and NME!

I hope to write a longer post-mortem post soon about the entire process and highlight any issues of the process itself. Stay tuned!

Wednesday 15 August 2012

Improve Flash Builder Performance and Compile Times by 30%

I spend most of my working day and sometimes my evenings and weekends coding in Flash Builder. Flash Builder is the main professional coding environment for Actionscript and MXML and is sold by Adobe.

Its fairly okay as an IDE, not the best but not the worst also. I wont go into all of Flash Builders' problems (I would be here forever) but instead want to talk about one key way you can improve your efficiency when working in Flash Builder.

Firstly the test environment :



Its a pretty beasty machine, the project and flash builder folders are sat on an SSD drive.

I have two projects to test these compile times with. Using RichCodeAnalyser:

Project A

1670 Classes, 188,771 Lines

Project B

2386 Classes, 135,647 Lines

Both projects have a mixture of MXML and AS files as well as employing several .swc libraries.

Ill be testing two different scenarios. 1 complete build from clean. 2. a single line change in the Main class. Ill run each test three times and take the average. I close FB down between projects just in-case there is any memory caching limiting the performance. All builds are built in debug mode using various different Flex SDK versions.

So using the vanilla install of Flash Builder 4.6:



Not a good start. The two projects wont even compile. They get so far through the build then crash, not just the compiler but the entire IDE itself, ugh!

So the first improvement is to up the amount of memory that Flash Builder has. Incredibly  (in this day and age) you have to manually do this, it isn't built into Flash Builder (which is built on Eclipse). So to do this you need to edit the FlashBuilder.ini found (on my machine) at:

[codesyntax lang="text"]

C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\FlashBuilder.ini

[/codesyntax]

The main setting for the amount of memory is "-Xmx512m" which sets the maximum value of the heap to 512Mb. So to give FB more memory set that to:

[codesyntax lang="text"]

-Xmx1024m

[/codesyntax]

If you try to set it any higher than this then FB either wont start or will crash at some point. This is to do with the maximum addressable memory when running the 32bit JVM (which FB uses).

Okay with that value tweaked, I ran the tests again:



Great so now we have some baseline figures to compare against lets apply the major speed boost.

From Wikipedia:

JRockit, a proprietary Java Virtual Machine (JVM) originally developed by Appeal Virtual Machines and acquired by BEA Systems in 2002,[1] became part of Oracle Fusion Middleware in 2008.
The JRockit code base and the HotSpot virtual machine from Sun Microsystems (now Oracle) are currently being integrated, with the target of releasing a JVM with a combined code base around the release date of JDK 8.

JRockit was made free and publicly available in May 2011.
Many JRE class files distributed with JRockit exactly replicate those distributed with HotSpot. JRockit overrides class files which relate closely to the JVM, therefore retaining API compatibility while enhancing the performance of the JVM.


Faster JVM is the critical part here as both eclipse and the Flex compiler rely on it. You can grab it over on oracle's website: http://www.oracle.com/technetwork/middleware/jrockit/downloads/index.html

You will want the 32bit installer, download and install. Once installed go to the install directory for the JDK, inside there is a JRE folder:



Copy it, now open up the Flash Builder install directory, rename the jre folder in there to something and copy in the jrocket jre:



And thats it. Now Flash Builder will use the JRocket JVM for the IDE and for compiling. Okay so running the tests again we get:



Nice! Thats a 27.5% improvement for a clean build on project A and 27.3% improvement for project B. For a single line change its 35.7% improvement for Project A and a 22.3% improvement for Project B.

Hope this helps some peoples out, I just wish I had known about this years ago!

Sunday 12 August 2012

Github Project Uploads



Its a lazy sunday so I have decided to do a few chores I have been meaning to do for a while. One of them has been to move some of my old projects over from Google Code over to Github and to begin uploading some of my older projects that are scattered through this blog directly to Github.

So I have first moved over Chrome Crawler (https://github.com/mikecann/Chrome-Crawler) my Chome Extension for spidering sites.

Also I moved Windows7 Taskbar Monitor (https://github.com/mikecann/Windows7-Taskbar-Monitor) a small C# application that provides stats-at-a-glance.

I then uploaded Portal2D XNA (https://github.com/mikecann/Portal2D-XNA) a c# based proof of concept game I made way back in university as part of a team project.

Finally I uploaded Audiobook Organiser (https://github.com/mikecann/Audiobook-Organiser) a simple Adobe Air based tool for organising and tracking Audiobooks.

I have a great many other projects scattered about the place which I hope to upload as I can.

Sunday 5 August 2012

The Final Development Update for Mr Nibbles Mobile Game



Well it may have taken two weeks longer than my original plan but I can say that after five weeks of development the game is pretty much complete.

All 30 levels have been finished, all the menus are in, all the game play elements and artwork are in. The only thing outstanding really is some better sound effects which I plan to put together tomorrow.

So unlike in my previous development posts where I have provided a playable version of the game in the post I have decided instead to hold off till the game is 100% complete before uploading it. I have also grabbed www.mr-nibbles.com as a place for the web version of the game to live.

So a short post this one, this week will be about packaging the game together and submitting to the various stores.

Before I go tho here are the three stages in the game, showing off the awesome artwork of my colleague Moh: