Friday 22 March 2013

The Lost Blog Post - Astro Junk

Well this is embarrassing. I haven't updated this blog in forever and it turns out I wrote a blog post ages ago and then forgot.

So I might as well post it. Have a time capsule of my thoughts from about 6 months ago. I was originally planning to write a few posts about the development of Astro Junk but I got a bit distracted by real life. I shall just post this here in case it is at all interesting to anyone, but it seems unlikely that I shall actually revisit this and finish the series up.

Woops!

Well here we go:

Over the past two weeks or so I have been working on a game called Astro Junk. This has been my first real exercise of building up a complete game and has come with many of the challenges associated with game development. However it has been great fun and I have learnt a lot. I plan to go through over a series of posts some of the key points about how I made the game, as well as point out the major things that I learnt.




First off, you should probably actually take a look at the actual game itself, Astro Junk, if you haven't already. The short overview of the game is that it is a more complicated version of Asteroids, with an expansive space to explore, resources to collect, as well as upgrades to buy. The plan for this project was to build some quick games over a few weeks, with my girlfriend Clarissa providing some of the art work. There were various stages in the design phase, but the basic idea was to build a version of Asteroids with a base, which lead to the original standing title for the game; Basteroids.

The game was built in Java using the Slick game library which I chose as it is well suited for quick small 2D games like the one I wanted to build. Slick is a quite nice library, however I think in the future if I am going to do more Java game development I will probably use the Light Weight Java Game Library. Slick is itself an extension of the LWJGL and provides a utilities on top of it. Slick has quite a few notable missing features for its built in classes which makes using them a bit too fiddly and would be better just to create my own helper classes for LWJGL more suited to my purposes.

As with all good development processes, this started with a wall covered in post it notes. Brainstorming for game ideas with post it notes is great fun it turns out!

Go go gadget post it notes!
The original brief for this project was to be a very short weekend project and for some reason the idea of asteroids with a base seemed doable within the space of 3 days. This turned out to be rather optimistic. I think with what I now know this would be possible, however a lot of this project was tailored for me to learn how to do things properly. The scale of the project mostly stayed the same, just I wanted to make a complete finished game, to make something that I could point to and say "I have made a complete game, it has features and everything!"


This is what the game looked like within a few hours of starting and it wasn't exactly much. This was mostly from me trying to learn the engine. At this point there was a working menu however which looks pretty similar to final version, for some reason this was one of the first things to go into the game.


By this point the game is starting to look a bit more like a game. The asteroids are now in place and the ship now has health. The collision system is now in place as well, which allows the ship to lose health when crashing into asteroids. At this time, I had started using a proper component-entity system for structuring my game objects. This is a really good idea pretty much any game, as it very naturally fits the way games are structured. A component system is where there is a base class the game objects, in my case an Entity class. Entities are then composed of components which perform completely distinct actions such as physics, image rendering, and gameplay systems. This allows components to be easily attached to unrelated entities and not have them tied to specific objects. I didn't truly see the brilliance of this system when I saw how easy I could add health to my asteroids by just adding a new health component that I had already developed for the player ship.

For anyone interested in game development, I would very much learn how to go about implementing the component pattern. If you are interested, check out this page here from Robert Nystrom which goes into much greater detail than I do here.

Once the basic mechanics were in as well as the entity / component structure, it was mostly just a case of adding in new components to fill in all of the original ideas that were outlined.


Here guns are now in...


And not long after that, the background image and visible travel lines which give the player a sense of movement through space were both working in the game. After five days, a lot of the main gameplay components were in.



At this stage the following was in:

  • Ship movement
  • Fuel
  • Health
  • Destroyable asteroids
  • Cargo / Resource collection from destroyed asteroids
  • Map / Radar
  • Ship weapons / overheating



At this stage, the game is looking very similar to the final version. A lot of the last week or so was tidying things up, as well as the addition of the Base part of the original idea which at this point is completely missing. In the next and probably final post in this very small series, I will go over the development of the base, menus as well as the difficult final stages of actually completing a game*.

*I'm sorry, this is a lie, this will probably never happen. :(

No comments:

Post a Comment