Saturday, 28 June 2014

Leaderboards

I have spent the last couple of weeks fighting with implementing leaderboards into Star Diver. There will be a leaderboard for each level. When the player achieves a perfect score (ie. removes all formations) then their time is posted. Obviously lowest time wins, and because I capture this in milliseconds I shouldn't get too many collisions.

Technically there are lots of options ranging from building your own database and website using something like Azure, using a dedicated subscription based solution or using one of the more publicly available options such as Google Play Games. After spending a couple of days deliberating on this I decided to go for Google Play Games, since my initial target platform is Android, and by definition everyone with an Android device that can download Star Diver from the Google Play store will have a Google account already. Also Google+ is gaining in popularity rapidly which will soon make the use of "frienly circle"  leaderboards there useful also.

I then needed to find a solution to integrate with Unity. There are literally dozens of solutions out there for doing this, and I was not inclined to develop my own from scratch.

The first I tried was the Open Source Google Play Games plugin for Unity, available on GITHub. This worked well and took about one evening to put together, however after I implemented it I realised that the only UI available for displaying the leaderboards was the public Google Play Games UI. This did now fit with the look of my game at all, and I started looking at ways to implement a custom UI.

I then spent a night researching alternatives in the Unity Asset Store and came across and purchased the excellent Android Native Plugin by Stan's Assets. This is amazing value at $30 and includes not just the GPG integration I needed, but also In-app purchases (which I need to to later anyway), Facebook integration and Native Android pop-ups. All the user reviews were generally positive and this swayed me.

Here is the result from a look and feel point of view. I like it better than the standard Google one, but it might need a bit more tweaking later.


I had to contact Stan a few times to get things working, however he responded extremely quickly to all my queries and after some teething trouble (which meant I had to remove the Facebook functionality) it worked.

Setting up the Google Developer Console with all of the levels and understanding how to publish the GPG portion vs. the actual game took another few days to get right. The fiddly scrolling table to actually show the scores and artwork for the window border took me another few nights. But it's done now. Phew! I can't help but think that there are still a few sneaky bugs in there, since my scores appear to miraculously vanish occasionally...

Overall I learned a lot, but a couple of weeks to get one feature working was a bit harder than I originally thought.


Sunday, 1 June 2014

Menu System

Here is the menu system from title page onwards:

The Title Page
The Stage Selection Page shows the progression through the game including the dependencies. There are three progression paths:
  • Serene: Easiest. Most likely will allow formations to be disposed of in any way to count
  • Bold: Medium difficulty. I will introduce some challenging aspects
  • Insane: Hard. Levels will have many formations, and only collisions with stars will count
Stages can be in one of three states:
  • Playable - Circle will display in white and score is shown. When player taps this the Level Selection Screen is displayed
  • Reached but locked - the player has passed all preceding levels, but has not achieved perfect scores. Circle will show in white with a lock symbol shown. When player taps this a warning shows up and allows user to also unlock the level with in-app purchase (IAP)
  • Not reached and locked - the player has not yet passed all preceding levels. Circle will show greyed out and lock symbol is shown. When player taps this a warning shows up and allows user to unlock all levels with IAP.
Main Stage Selection Page
The Level Selection Page shows the level progression within the selected Stage, including the dependencies.

Each Level shows the number of goals / formations within the level.
  • Yellow: Highest score attained so far
  • Grey: Minimum score required to pass the level
  • Black: Additional formations over and above passing score
Level Selection Page
The Level Launch Page shows details about the specific level. The key piece of information is the objective. "To Pass" shows one of three scenarios:
  • A star and edge of space: symbol: Either way of disposing of formations will count
  • A star only: Only formations that are knocked into stars will count
  • Edge of space only: Only formations that are knocked into the edge of space will count

Level Launch Page
The transition between the different screens is animated and to the player is appears as if they are "flying" from one level of detail into the next (and back again if BACK is tapped).

A lot of my development time so far has gone into the menu system. The complexity in enabling the transitions and rules around statuses etc. was deceptively complex.

Saturday, 31 May 2014

Tutorials

Today I found some time to work on the tutorials. Some levels, especially those in the tutorial stage, will feature overlays at certain points of play that inform the player of objectives or provide explanation.

The challenge with any mobile game is  that it has to be able to be picked up immediately with almost no learning curve, even when there are complexities that have to be communicated somehow. Players also

The technical solution I settled on was to make full screen images in Photoshop (which actually take up very little space due to most of the images being transparent).

Each image generally comprises some text (strategically placed) and one or more hand drawn arrows indicating the focus of the message.

Introductions

Basic controls

The coding aspect then loads each image at runtime and either align with left, centre or right edge of the screen. The images also need the ability to appear at the right time, need to persist on the screen for a variable length of time depending on how much there is to read and alpha fade in and out smoothly, all while halting the game.

All of this works now, but I really struggle with finding a nice way to let the player skip individual or all help messages.... work in progress. Also I can't finalise the images until I have levels to put them into. I am also not happy with the artistic style of the arrows I have drawn as they don't really match anything else in the game (and they really are quite ugly to boot!)... ho-hum. I'll have to revisit this later.


Friday, 30 May 2014

What sort of game is Star Diver?

Essentially Star Diver is a game involving a ship (The Sweeper) and alien formations (rock-like in nature) orbiting one or more stars. The objective of each level is for the Sweeper to knock the formations either into a Star (which makes them explode) or into the "edge of space", an artificial level boundary. This objective will change depending on the level. Harder levels require all formations to experience a fiery death to pass.

The game does not involve shooting of any sort, and even though it is an arcade game, it is slower in pace and based on accuracy and strategy. The sweeper also has no engines, and it achieves propulsion purely using gravity. Harder levels will take many attempts to complete using different strategies.

The Story is that the hostile alien formations have resisted all long range attacks known to man, hence the Sweeper was built to counter the threat to humanity. The sweeper is constructed almost entirely from Tungsten Carbide. It is therefore almost as hard as diamond and has an extremely high tolerance to heat, required to move in close proximity to stars. Is is built with the express purpose of attacking the formations physically and at high speeds.

Because it has no engine as such, the game wouldn't be much fun if the Sweeper simply crashed into the stars without any means of control! Therefore the Sweeper features an anti-gravity device which can render it immune to gravitational effects. By default this is turned on and the Sweeper therefore moves in a straight line. By tapping and holding the screen anywhere, the sweeper turns off its anti-gravity device and  is then attracted by any celestial object, be it a star, black hole etc. The way that the Sweeper moves through the game world is by the player carefully controlling the orbit that it takes. In this sense Star Diver is essentially a "one tap" controllable game apart from using the Power Ups (see below).

The sweeper after smashing into a formation, changing it's orbit

Star Diver is also part physics simulation; the orbits of the formations are totally physics based, and collisions affect both the Sweeper and formations realistically. The Sweeper's orbits are also realistic and conservation of angular momentum plays a big part.

Each level has a "passing" score required to play the next level and a "perfect" score. Game progress is divided into a number of stages containing a number of levels each, with each stage accessible only if perfect scores are obtained in the preceding stages. There will be about 50 levels in the game, even though at the moment there are only 4 test levels.

The game also has two types of power ups, tractor beams (which temporarily allow the Sweeper to exert a gravitational pull on the closest formation) and gravity bombs (which can be placed anywhere and then exploded later, exerting a massive push on any formations within range). Some levels will provide one or more power ups at the start of the level.

Tractor Beam Power Up in action

Shall we blow it up now, captain?

The level ends when all formations have been eliminated (either way), or if the Sweeper is destroyed - this can happen when it smashes into a star, or hits the edge of space. Each level will take between a few seconds for introductory levels to maybe 2 or 3 minutes for challenging levels, so this is definitely a "snacking" type of game.

How does Star Diver control the difficulty of levels and keep things interesting and unique?

  • Different sized formations with different mass, requiring different strategies
  • Different sized stars with different mass, therefore changing the whole experience of the level
  • Formations that are close to stars or very far away, requiring different strategies to remove
  • The direction of travel of each formation in relation to the Sweeper
  • Multiple stars and /or black holes that allow the player to change direction by travelling in a figure 8
  • Other celestial objects such as planets that are on a collision course with formations that the player has to protect to pass the level
  • Changing the objective of how formations need to be removed to either into star or into edge of space (easiest), only edge of space (harder) or only into stars (hardest)

I have so far built a number of levels for testing purposes ranging in difficulty, and I am happy to say that I am thoroughly addicted to my own game, especially the harder levels, which even after a lot of practice, I can only get perfect scores in once in maybe 10-20 games played.

I'll share in future posts what has been done, and what is still to be done. And there is quite a lot! One of the most valuable learnings from this process for me has been understanding what it takes to actually complete a game of any kind - the actual game mechanics are almost the smallest part of the overall process! It is natural to under-estimate the enormity of getting any reasonably polished game "really" complete.

Title Page

Last week I created the title page for Star Diver in Photoshop. I am OK at Photoshop, but by no means an artist. I decided to use the titlepage as the header for the blog as well, as it seemed to fit well.

The Star and the Star Diver writing came from public tutorials which I followed and they were fun to do. The spaceship is actually from the model in the game itself magnified, with a motion blur filter and blue outer glow. I think it looks quite nice and will do for now.

Introduction

Howdy. I have been in software development for over 25 years. I enjoy photography and computer graphics.

About 5 months ago I decided to develop a mobile game, Star Diver, Initially it was just a bit of fun to see if it could be done and to satisfy my inner geek by trying to create some content for my Android phone, however the game has now progressed to the point where I believe it could actually eventually be published.

I have a busy work as well as family life, and therefore the only times I have to work on my game is in the evenings, however I have already made a lot of progress. Even though I used to develop games when I was a teenager, this is my first serious foray into game development and has been a lot of fun.

I have now decided to share my journey, so this is the first post in my devlog blog. I hope you enjoy it!