Skully Brookes
  • Home
  • Gallery
  • Games

Search for a Star 2014 (February - March 2014)

Each year, Aardvark Swift run a competition called Search for a Star (which is also accompanied by another competition, Rising Star). The competition is aimed at graduates and masters students to help provide more insight into getting a job in the games industry. 
The first round is a coding test. The test is put together through the guidance of various games companies to try to make sure it's concurrent with the types of coding tests that candidates will likely face while searching for a job. I had done this round during the previous year's competition. I was surprised by how much I apparently knew during that test, yet I didn't get through to the second round. This time round was the polar opposite, I left the test feeling less than inadequate but found out later that I was apparently in the top 17% of candidates and so had got through to the next stage. In this stage, we're provided with a broken game that we have a week to fix it and then add functionality to it. I had half a mind to thank the organisers but then decline going further in the competition, given that I didn't have a week to spare. however I figured, even if I won't be able to submit something that will challenge the applicants who can give a week for the competition, I could at least have a look at it and do something. Every little helps, so it would be foolish to turn down an opportunity to improve myself.
Another factor that caused me to be pre-cautious about the test was the fact it was using Marmalade. After my harrowing experience in first semester, I was reluctant to meet it again. I was though, at the distinct advantage of having used it before. I decided to take the test asap given that my work load was ever increasing as coursework deadlines approached. I had a few spare hours during the first night, where I had a look at the compile-time errors. They were simple enough, mainly regarding the scope of objects that are part of a namespace. Next were the run-time errors, these again were pretty simple to find. The final fixes required were memory leaks. The one thing about Marmalade that is inarguably useful is the memory management system, which keeps track of allocated memory and thus can inform the user if they're trying to terminate the program without having released all the resources. It was such a warning I was met with and it took a little longer to track down where the leaks were. It wasn't helped by the fact that some objects delete provided resources automatically, so there were numerous new operations with hidden corresponding delete operations. Still, I managed to find the errors and the application ran without a further hitch. The application provided a title scene which after a click moved to the game scene. After a set amount of time, the game ends and moves to the results scene. Clicking here will then go back to the title scene. The "game" allows the player to click on random shapes aligned in a 4 x 6 grid. Clicking on a shape highlights it and dragging over multiple shapes selects them all and then they are reset when the player releases. While there are shapes selected, the score counts up every frame.
The first thing that bugged me was the fact that a fixed framerate was used for the delta time. This is most apparent when the game enters "sleep" mode and less time is allowed to the application. So I added a timer class and fortunately I already knew the approach to adding a file to a Marmalade project. After this was working I made changes so that the in-game timer only started counting when the player enters the game scene.
The source code was made available through a repository and to use it, I used Atlassian's SourceTree application to manage the source control. It was a far cry from TortoiseHg, but my experience with multiple source control applications has made it easier for me to adapt to new ones and I picked this one up pretty quickly. For security, I worked from a separate branch, however I realised later that the repo was exclusive to me so I didn't actually need to. There were a few issues with the set up of some of the UI components, which I'm assuming was intentional, so I adjusted them so they worked properly.
When I had more time spare at the weekend, I started to try to make it into more of a game. The first thing I did was remove the current game code and replaced it with logic that adds up how many items of the same shape are selected and after releasing, that number is squared and then added to the score so that there's more reward for getting longer combinations. Catching a different shape will break the combo. This immediately improved the game and I was starting to enjoy playing it, bizarrely.
Next, I made it so that the score was displayed, as well it should be, on the results screen. From play-testing, I realised it was too easy to get caught out by the timeout and click to the title screen, so I added in a delay before accepting input from the player. The next addition was the ability to save the highscore. At the start of the game, I attempt to load in the highscore from the save destination, if it can't find the file, I check for the reason. If the error was that it couldn't be found, I ignore it because that's fine, I assume that there is no current highscore. Upon completing a level, the score is checked against the highscore. If the player's beaten the highscore, then that value is saved out to the file. If that file doesn't exist, it's created. This was awesome and awoke the competitiveness in me. Which drove me to mild frustration when I set a score of 1799 and couldn't for the life of me beat it...
As I was limited on time I could spend on this, I wasn't going to go out of my way to create a complex solver to work out what shapes to spawn, I simply left it up to the random function provided with Marmalade. Which as it happens isn't overly random, it's common to clear some shapes and have the same exact ones spawn again. This could lead to the grid having no possible 3+ combinations. To get around this, I added a randomiser function which refreshed the grid with new shapes. This could obviously be abused to create better grouped shapes and so I added a penalty to the use which is equivalent to what the player would score if they selected half the grid.
While this was all fun, the next thing I wanted to do was the audio. This was clearly something that was expected, as there were audio files provided in the source. There was a README provided with the source, but it was a .mb filetype which I couldn't open so I just went rogue and did my own thing. I soon realised the sounds were the stock sounds provided in the Marmalade demos. The title music works pretty well but the "in_game" file was just farm noises so it wasn't quite as applicable... So I went to freesound.org in the hope of finding some free songs. I struck lucky as there were a few samples, all with totally different moods. I wasn't sure what would best suit the game so tried them all. It turned out only one actually looped properly. Fortunately, it was also my favourite of the lot. Once I was satisfied with the menu music, I added in the provided sound effect. I started off by playing it every time the player selected a shape. However I realised that not only could it get annoying fast, the amount of sounds playing could ramp up quickly, which would then eventually exceed the amount of sound channels available. I could make a fix for this but I decided to instead only play the sound when the player successfully collected a combo of shapes and this worked really well. The last thing bugging me was the abrupt ending. There didn't feel like enough of a warning. I lessened this by highlighting the time in red when there was only a few seconds left but I knew this wasn't quite enough. So I looked online again and found a crescendo sound. It seemed a little too "spacey", but I tried it anyway and to my surprise, it sounds ok and the point where the clip finishes is exactly when the menu music kicks in.
I was ready to leave it at that. I was pretty happy with what I managed to do in a few hours. However, I realised there was one last change I could make. The game had values to dictate how big to make the grid. I decided to make it so that the grid scaled and positioned the items based on the screen size so that they would always fit in. I was pretty pleased with the results although it isn't a complete solution, it only really works for the width, with items potentially going off the bottom of the screen. Below is a gallery showing various shots from the game. I also have a video of the game being played but without the mouse cursor, it's a little difficult to make out what's happening.

What did I actually do?

I took part in the 2014 Search for a Star competition and passed the coding test in the first round, coming in the top 17% of applicants. This put me through to the second round which entailed being provided a broken game that I had fix and then add functionality to. I was given a week to do this but due to time constraints I only managed to give about 15 hours worth to it. I managed to fix the bugs and errors quite quickly and went on to create a neat little game, akin to Bejewelled and Candy Crush Saga.

Skully Brookes
Copyright © 2022
Contact Skully