Game Progress Update #22


Update #22

Hello world! Welcome to the twenty second Dev with Dave Game Progress Update! ๐Ÿ™‚ It’s around 3pm on Friday afternoon as I write this, I still have to script record and edit the video and write all the social media posts (*sigh*) but I am hoping this update will at least be on the right day, if a little later than usual.

So, this update I have finished the Loading/Saving game data, and also spent some time removing duplicate code.

I’ve also taken some time out to get the Trello and the GDD updated.

Loading and saving game data

Having taken all the time available to me last time playing around with encryption for the save game file, this update I have managed to get the Loading and saving working properly.

The first time the game is run there is no save game data, so the game creates one using the default values. The LoadPlayerData() function then loads the data into an array and decrypts it. The decrypted data is then stored in the individual variables ready to be used in the game.

Saving the game data is pretty much the reverse. The data from the individual variables is stored in an array, then encrypted before being written to the file. If the file exists, it’s simply overwritten.

Both getting the loading and saving were quite easy to achieve in comparison to the next bit, which was updating the UI to reflect the data which had been loaded in.

Now, had I been smart, I would have considered this when I was writing the code which updates the store page info when the player makes a purchase and written it with a view of reusing it to update the display after loading the game data in as well.

It seems, however, I am not smart ๐Ÿ™ as I did not do this at all! Which led to some serious rewriting and refactoring code.

Refactoring

A lot of the code used to update the UI display when purchasing an upgrade or boost was duplicated. It didn’t take too long to copy and paste the duplicated code into a function and make it more generic so it could be used for all instances where it was required.

I created four functions, one to update the upgrades store page after loading, one to update the boost store page, and two to update the individual items on either page. As you can see from the picture below, they didn’t quite work the first time round, lol.

The functions to update the store pages are called after the game data file is loaded in, and they both call the update store page item function for the relevant page, for each item on the page.

I also replaced the old code for updating the store page data when a purchase was made with the new function.

This refactoring has made the code some 750 lines shorter as well as making it much easier to read in places.

And that’s all for now

I still need to include data for the trophy progress in the game data file, but as there isn’t actually any trophy progress data currently I can’t do that just yet. It will have to wait until I have created at least one functioning trophy.

I’m not entirely sure what I’ll be doing for the next update. It’ll either be getting the IAP systems working or adding functionality to the Settings page. Maybe both if time allows?

Until next time ๐Ÿ™‚

Game Progress Update #21


Update #21

Hello World!  I know itโ€™s a couple of days later than I planned, but welcome to the twenty first Dev with Dave Game Progress Update!

This update contains two major changes since the last one.  Firstly there are a couple more sound effects which have been added,  And I have made a start on Loading/Saving the game data.

The sound effects added this update include an explosion when the player dies, a bigger explosion when the player sets off the smart bomb pickup, a warbling sound when the shields are activated and lastly a rocket sound for the missile engines.

Again all of these sound effects are from libraries I had purchased previously. I have done little to no editing or modifications as yet. Once I have all the sound effects in place I will go over them and add some extra polish and refinement to each one.

Iโ€™m not happy with how out of sync the missile sounds seem to the actual missiles, so I need to do some more work to this bit at some point.

I currently trigger the missile sound effect at the same point that the Zone Update() function starts the missiles moving, but I think this happens when the missile is still quite far from the edge of the screen.

Loading and saving the game data is one of the reasons that this update was so late.  The actual loading and saving the data was fairly straight forward using AGK Studio, but I decided to over complicate things by adding some basic encryption to the data file.  This led me down a rabbit hole of wonder and before I knew it, Iโ€™d spent almost all the time available simply playing with simple encryption methods.  Itโ€™s really easy to lose track of time when youโ€™re in the zone, lol ๐Ÿ˜Š

The Game Save data file will contain data relating to Powerup/Boost upgrades the player has purchased, the players coin total, any inventory of Boosts, and any data relating to obtaining the trophies.

Anyway, thatโ€™s all for this update.  Iโ€™ll be back next fortnight with another, and I promise Iโ€™ll try really hard to get it out on time!

Game Progress Update #20


Update #20

Hello World! Here it is, the twentieth Dev with Dave Game Progress Update!

In this update, I’ll be talking about some changes and additions I’ve made to the Flappy-vaders UI.

Pause Screen

The first addition I had to make for this was an actual pause button on the main game screen. Again, I was quite frustrated while drawing the assets for this by the tiny resolution I’ve selected to use for this project. However after 3 or 4 attempts I finally settled on the following design which matches the rest of the UI elements and doesn’t seem to large or out of place.

I had to tweak the position of the Score and Coins text a little so it would work.

I set the button and the coins text positions based on the right hand edge of the screen, so it’s more responsive. I tested this by running the game in a 4:3 aspect ratio. I also tweaked the position two buttons on the title screen as well because of this.

Once the pause button is pressed, it takes you to this, the Pause menu, where the player is presented with the options to resume the game, or to quit back to the main menu.

Again, all of the new buttons were handled by the existing UI system which I created in the early days of the project. Pausing the game was a simple case of directing the code to a new loop which simply contained the UpdateUI() function, The resume button returns the code to the game loop, and quit returns the player to the main menu.

My only concern about this is that when the player presses the pause button, the ship acts like the player has pressed the screen and begins to ascend slightly before the game stops, then continues ascending when the game resumes. I would prefer that pressing the pause button does not affect the player like this.

It’s been added to the Known bugs list on the Trello board.

About screen

I’ve also written the code to handle the about screen. I have a really great retro based idea for this UI page, but I want it to be a surprise so I’m not going to go into too much detail here.

That’s all for now

I’m afraid there won’t be an update next fortnight, instead you’ll have to wait until June the 11th for the next one. I’m going to have a well deserved break from the computer for a while and try and catch up on some of the important jobs around the house I’ve been neglecting.ย ๐Ÿ™‚

Game Progress Update #19


Update #19

Hello world! And welcome to the nineteenth Dev with Dave Game Progress Update!

This update is mostly about the Audio system, which I have added to significantly this last week or so, to allow it to better do what I need it to do for the game.

The Audio System

Originally, the audio system just allowed for the loading, and playing of sound files. Which is after all, it’s main job I guess? lol

However, I needed to be able to have more control over some of the sound effects. For example, the asteroid sound, because the speed of the game increases the time the asteroids appear on screen (and also play their sound effect for) decreases. In order to rectify this, the system needed to be able to specify a sprite ID which is associated to the sound effect being played, and then end the sound effect when the sprite moves off screen.

It can also specify a maximum duration for the sound effect to have as well, so instead of the sprite lasting as long as a certain sprite is on screen, you can set it to a timer instead.

The last thing which I’m quite proud about, is the way the system can fade out a sound effect rather than just cutting it short.

Best of all, all this is specified when the sound effect is played, and the rest is all handled automatically by the audio system ๐Ÿ™‚

Other sound effects

I’ve also managed to add some other place holder sound effects into the game. These are perhaps not quite the exact sounds I’m after for the game, but they are fairly close.

Most of them have been chosen from various asset packs which I have laying around. Some have been edited in Audacity to bring them close to my vision of what they are supposed to sound like.

As with the graphics, I’m aiming for a retro old school kind of sound, but using subtle fades and layering to give a subtle feeling of depth which actual retro games don’t necessarily have.

That’s all folks

And that about wraps it up for this update.

The next update will probably be more sound effects, as well as maybe some more UI as I still need to get the pause menu designed and working, and a few others UI pages as well.

Anyway, I’ll be back in a couple of weeks with the next update. See you all then ๐Ÿ™‚

Game Progress Update #18


Update #18

Hello world! Welcome to the eighteenth Dev with Dave Game Progress Update!

This time round I have managed to plan, and start to implement the remaining UI screens. However I decided to try and do something special during the planning with the About page. So I didn’t get quite all of them done yet.

The settings page

The settings page contains controls so the player can adjust the game settings, like the volume of the music and sound effects.

The page scrolls in a similar way to the other pages where the content doesn’t all fit on the screen. There is a button for the player to adjust the advert settings below what is shown on the image above.

I created everything using the existing UI system I’d implemented earlier in the project. With the exception of the blue bars which represent the volume level. These will require a tiny amount of extra code to resize the blue bar according to the volume.

The eagle eyed among you might have noticed the above image is different to the video. I created the image in paint.net, and the spacing isn’t exactly the same in the game.

Sound Effects

I also spent more than a few hours over the last two weeks listening to various science fiction and retro game inspired sound effects, trying to decide what type of sounds I wanted in the game.

I used Google and YouTube to do the bulk of the research. Either searching for specific sound effects or watching gameplay of retro games.

I downloaded some free assets to use as placeholders for the time being, so I could make a start on the Audio system which is responsible for loading and playing the sound effects.

My goal is for the audio to match the graphical styling of the game, and have a certain retro feel to it.

Next time

I think for the next update I’m going to continue developing the last few UI screens, as well as gathering more place holder audio effects for the game.

And that’s all for this time, I’ll be back in two weeks with another Game Progress Update for you all!

Game Progress Update #17


Update #17

Hello world! Welcome to the seventeenth Dev with Dave Game Progress Update!

I’ve managed to finish both of the remaining boosts! Now both the Second Chance and the Missile Jammer boosts will work, once the player has unlocked the boost and purchased one.

I’ve also managed to add several new bugs to the Known bugs/Issues list on the Trello board, which is less cool tbh, but better to find them now and fix them in the next revision.

Second Chance boost

The second chance boost causes the player to recover from an impact which would otherwise have killed them. It also provides a few seconds of shield to ensure the player manages to get out of harms way.

This was implemented by adding a few lines of code into the player collision function, which simply checked to see if the player had a Second chance in their inventory, then decreases the inventory count, checks the chances of it working (It starts off a 20%, and increases as the player upgrades the boost), and if successful it simply starts a shield for a few seconds and carries of with the game.

I had to refactor the code which started the particle explosion. I turned it into a function so I could call it from a couple of places where it was necessary, but not when the second chance was in use.

I think the Second chance boost needs some more visual (and audio) feedback. I’d like to see maybe a simple line of text and maybe an angel wings animation appear and disappear on screen.

Missile Jammer boost

The first thing I did, was plan out exactly how the missile jammer was going to work. Since it was another lovely day I decided to sit outside with a pen and paper (my absolute favourite medium for planning/sketching ideas) and think about exactly how this boost would work.

I added a check at the start of the game to see if the player has any missile jammers in their inventory. If they have then reduce the inventory by one and set the missile jammer isActive flag to true. I’ve done this so the Jammer works for the whole game, rather than needing a new one each missile zone.

Next, I added some code to the spawn zone function which when a missile zone is being spawned, it adds the missile sprite IDs to an array. When the zone has finished spawning, the function quickly cycles through this array and using a similar chance check as the Second Chance boost, it determines whether or not to move the missile.

Initially I thought that I could simply change the depth of the missile sprite so it appeared behind the sky background image, but this didn’t work. Instead I simply moved the jammed missiles offscreen on the y axis.

I imagine this boost would play a sound effect similar to a radio being tuned in when a jammed missile appears on screen (or when it passes the boundary which starts it moving?)

Bugs

I’ve also managed to build up a somewhat large list of bugs. These have all been recorded in the Flappy-vaders Trello board ready for when I’ve finished adding all the basics, and am ready to start polishing and fixing bugs.

I don’t think any of them are particularly game breaking so I am ok with just leaving them as they are while I work on adding the rest of the systems for the game.

Next time

Quite a lot of the remaining things in the “Things to do” list seem to be relating to the User Interface, things like the options screen, pause menu, about screen etc. The rest are mostly relating to monetisation and the sound effects.

I think for the next update I will try and get the UI pages complete and working, which perhaps won’t make for an exciting video next fortnight, but it’s an important part of the game which needs doing.

In the mean time, don’t forget to like, follow and subscribe to Dev with Dave on social media to keep up to date with the project, and I’ll see you in two weeks for another Game Program Update ๐Ÿ™‚

Game Progress Update #16


Update #16

Hello world, and welcome to the sixteenth Dev with Dave Game Progress Update!

Since the last update, I have been busy working on the “Cannons” zone, which has taken an awful lot longer to do than I was expecting due to an annoying bug which turned out to be a huge oversight on my behalf. Still, I beat it in the end, and I’m quite pleased with the way the Cannons Zone worked out.

Planning

Again, the entry for the Cannons Zone in the GDD was a little sparse.

3.3.3 Cannons
Obstacles and ground cannons which fire upwards

Flappy-vaders GDD

So, before I could do any coding, I had to sit down and have a real think about what I wanted for the cannons.

Although the original design document said that the guns were to fire upwards, I decided that it would be better for the guns to shoot diagonally.

The guns are to have a muzzle flash image which is displayed when they fire a round.

The cannons and their bullets are also destroyed when in range of a Smart bomb exploding.

I shall update the GDD to reflect these changes as soon as possible.

Media Assets

The first thing I needed before I could start work on the new zone were the graphical assets.

Now I did have some pencil sketches as concept art, as well as the image below, which was a mockup of the game screen I created nearer the start of the project.

So, grabbing my trusty tablet, my new mouse and a fresh cup of tea, I went and sat outside in the sunshine for probably the first time this year and got to work.

I started by using google to search for “Gun turrets” and “futuristic gun turrets” to give me some actual reference images to help with designing the cannon sprites for the zone.

The image above shows the evolution of the turret as I improved and tweaked each iteration of the design until I was happy with it. It took most of the afternoon of playing around inside Paint .Net to achieve this result.

I also created images for the bullet sprites and the cannons muzzle flash.

The Cannon Zone

The cannons are designed to sit on top of the large blue pipes, so I duplicated one of the pipe zones from earlier, and positioned the gun sprites on the top of the piped.

The movement of the cannon sprites is handled by the UpdateZones() function, which also handles firing the gun when the time is right, and spawning the muzzle flash as well.

Bullets

The bullets are held in a pool until the SpawnBullet() function is called. Then a bullet is positioned in the right place relative to the gun that fires it and the inUse property is set to true.

There is an UpdateBullets() function which handles the movement of the active bullets, and collisions are handled by the CheckPlayerCollision() function.

Muzzle flash

I thought this would make a nice touch, It’s a simple sprite which is displayed over the top of the end of the gun barrel for 0.2 seconds while the gun fires.

Again, the movement is handled by the existing code which moves all the zone sprites, and they use a timer to determine when they should vanish.

Bugs!

Now I had huge problems getting the bullets and the muzzle flash to appear in the right place. It turns out I had made a mistake, thinking that the guns[] array ID directly related to the zoneSprites[] array ID; which isn’t the case.

It took literally hours of checking through all the code before I found out what the problem was, and another hour to decide on a solution and code it.

The guns[] array stores data like the last timer fired time, the muzzle flash spriteID, etc. of the gun. Whereas the zoneSprites[] array stores the spriteID of the zone sprites (not just the guns, but the pipes they sit on, and any other elements used)

So, you can see the problem, the ZoneSprites[] array stored gunSpriteID, pipeSpriteID,gunSpriteID, pipeSpriteID,gunSpriteID, pipeSpriteID, etc.

I fixed it by adding the ZoneSpriteID to the guns array[] so I had some way of identifying which zoneSprite the gun data was attached to, and some functions to allow the game to check or assign this.

The second bug is less of a show stopper, but for some reasons the bullets move at slightly the wrong speed in the x axis.

This issue is shown in the image above, where the blue diagonal line is the expected trajectory of the bullet, compared to the actual position of the bullet.

This second bug has been added to the Known Bugs/Issues board on the Trello, and will be fixed when I next work through the list of bugs.

Next Time!

That’s all for this update. Now that I have finished all the zones, I will concentrate on getting the last few powerups/boosts working.

I’ll be back in another fortnight with yet another exciting game progress update! See you then ๐Ÿ™‚

Game Progress Update #15


Update #15

Hello world! Welcome to the 15th Dev with Dave Game Progress Update.

In this update I’m happy to say that I’ve got the Missile Zones doneย ๐Ÿ™‚ It still has some rough edges, but these will be taken care of as part of the game balancing/level design phase.

The missiles themselves were simple additions to the existing systems, but I did have to make a couple of changes to things to get some of the associated effects to work properly.

Since the Missile Zone has been the only thing in this update, I thought it might be invaluable if I went a little more depth into how I created the zone.

Planning

This is how I described the missiles zone in the GDD.

3.3.5 Missiles

Missiles which fly from right to left, possibly using a laser targeting system to warn the player where the missiles will be flying (Like in Jet Pack Joyride, or Sky Force)

Flappy Vaders GDD

It’s not a terrible amount to go on, so I thought I would take you through my process of how I went from the sentence above to the functioning missiles zone in the game.

Since I had referenced both Jetpack Joyride and Sky Force in the GDD, my first port of call was to Google Images so I could remind myself how the missiles looked and worked in these games, and to get some reference images to help with designing the missile and missile effects sprites.

The above image is from Skyforce Reloaded. It uses guidance lasers to show the player the path of the missile and to give them a second or two to move out of the way. The missiles are red and white, and look well, basically just how you would imagine a missile to look.

In Jetpack Joyride, the missiles attack is again forwarned, but this time it uses floating exclamation marks to indicate where the missiles are coming from. This missiles also look strikingly similar to the missiles in the previous game.

So with this in mind, I set to work in Paint .net with a screen grab from Flappy vaders to mock up how I imagined the missile zones to work.

I used Hitfilm Express to create the below video to demonstrate how I imagined the effects would appear in game.


I dropped the warning markers in the end, in preference of the alert flash and the guidance lasers.

I also intend on adding flame/smoke animation to the back of the missiles, but I’ve not got that done just yet.

Once I had an idea of what I was hoping to achieve, as well as all the assets I’d need, then it was time to open AGK Studio and dive into the code.

Red alert flash effect

The first and most obvious addition with this type of zone is the red alert warning flash. This is triggered at the zone start and remains active until the beginning of the next zone.

It’s another full screen sprite placed over the screen, and the flashing is being done using the sprites alpha channel.

It’s handled in a similar way to the Smart bomb effect, with the addition of a direction variable. So when the sprites alpha value reaches zero, instead of the effect ending, the direction variable is toggled and the alpha value is increased instead.

Missiles

The missiles were the simplest part to implement. They are handled exactly the same as the other zoneSprites, but have additional movement code in the same way that the asteroids do.

Unlike the asteroids, the missiles don’t start moving independently until they are close to appearing on screen.

Guidance lasers

The guidance lasers appear just before the missile sprite is due to appear on screen, and disappear again once the missile has left the screen.

I had to change the way the zoneSprite depths work slightly in order to make the guidance lasers appear over the top of the rest of the zoneSprites, but underneath the missiles themselves.

Next time

And that’s all for this update. I’m hoping in the next one to have the Missile jammer boost working, as well as maybe the last zone and boost as well.

Don’t forget to follow @DevwithDave on social media to keep up to date with the project, and with any luck I’ll see you all next time ๐Ÿ™‚

Dave