Head Spin is Published!

It is done.  I’ve clicked the button and now Head Spin is officially available through Google Play.

Go get it!

So, a bit about Head Spin.  Being still quite new to game developing I wanted to keep things simple for my second game.  Space Surfer was very simple indeed so for this one I decided to try something a little more complicated but still something that I could finish in a sensible time frame.  After all, I only have evenings and weekends (some anyway) to do this, so even something relatively simple takes a while to put together.

I love platform games and it’s a well defined genre that people are familiar with, so I was hoping that something along those lines would find a slightly larger audience than the rather small niche Space Surfer found for itself.  I realised, however, that I’d have to put in quite a bit more work to build a framework capable of supporting a platform game.  Then I discovered AndEngine.

AndEngine is a free, open source 2D game engine for Android and it looked like it was just perfect for what I wanted to do.  I no longer had to worry about all the framework code that would be required as AndEngine supplied the lot.  It even had an implementation of the amazing physics engine Box2D.  And to cap it all it provided a simple way of loading in tile based game levels that I could build using the free tool Tiled.  Of course, there was still the matter of designing all the tiles, the rest of the graphics, sound effects, game-play mechanics etc. as well as actually building the levels and UI, so it wasn’t as if the game would magically appear out of thin air.  Still, a huge amount of the groundwork was in place and I could concentrate on the important bits of building a working game.

Head Spin started as a very different game.  My original idea was to make a game based around balancing a unicycle as it rode over various obstacles and terrain but it became very clear, very quickly that it was more or less unplayable.  I’d already learnt that lesson from Space Surfer so the idea was ditched immediately.  It was still an interesting demo though and it provided the starting point for what came next.  Rather than a unicycle the character became just a head that could be rolled around using the tilt functionality that all Android devices have.  Tapping the screen provided a simple method for jumping and that’s as complicated as the controls got.  Apart from double jumping, which every self-respecting platform game should have.

I had decided very early on that I didn’t want any death in Head Spin.  I’d been playing a lot of Cordy (which is just beautiful, everyone should play it) and noticed that it managed to be really fun and challenging but without any death, or annoying restarts.  I realised that challenge could come from many things, it didn’t have to involve the prospect of getting killed by something, be it falling on spikes or shot by an enemy.  So I tried to give my game that same fun challenge by making interesting levels that tested the player’s coordination and skill at using the momentum of the rolling head to the best advantage.  Hopefully I’ve succeeded at least partially.

I’ve already talked about the art style in a previous post and how my wife’s craft skills were used to give life to the world of Head Spin.  Everything is home-made, even the sound effects.  With a budget of precisely zero I think I’ve made a fun little platform game that although doesn’t push too many boundaries it at least provides a bit of enjoyment for whomever decides to download it.

Enjoy.

Head Spin Game-Play Video

The game-play video for Head Spin is complete and posted to YouTube.  Here it is for your enjoyment:

Head Spin Release Countdown

Well, the final graphical improvements have been completed and the levels have all been tweaked and decorated so Head Spin is ready to publish.

Just the screen shots to capture and the video to record.

I’ll post those just as soon as they’re done, plus, of course, publish the game to Google Play.  That should hopefully be this weekend some time.

I’m very excited but also extremely nervous about how Head Spin will be received.  If you download the game and like it then please leave a comment and rating on Google Play.  And tell all your friends!  Word of mouth is the most powerful marketing force in the universe.

The Art of Head Spin

OK, so I’ve covered physics for Space Surfer but for Head Spin the most interesting thing to talk about is the art style.

Before Head Spin was even in the prototype stage, and well before it had a name, I had in mind that I wanted to try something very different to Space Surfer.  I came at Space Surfer with the physics very much at the forefront and I didn’t worry about the art at all until very near the end.  With Head Spin I decided I wanted to make something visually very different to anything else out there but to make it much more conventional in the game-play style.  Since I’m no artist, and had precisely zero budget for third-party art assets, I had to look to the other assets I had available to me.

For the last few years my wife has been gaining some impressive skills in designing greetings cards using various craft materials.  You can see examples of her work on her own blog.  One Christmas she had designed a card depicting a pile of excellent comedy penguins, who had absolutely bags of character.  I realised that I had this amazing resource right there and the ideas started germinating for a game based around creatures made from craft materials.

I’m a big fan of Little Big Planet on the PS3; it’s probably the most ingenious game of any generation and just oozes charm and charisma.  For those of you unfamiliar with that game it is also based around craft materials, as well as wood, metal, stone, foam, and just about every other material found in the real world and the imaginary world to boot!  I would love to make a game with that level of character.  Now although Little Big Planet looks unique for a console game there wasn’t really anything comparable for mobile phones.  I reckoned if I could capture the feel of the materials in a mobile phone game I would have something that looked quite different to the rather generic cartoony style of games that I would be competing with.  Incidentally, before I ever even considered starting Space Surfer, I actually built a couple of Little Big Planet levels using the incredible tools the game puts at the player’s disposal, so in some ways it was the game that started this whole enterprise for me.

The problem I had, of course, is that mobile phone screens are rather smaller and rather lower res than the type of displays Little Big Planet usually runs on.  A good TV has 1080 x 1920 pixels (although LBP runs at 720 x 1200 pixels), while a fairly standard Android phone (as of the time I started developing Head Spin) had more like 480 x 800 pixels.  Showing the same level of detail as LBP would be impossible.  However, it was still worth pursuing, so I experimented with a few of my wife’s designs to see what they’d look like on a phone screen.

I simply lay them out onto a blank background and took a picture of them using our bog-standard compact digital camera.  Then, after tweaking the contrast, saturation, hue etc. and resizing to fit the right screen resolution I loaded them into a fairly basic prototype game I’d thrown together.  It didn’t look too bad and it was about a million times better than I could have come up with using my more or less non-existent art skills.  It was certainly worth continuing with as I developed my prototype further.

Since those first experiments I’ve gotten better at the processes involved in converting the physical designs of textured card into the digital versions seen in the game.  I still lack the skills of a proper digital artist though,  so the graphics very much retain a rather amateur feel to them.  I’m in two minds as to whether this matters or not.  In some ways I think it gives the game a more ‘home made’ feel but I’m worried that today’s tech savvy mobile gamers will demand rather more polish than I’m able to bring to the table (or tablet).  Feel free to give your opinion in the comments section, good or bad.

Since I’m using Head Spin as a learning experience I’m not going to worry too much whether people appreciate the art style or not but I hope some people are intrigued enough by the screen-shots shown on the Android Market to make them download the game.  After all it’s free, so there’s nothing to lose!  After that it’ll be down to the game-play to keep players playing.  But that’s for another post.

So, as a taster for the imminent release of Head Spin, here’s the feature graphic that I’ve put together that with any luck (a lot of luck!) Google will display in the Android Market when they feature my game (I’m being optimistic; you never know).

Space Surfer Game-Play Video

This is a video showing a sample of levels from Space Surfer, my first Android game.

It’s a simple game where you touch the screen to create a black hole, the gravity of which causes your spaceship to change course.  Collecting all of the stars on the screen will complete the level.  The faster you complete the level and the less ‘black hole power’ you use the higher your score.  There are 50 levels in total with bronze, silver and gold awards for each level, as well as a total score for the whole game.

Check it out!

The Physics of Space Surfer

Space Surfer is an extremely simple game.  It is deliberately so as it was the first game I had ever developed, so I wanted to start with a subject I was comfortable with and with a project I knew I could see through to completion.  In the process, I hoped to learn enough that I could go on to make bigger and better games.

Inspiration
If you’ve played Space Surfer, and are of a certain age, you will immediately see the similarities with a game called Asteroids.  I love that game and wanted to try and capture that simplicity and elegance but add a new twist to it, making it fit with the new opportunities that touchscreen devices provide.

I needed a way to control the spaceship that didn’t rely on key presses, and I was already thinking of including some sort of gravity physics into the game, when a friend of mine suggested using black holes as the control mechanism.  I thought it sounded like an excellent idea and could immediately see how I could implement it in the game.  I had my concept.

Gravity Physics
Now, those of you who remember your high-school science lessons will know that gravity gets weaker the further away from a gravity source (planet, star, black hole, anything really) you get.  This is useful for me as it gives the player a lot more control over the course their spaceship takes; a tight orbit close in to where you put your finger, or a gentle arc further away.  If you remember a little more detail than that you will know that the strength of  gravitational attraction drops off as the square of the distance between the two objects (the spaceship and the black hole, say.)  This is called the inverse R-squared law, R being the radius of the orbit.

Here is where I cheated slightly (not the first place, as you will shortly discover.)  In Space Surfer the gravity strength actually drops off in proportion to the distance, so twice the distance will produce half the acceleration.  In real life, half the distance would lead to a quarter of the acceleration.

The reason I did this is simple, the game was completely unplayable with proper gravitational physics.  When you put your finger on the screen the spaceship would crawl along incredibly slowly, unless you were right up close to it, in which case it zoomed towards your finger and flew off at high speed when you let go.

So, I tinkered with it until I found a good balance between reality and playability.  Interestingly – and here’s where we leave high-school physics behind – this inverse R (or 1/R) law actually fits the 2D game world perfectly and is completely consistent with the inverse R-squared law that operates in our 3-dimensional universe (three conventional space dimensions anyway, I’ll ignore all those other pesky dimensions that some theoretical physicists suggest could be operating.)

Stay with me here.  Gravity is a bit like light from a lightbulb, it spreads out into a sphere that gets bigger as the radius of that sphere increases.  The surface area of the sphere increases with the square of the radius while the volume contained within it increases with the cube of the radius.  Just as the intensity of light from the lightbulb drops off in proportion to the surface area of the sphere – so with the square of the radius – so the strength of gravity drops off in the same way as you get further from a gravity source.  Hence the inverse R-squared law in 3D space.  However, in 2D space the sphere becomes a circle and the circumference replaces the surface of the sphere as the ‘area’ over which gravity spreads out.  As you know, the circumference scales directly with the radius of a circle so as the circle gets bigger the gravity gets weaker by the inverse of the radius, not the inverse of the square of the radius.

So, unwittingly, I had actually ended up with a perfectly reasonable implementation of gravity for my game.  Great, however, I still had one more problem to deal with.

Newton’s Laws of Motion

In space there is no air resistance or friction with the ground, so things tend to keep on going in the direction they were going before (Newton’s first law of motion, otherwise known as inertia.)  When gravity is present this applies a force to an object causing it to accelerate, and so the direction of motion of that object changes (Newton’s second law.)  This is also true of Space Surfer.  To a degree.

When you place your finger on the screen you create a black hole that has a strong gravitational field and so it exerts a force on your spaceship causing it to accelerate.  If you now drag your finger along in front of the spaceship, that force of gravity is always acting to accelerate the spaceship forwards.  If what I have said above is true then the spaceship should get faster and faster and faster, for as long as you can keep your finger ahead of it on the screen.  You may have noticed that this, in fact, does not happen in the game.

Once again, I had to introduce a small defect in the physics in order to create a playable game.  If I didn’t restrict the speed of the spaceship (relative to the screen) then it would quickly become completely uncontrollable.  You would spend all of your time trying to slow the spaceship down as it charged around the screen, and no time actually steering it in the direction you wanted it to go.

I gradually reduced the top speed more and more until I was happy that it struck the right balance between being controllable and not being frustratingly slow.  This also required a balance with the strength of the black hole gravity as I still wanted to be able to achieve nice circular orbits, which would be possible if all the physics remained unaltered.  In the end I had to decrease the top speed to slightly below the level required to orbit the black hole perfectly (you actually gradually spiral inwards, which is slightly wrong) but it works OK for the planets, which have weaker gravity anyway.

Final Word

So there you have it, Space Surfer is a very simple game indeed.  The physics is actually dead easy but that’s exactly why I chose to make it.  That’s not to say that actually making the game was easy; no sir, it was still a huge challenge and I learnt a massive amount while developing it.  Not just about the Android operating system, the java programming language and general game design.  I also learnt about player expectations and how what I consider to be intuitive and obvious is not necessarily what others experience (as simple as the control system is it can take some getting used to, I’ll admit!)

Hello!

Welcome to the blogging home of Stone Baked Games, the name I’ve given to my little one man indie game development studio.

I say studio, it’s more a laptop on my dining room table that has to be moved out of the way whenever we have guests round for dinner.  But you’ve got to start somewhere, right?

I’ll be posting about the games I develop, the thought processes and challenges I go through while building them and hopefully anything else I find interesting or fun from the world of games.

I have so far released one game onto the Android Market, called Space Surfer.  It was my first attempt at developing any sort of game, so I kept it deliberately simple.  I chose Android because I liked the general openness of the platform but more than that I chose it because the development language is Java, which is not too dissimilar in style to the language I use in my day job, C#.  Space Surfer has done moderately well but it was never going to set the world on fire.  It’s rather too quirky to have universal appeal but some people really love it, which is gratifying.  I essentially made a game for myself and hoped that there would be a sufficient number of other people in the world with similar tastes that it would achieve some success.  I would say that I got part way towards that goal.  Feel free to check it out on the Android Market.

I’m currently in the process of developing my second game, called Head Spin.  It’s nearly done so I’ll be posting about it in the run-up to release and also afterwards for a little while.  It’ll be interesting to see how it does compared to Space Surfer as it’s a very different sort of game.

I look forward to hearing your reaction to my games, good or bad, and I hope you enjoy my blog.

Follow

Get every new post delivered to your Inbox.