Making Crappy Bird


I said I wasn't going to go back to Bird Game. But after the nightmare that was working on the Ludum Dare leaving ETS unfinished, I hoped to return to ETS, which made me think about returning to Bird Game. And if I could do "Bird Game Remastered" and finish ETS, that would be 2 games sorted for The Month of Games (as I posted about a couple of weeks ago, ETS did not get finished).

ETS (Estimated Time of Survival) was a game I attempted to make as part of the Ludum Dare earlier this year. I posted about it on my blog.

The Month of Games is something I decided on doing for August 2022, also written about on my blog.

So, the first game in The Month of Games is Crappy Bird.

It used the code of Bird Game as a starting point, but is more fleshed out (with 164% more code). The original Bird Game is still playable, in part to show the differences between the two now I've spent more time developing other things and having been able to feed my new code back into the original project.

The first change was scaling the resolution. Bird Game was stuck with three available resolutions, and there was some horrendous event listening going on so that the UI could reposition itself once the resolution had been changed. Shortly after finishing Bird Game, I started making use of Render Targets, which I'd learned to use on Halloween Game, so everything in the game world is drawn to a surface, and then the UI is drawn separately.

Halloween Game is another game I was making, that has since been shelved. I know it's tiring redirecting to my blog, but this post is actually taken from there and it provides more context. Story Game is mentioned later. That has also been shelved.

Now Crappy Bird has a list of resolutions that are available on the device it is played on, and I don't need to reposition the UI everytime it is changed. This has resulted in the text in the pause menu being much clearer too.

Playing in 4K also revealed that while the game incremented the score for eating an ice cream, the characters were holding chips because when making Bird Game I had copy-pasted the sprite definitions and not updated the offsets.

Mechanically I liked the idea of a loop where you can't poop without first having consumed something, and if you eat too much without pooping then you lose control to do a bigger poop. I set up the Poop Meter to keep track of this and set different values on the items - drinking a coffee will increase the bar by 1, whereas eating chips increases it by 2.

I added a few more sound effects - a crunch when eating food, slurping for drinks, and a poof when the bird is killed. After that, I wrote some code to draw the AI nodes so I could see which ones were causing the characters to walk into the street rather than stay on the pavement. Only a few of these needed to be shifted, but now that I could see them I was able to add some more.

A few more nodes got added to take the characters down onto the beach which let me add footsteps. The code for this is a bit of a hack - partially because I'm building on top of a codebase that was written in less than a week and I don't want to do big rewrites, and the hack is not really that many stages removed from a proper solution.

If the character's Y co-ordinate is greater than a certain number (the point on the map texture where the beach starts - although the game has no concept of a beach), spawn a footstep at an offset of the character's position every second. The footstep then displays a sprite which has its opacity lowered each frame before despawning.

Continuing on with little details, I then added some waves in the ocean. And then I looked at adding shadows to the bird and the drone. My first thought was adding additional sprites that would be copies of the original animations but darker and with all the details removed. But the solution I implemented was way better (I wrote about this a few weeks ago).

On Halloween Game, I started working on a minigame where you carve a pumpkin. The code for this would create a copy of the pumpkin's texture and then take the input from where it was carved and change the colour of the pixels in that area. I used this as a basis for shadows - copy the main texture, but recolour everything that isn't transparent to be a slightly transparent shade of black.

Not only did this work perfectly, but the process of adding shadows to the bird and the drone was so simple that I decided to also add it onto the characters on the streets below too, which was possible by making the shadow's offset editable.

Keeping on with characters, I added a reaction animation for when their item gets stolen. I then decided on making it so that some characters below would be in control of the drones. When reaching a certain score in Bird Game, there can be up to 6 drones chasing the bird at once with no way of stopping them. If a character gets their drone controller stolen by the bird, then the drone will fly off and the player is able to survive for longer to achieve a higher score that was possible in Bird Game. The penalty for stealing the drone controller is a big increase to the Poop Meter.

I plugged in a PS5 controller to make sure it was possible to control with that, since I'd brought some code across from Halloween Game that allowed it to work. When being unable to progress past the title screen, it turned out I hadn't brought across everything I needed.

Next I added changes to display a current objective. The objective would be chosen at random from a list of existing targets - stealing an ice cream, or pooping on a car - and then award double the points when the player completed that objective.

With a Story Game build working on mobile, I tried getting Crappy Bird working there too. It successfully built, but then crashed on load as it was said it was unable to find the audio assets. I couldn't see any reason why it was unable to find them and continued to spend about an hour each day for a week trying to get it working.

I imported all the content specifically into the Android project, instead of it using the shared library. I tried not loading the first file as it was the largest, and I had problems that went away when getting rid of a large audio file when porting a Unity game to the Vita. I tried changing some settings in the project file. But the thing that finally fixed it was changing a path name to use a backslash instead of a forward slash.

Now a mobile build was working, I made all the menus be touch screen friendly and removed some options from the settings menu that could not be changed (resolution and windowed modes). I also had to add the ability to control the bird using the touch screen which meant writing some code to translate the position on the screen that was touched into the position in the game world - I didn't have to do this for menus since the UI layer is setup to do that automatically.

While I could make the bird poop by tapping on it, the touch controls for making the bird turn weren't doing what I wanted. It was supposed to be that you hold the screen to make it turn, but it only ever turned with quick taps and these taps would only rotate it by a fraction of what holding would do. I eventually noticed that the touch states don't just contain Pressed and Released, but they also contain Moved which is what it decides to use when holding because obviously that makes sense (why can't other coders name things properly?).

Movement now worked, and I added a method to determine whether two fingers had been used to swipe down in order to trigger the bird to swoop. Beyond a couple of minor fixes where I hadn't hooked up UI boxes to trigger events when touched properly, the mobile build was now on par with the PC build.

I then fixed up some remaining bugs. The kill box on the drones wasn't an actual box but just some rough numbers that were rough enough that, at the right angle, the bird could be 90% overlapped with the drone and still not be killed. I assumed I would have to take into account rotation when setting the box up properly, but it worked without me having to do that.

For a bit more tidying up, I tried to stop the drones from overlapping with each other since it was possible to get them all huddled together at the same position. I added a file called DroneManager before deciding that AirTrafficController was the better name which the drones will make a call to check if the position they are moving to is free.

I also added a turn around / wrong way indicator when the bird ends up out of bounds. If the bird is out of bounds for too long then the game will now show a black screen for a second while the bird is teleported back into town.

While the games this month were always going to be free, I wanted to see how easy / difficult it was to put ads in the mobile version. In this case, turns out it's pretty easy. My first thought was that after getting killed that a full-screen ad would popup like tends to happen on pretty much any free mobile game, but that was way too intrusive for my liking and so I stuck a banner at the bottom of the score screen.

I had planned on doing a big overhaul to the art, but whatever I tried generally made things worse. So visually it's something I'm not really happy with, but I want to work on other stuff so it's going to have to do.

With a PC build created, I also created an .apk for Android but Google doesn't accept apks anymore and wants aab files so I had to go and find out what I needed to do to spit one of them out. Then I needed screenshots for the Play Store listing and Windows was absolutely not co-operating with me to produce these. No matter what state the game was in when I pressed Print Screen, it always pasted the pause menu. I even copied something else to the clipboard to confirm that Print Screen was actually updating the clipboard, but it really liked the pause menu.

Then eventually it was all done. PC build packaged, and including the .NET libraries this time (Bird Game required the user to manually install it). Android build approved by Google. The first game for the Month of Games was complete.

Except, this was actually supposed to be the second game. I ended up swapping this with next week's game in part because of the amount of times I'd decided to start something else, and because I wasn't sure if Google would approve it in time (they did). Even after they approved it, I sat on it for a few weeks before clicking the Publish button on Sunday night expecting some more hoops to jump through. But turns out there weren't any (besides me having to properly connect AdMob which took a minute), and so Crappy Bird has actually been available on Android for nearly a week now.

For the most part, I'm happy with how Crappy Bird turned out. It addresses most things on the list I made, and I've published something on an actual store for the first time in years.

Files

Crappy Bird (Windows) 45 MB
Jun 24, 2022

Get Crappy Bird

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.