Sunday, October 31, 2010

Playing with Minecraft levels

Minecraft is currently the only PC game I play these days. All my other games are on consoles. If you don’t know what Minecraft is, you can start here, but in a nutshell it is a freeform sandbox game set in a randomly generated world where you can mine and build.

Having spent some time playing I’ve built up a complicated network of structures and tunnels in search of those elusive diamonds (have not found them yet). It would be nice to have an alternative way of visualizing that world, so with that in mind I ignored the other mods and tools out there and set about writing my own.

The first tool is a NBT file to TXT converter. NBT stands for Named Binary Tags and is a format created by Notch for his Minecraft game. Following the documentation on the website I created a tool written in C# to read the compressed data files and turn them into a human readable format. The tool doesn’t understand what is in the files beyond the tags, which are essentially the metadata. The next step is to create something that understands the level format and is able to display the world in some way, such as a 2D map.

The tool is reasonably simple. It opens the target file into an uncompressing GZip stream and starts creating Tags. The Tag abstract class takes care of parsing basic data types and parsing the Tag Type to get the actual Tag derived object created. Each derived type parses its payload of data, which in the case of a List or a Compound will consist of other tags read recursively. Once that is done I write everything to another file by recursively calling the tree of Tags.

I should be doing some more Android programming but I have to admit little projects like this are more fun for me :).

Wednesday, October 20, 2010

Creating that first App

It is easy enough to pick up a new language or a new platform when you have been programming for awhile, but coming up with that killer app to publish and let people actually use is a lot harder. It is easy to do the actual publishing, which is something I will be attempting in the coming weeks. The hard part is going from playing around with code and making little demos to actually making a decent bug-free (mostly) piece of software that people will want to use, and maybe even pay for.

It is best to start with a simple idea, even if it is inspired by what is already out there. It’s nice to be able to come up with a great new idea and be the first to realise that idea, but you could be waiting a long time for that flash of inspiration. If there is an app you really like, but it doesn’t quite do what you want, or maybe it’s buggy, or not available for your chosen platform, you could create your own unique take on that idea.

One common type of app, one which I have tried a number different versions of is a task list or note taking app. It is always nice to be able to make a simple list you can take with you in electronic form, even if it is just for shopping. And since you have your phone with you all the time, pulling it out to make a note of something you’ve found out and about is also nice. Currently I have three apps that fit that criteria on my phone.

Evernote is a note taking app that keeps your account on the web so all your notes are available where ever you have Evernote installed. It’s a nice app but you don’t always need to have your notes on the web and sometimes waiting for them to download again on a spotty 3G connection is a bit of a pain.

Astrid Tasks is a task management app. It has lots of options for categorizing tasks and keeping track of due dates and reminders. It has a lot of depth but it can also be very simple by default. Just enter something in the text box at the bottom of the list and hit add, and there’s your task. I like this app but don’t find myself using it a lot. Most of my tasks are work related, and in that instance I have Outlook on my PC for that kind of thing.

Spring Pad is my latest download. It is a note taking app with some brains. There are different categories of things you can add from plain notes and tasks to restaurants and products you might be shopping for. It syncs to the web and apparently is able to organise your notes by matching up keywords and doing product searches on the Internet and things like that. I haven’t given it a good go yet, but it looks like it fits in well with what I’m looking for.

These apps have given me the idea to create a simple check list app. I actually came up with this idea based more on Astrid before I downloaded Spring Pad because what I wanted from Astrid was to create a simple list of items to check off that would remain separate from other tasks, a task with sub-tasks in a way. This would replace my current paper grocery lists which I sometimes take the time to write if I don’t want to visit the supermarket three or four times in a single week. It is a simple idea but I’ve decided to go ahead with it as my first app with an aim to publish. I won’t be selling it, and I don’t think it even warrants ads, but I will decide on those later.

Over the next few weeks I will post my progress on the development then the publishing on the Android Market.

Wednesday, October 6, 2010

Developing for Android

Mobile development isn’t new to me. I’ve been developing on Windows Mobile for three years now. Things have changed recently though. First there was the iPhone. It really started the consumer smartphone wave with its easy interface, big touch screen and most importantly, the App Store.

Now Android has joined the party. I have an Android phone, and HTC Desire, and I love it. It’s my first smartphone and I could never go back. The big advantage of Android for me is the freely available development tools and the open nature of the market. That said I also have an iPod Touch which is brilliant. After being a consumer of both the Apple App Store and the Android Market I have to say that Apple’s control doesn’t seem as bad as I first thought.

Over the past few months I have been taking my first tentative steps into Android development. I have eclipse, I’m picking up Java again, and I even have some Android books from Amazon. It’s time I get something published though. Watch this space.