Showing posts with label livestock vs the undead. Show all posts
Showing posts with label livestock vs the undead. Show all posts

Friday, 16 September 2011

Lol! My Game Has Been Head Hunted!

Today I found myself both flattered and amused.  Out of nowhere appeared a message in my inbox that read:

"Hello Android app developer" (I've finally been recognised!)

"I am contacting you as I saw your app 'Livestock Vs The Undead Lite' on the web and found that it runs great on the range of Android tablets that our company caters for.

"As such, I have put it up on our Apps download site; AppsLib (appslib.com).  It's a specialized marketplace for users with android tablets to download app suited for, and tested on their devices."

It went on to say that they've created a developer account on my behalf and sent login details.  Sweet.  In fact, after logging in, I discovered that they have uploaded Zombie Pop Lite and Time Flies live wallpapers as well.

So if you have a tablet, please look up my apps on their site,  I'd be really interested to know how they look on tablets.

Given that the game is still in beta,  I was genuinely surprised and the extra attention is most welcome.  This gives me more incentive to push it into a fully fledged release.

Yay!

Paul

Tuesday, 6 September 2011

Livestock Vs The Undead

My story is far from unusual.  I had an android smartphone.  I liked playing tower defence games.  I had a modicum of development talent (Java being the eighteenth programming language I taught myself).  I wondered if I could mash the three together into some sort of Frankensteinian monster of a game. 

Just before I embarked on the slippery slide of android development, I had come across what is termed as a Production on Demand (PoD) site called Zazzle.  We've all had ideas for great T-shirt designs and slogans at some point. Well, this site lets you actually take that idea and slap it on not only T-shirts, but hoodies, ties, caps, cups, bags and a hundred other items.  You can then set up your own site-within-their-site and sell your freshly baked items to friends, family or anyone else you can convince.  It taps into your creativity in a big way and is quite addictive.  Let's just say: I went nuts.

A month later, with help from my wife (who joined in shortly after I did) I had racked up over a staggering 4,000 items!  At that point I came back to my senses and realised that (a) it was gobbling up too much of my time, and (b) the remuneration was relatively pitiful in relation to all the effort you put in (not Zazzle's fault - I just don't have young and/or trendy, fiscally endowed social circles).  Our store, http://www.zazzle.com/strangemoo is still open (with 5,577 items at time of writing), but my attention has now been firmly refocussed.

By abstaining from Zazzle, I found that not only did I have some time on my hands, but I had built up a sizable library of self drawn stock images.  Add some of those images to smartphone/idea/iota of talent and what you have there is a starting point.

Livestock Vs The Undead was born.






The alpha was at the time the best game I had ever played.  Looking back it was embarrasingly bad.  It was little more than chicken hurling bananas (Yes, bananas. What? It was there to use, Ok?) at zombies.  (Same zombie, different colours.)  Don't get me wrong. The coding was sound and most of the code is still beating away in the heart of the latest version.  It was just that it didn't do much and needed a host of stuff throwing at it.

My first piece of advice: Don't release anything onto the market too soon. 

Blinded by enthusiasm and pride of getting something working, I naively signed it off, plugged it and rolled it out onto the android market.  I paid heavily for this by getting some less than constructive criticism on the market that will remain there forever, no matter how many further releases I add.  By jumping the gun, I have branded my poor game a loser.

Realising my mistake and lessons learnt, I am basically treating the current game as a beta. At some point in the (hopefully not too distant) future I'll rename/rebrand and re-release it to start afresh.

The game is significantly better than it was. However I want to take it to a stage where I can look back at it at some point and consider it 'done' or even 'not bad' by my own standards.  If I am going to monetise this thing, I want to give my customers value for money, else I'd consider the project a failure.  It's not even the volume that interests me.  If 20 people buy it and love it, that's success in my books.

Ok, some stats now.  Android Market is both good and bad.  It's good that it allows us lonely developers to reach the masses.  It's bad in that (at the time of writing) the statistics it provides make little to no sense.  Figures go up and down almost at random.  Comments and ratings rarely make it onto the system.  The best I can make out of it is just taking the average from a daily reading.  At this point in time it looks like:




D - Downloads, I - Installs, C - Comments

Not too shoddy for a beta.  It was originally released in May 2011 and has been growing steadily.  (Not anywhere as great as Zombie Pop - but that is another blogpost.)  I've also made it clear (since the initial release fiasco), that it is a beta on the market and it still gets a few downloads per day.  I am convinced that the naff, very early comments are putting a lot of people off.  Google should implement ratings by app version to show a fair differentiation between the qualities of the releases.  


There is a definite spike when a new release is made (not shown on this graph) which I'll hopefully be able to demonstrate when I put v1.4 live.


Paul

Friday, 19 August 2011

Released Into The Wild

Android MarketImage via Wikipedia
So where am I up to, I hear you ask with feverish interest. Well, let's see...

Project #1 - Livestock Vs The Undead

In May 2011, I started work on what is currently titled 'Livestock Vs The Undead' (a working title whilst I coerce it into a semi-acceptable state). I unleashed v1.0 onto the Android Market in June 2011, which is where I embarrassingly stumbled over my first faux pas: I was asking for a payment for it.

On other more lucrative fruit-based mobile platforms, I would've been laughed at for not charging. The Android community, it turns out, is a different culture altogether. Reputation and respect has much more weight here, and this has to be earnt. So I picked myself up, dusted myself down and rethought my strategy from scratch.

I withdrew the paid-for version of the game, tweaked how far you could take the game and released it as a free download. With the intention of letting the dust settle and await some feedback from the community, my mind was ablaze with possibilities and I thought 'Some of this code would make a great live wallpaper' so I moved immediately onto:

Project #2 - Zombie Pop Live Wallpaper

As a kid I loved it when my Dad had porcelain statues delivered (he sold them for a living). It wasn't the statues themselves that interested me. It was the plastic bubble wrapping they came in. I know it's sad but I did enjoy tirelessly popping each unsuspecting bubble.

So, I had this warm fuzzy memory floating around in my neurons, and I had these zombies marching down my screen. The rest as they say is history: ZZPop LW (as it was called) was born. This was released onto Android Market in June 2011, along with:

Project #2b - Zombie Pop Lite Live Wallpaper

Wanting to test the water on whether people would cough up some money for an improved version of something they liked, I branched the development into a feature lite version. It is still a full playable version, just with some cosmetic restrictions. Again this was released in June 2011.

Project #3 - Pixelnote Live Wallpaper

As my mind was still fresh with Live Wallpaper development, I thought, 'wouldn't it be neat if you could draw straight onto your wallpaper without having to open up another app?'. Taking what I had learned on the last two and a half projects, I brought Pixelnote into existence. I realised that due to limitations of the medium and touchscreens I could only take the idea so far, but what the hey.

Pixelnote was released in July 2011 onto the Android Market.

Around this time, I started looking at the Amazon Android App Market. Even though, being outside the US, I can't actually download anything at this time, it didn't stop me from publishing the game and three wallpapers.

Since then I've released updates for both Livestock Vs The Undead and Zombie Pop and am currently pushing Livestock forward by quite a way (v1.3 is in beta and is looking better).

And that's pretty much it in terms of development. I'll do a post on each of the projects in turn next with a bit of background and the thought processes I went through.

Cheers,


Paul
Enhanced by Zemanta

Tuesday, 9 August 2011

The Secret Ingredient is...

If anyone ever tells you that developing a game is easy, I can categorically say they are lying.

Of course, the difficulty of coding is directionally proportional to how good a developer you are. I’ll factor that out for now. It's not even pulling all of the resources together which can also be challenging. Sprites don’t grow on trees, and picking the right boom sound for your bomb from thousands takes time!

It’s finding that magic ingredient and coercing it to behave nicely in your game – that’s the hard part.

After all - make a game too hard and nobody will invest in the reams of content you've painstakingly lined up for them. Make it too easy and you'll alienate the die-hard gamer (which also makes up a large chunk of your potential audience).

Unfortunately you can't slap the difficult smack bang in the middle either, as again players will simply lose interest. You could adopt a linear approach, where things get a little harder each level, however this can still leave the gaming a bit flat. So, the magic formula, from my humble opinion, would be adopting a difficulty curve to broadcast a subliminal mental challenge to unaware psyches of your audience. Make sure that you don't start too easy, and don't end in the land of the impossible (although there are some games that lean that way).

Make a game too complex and people will walk away, too simple and you’ll patronize them.

Of course, how a difficulty is portrayed in your game can come in any shape or form. For example, in Livestock Vs The Undead, I have literally hundreds of factors that I can tweak. From creep speed, to tower firing rate, to number of bonus drops, the list goes on and on and is growing with each new feature I add. And any of these has greater or lesser impacts on how the game finally plays.

Another trick is throw accomplishments and treats along the way. Everyone likes presents, so giving your customers 'thank you’s through the medium of a power boost, or extra time will go down a treat (pardon the pun).

On top of all this you have to slap layers of probability. Thirteen year old Canadian females might life fluffy pink rabbits in their games, whereas Italian 27 year old males would prefer sports cars. So, you have also have to try to appeal to the middle of the curve.

Developing games is not easy.

It is fun though.



Paul
Enhanced by Zemanta

Tuesday, 19 July 2011

Where did I start and How To Fix Lunar Lander

Buzz Aldrin removing the passive seismometer f...Image via Wikipedia
Ok. So you've got this idea and your target android device in mind, but you've no idea of what to do next?

My primary OS/s are Windows 7 and Linux (Ubuntu's v11.04) so I can only comment on my experience with these.

The first place to check out is Google's own developer's guide. Following the instructions correctly (mostly), I had my IDE set up and me poking around example projects within an hour (including downloads).

The recommended IDE is Eclipse but there are many others out there. As the tutorial was for Eclipse I've stuck with it and kind-a like it. It has contextual prompting and integrated debugging - which does make life that little bit easier. Eclipse does have the advantage of having Windows and Linux versions, allowing me to work on the same project from both my machines.

For my graphics I use Inkscape, a free and versatile vector designer. For audio I use midi files and Audacity, another excellent free app.

Once you have the tools, you need something to play with. Reading a few of the threads on the forums I heard a lot of chatter about the supplied Lunar Lander example, so thought it a good one to check out.

I thought I had hit gold. Animated sprite handling, user control handling, a basic but functional game thread, multi screen handling.

This would have been the perfect shell for Livestock vs The Undead, apart from the fact that it was a heavily flawed example. It didn't handle some of the most fundamental functions that any android application should, ie home/resume.

To cut a long story short it was losing its hook on the thread when the home button was pressed. So when you restarted the app it didn't know what it should be doing and falls over in a big heap. The following code allows the resumed code to pick up a new thread and continue down its merry way.

public void surfaceCreated(SurfaceHolder holder) {
// added fix -->
if(thread.getState()== Thread.State.TERMINATED){
thread = new LunarThread(mHolder, mContext, mHandler);
thread.setRunning(true);
thread.start();
// <-- added fix }else { thread.setRunning(true); thread.start(); } }


Unfortunately, this isn't the whole story. As all of the variables that were held within the thread class have now effectively been wiped you will now only see a black screen. ie:

class LunarView extends SurfaceView implements SurfaceHolder.Callback {
class LunarThread extends Thread {
variables
arrays
etc.
}
}


To remedy this you have move all of the variable declarations from within the thread class into the outer class. As inner classes can access outer class variables, you don't have to alter the variables themselves! Phew.

class LunarView extends SurfaceView implements SurfaceHolder.Callback {
variables
arrays
etc.
class LunarThread extends Thread {
}
}


Great. So now all the variables will stay in tact. But we've moved stuff around and in doing so we've broken the LunarLander.java file. Just look for, if you're using Eclipse it'll no doubt be highlighted:

case MENU_STOP:
mLunarThread.setState(LunarThread.STATE_LOSE,
getText(R.string.message_stopped));


Then change to:

case MENU_STOP:
mLunarThread.setState(LunarView.STATE_LOSE,
getText(R.string.message_stopped));


You'll have to delete this inside the public LunarThread(SurfaceHolder surfaceHolder, Context context, Handler handler)

mWinsInARow = 0;
mX = mLanderWidth;
mY = mLanderHeight * 2;
mFuel = PHYS_FUEL_INIT;
mDX = 0;
mDY = 0;
mHeading = 0;
mEngineFiring = true;


Leaving it in will mean everytime you resume the game it will start the lander in the bottom left with the engine already firing. It was some ill conceived start up code to position the lander in front of the splash screen.

These fixes were put together with the help from here.

A word of warning though. Pressing the home button doesn't actually shut the app down - just hides it, so it will happily chomp on your battery reserves. I would recommend using a clean exit using the finish() function on the button press instead.

Other than this - there is still a silver lining. You can still get the gist of how to structure a game frame, so please read through the code.

Finally: check out those forums, there are answers to just about every question you can think of out there. (Apart from the current one, because that's just silly.)

Cheers,


Paul
Enhanced by Zemanta

Thursday, 14 July 2011

Broke it to fix it

CodingImage by ronny-andre via Flickr
Warning : Spoilers

On Livestock Vs The Undead Lite v1.1b (the 'b' was due to a couple of quick releases to eradicate some memory issues) I was at a stage to really start ploughing in some new functionality. (I apologise at this point if you've been waiting for the new release - below explains why there has been a delay.) This was going well at first. The persistent levels code was working well. I had added another creep along with extra chomping animations and sounds. A dozen or so tweaks around the system were holding their own.

That's when my old enemy, the Out-Of-Memory monster reared its ugly head. I was stuck, nowhere to turn, banging my head on my keyboard (getting dfghjk in reverse on my forehead). Then it dawned on me.

The code I was using loaded all of the game's 100+ sprites individually, resizing them on the fly. It was this that was chomping through the memory at a rate of knots. Even though the combined size of all the sprites was less than 1.6Mb - the processing just overwhelmed the device and all came crashing down. So the bright idea I had was that of consolidating all of the sprites into one .png file.

I started adjusting the code to handle the process. Unfortunately I realised quite quickly that this wasn't going to work either. The memory error had disappeared, but the Out-Of-Memory monster's poor second cousin, the Logistical-Nightmare monster, popped up.

You see, my sprites are all different shapes and sizes. This meant that the consolidated spritemap was all over the place. And given that you are always working with relative positions due the device rescaling, mapping where everything was, it turned out to be like playing darts in a tornado.

Not one to give up without a fight I decided to find the middle ground. This ended up being several sprite sheets with like-sized sprites. This meant that simple division worked effectively to work out sprite positions and that fewer picture files kept OOM away. Yay, success!

So, I currently am basically back to square one in terms of how the game plays, but now I can make some quick progress getting the more interesting stuff in for v1.2 (which I am hoping to have out of the door in a couple of weeks time).

I'm currently working on the menus at the moment - trying to give them a slicker feel.


Paul
Enhanced by Zemanta