Taking Part in Ludum Dare Game Jam – Part 2

With this being our first game jam, we weren’t quite sure how to plan or how to manage our time. As the jam started at 02:00 in our time zone, we decided the best idea would be to check what the theme would be, then to go to sleep hoping that we’d subconsciously come up with some ideas overnight.

By the time we were actually ready to start (after recording and editing the weekly Interference update video), it was Saturday afternoon – about 11 hours in to the jam. We’d had time to think about the theme (“A small world”) for a while, and decided to do something based around looking at a petri dish through a microscope. We’re both fans of puzzles, so decided to make some kind of simple puzzle game.

Berni quickly came up with the idea of showing the player a petri dish with various “bugs” in that would have several attributes (eg colour, shape) and the player would have to apply the correct drugs to make the bug shrink (but using the wrong drug would cause it to grow). For example, a spiky yellow virus would grow if given a round yellow drug (wrong shape), but would shrink if given a square yellow drug (correct colour, correct shape (well, it has corners!)).

I’ve been spending my spare time learning about Unity, so decided this would be a good excuse to play around with that. My experience consisted of reading “Teach Yourself Unity Game Development in 24 Hours” and doing half of a Unity course on Udemy, but I hadn’t actually made anything from scratch. Still, never hurts to have a go at things.

For the first few hours, I had a go at implementing the system Berni had devised, but – if I’m completely honest – didn’t have much success. I managed to set something up where you could drag coloured shapes onto other coloured shapes, and then they’d change size depending on whether the colours matched or not. It sort of worked, but didn’t feel very fun – you just piled drugs on to one bug, then moved on to the next. Berni suggested making different bugs grow at different rates, and introducing bugs that had two colours, but I thought it was getting a bit complicated (and whilst I could cope with changing the colour of a sprite renderer in Unity to make different coloured bugs, I had no idea how to handle things with two colours – swap in different sprites, rather than colouring the same sprite?).

Original Superbugs prototype

I suggested that we keep things simple: display the bugs in a grid, then have the player add drugs which would affect adjacent cells. You’d have to work out the correct placement in order to get the right combinations of colours. To make it a bit more interesting, we’d make the grid out of hexagons. I mean, that can’t be too hard to work out, can it?

Several hours (and a few pages of scribbled notes) later, I’d finally made a system that could generate a “circle” of hexagons, given a number of layers. The problem with hexagons compared to squares is that it’s harder to refer to a particular hexagon – in a square grid you can say something like (1,4) and it means “one along, four up”. The problem is that whilst one row of hexagons will fit into that, when you do the next row everything is shifted across by half a hexagon. I eventually implemented this by assuming that rows would alternate between sitting on even numbers and odd numbers on the grid. It seemed like a good idea at the time (just shift everything by 0.5 on every other line), but in hindsight I think there’s probably a better solution involving adjusting the Y axis of your grid to go at an angle. By the time I realised this, I’d already done a lot of implementation, so decided to leave things as they were.

A dynamically generated grid of hexes. Harder than it first seems!

Next was dealing with drugs being dropped into the grid cells (or “hexes”, as I called them in the code). That was pretty simple – Unity’s collision system took care of most of it. Whilst a drug was being dragged, we kept track of any hexes that it collided with, and when the mouse was released we dropped it into the last empty hex it touched. This just involved setting its position to the same as the hex and setting the drug’s parent to the hex. At this point, we also check the colour of the drug, and then set the colour of the hex to match. If a drug is picked up again, we set the colour of the hex that was its parent back to white. To change the adjacent cells, we check the two above, the two below, and the ones to the left and right – six in total. Well, I say six – one of the obvious things that I forgot to check was whether those hexes actually exist (eg if the cell is on the far left of the grid, then there won’t be any cells to the left of it). Fortunately, that was easy to fix once I’d realised my mistake.

Testing the colour mixing – “pill palette” at the top left (where you drag the pills from) and a colour mixing guide (which went on to become the game’s logo) at the top right.

I’d written a lot of code in the last few hours, so decided to do something else for a bit – making some sprites. I’m not much of an artist, but thought I could probably manage something that looked a bit like a virus. Using the excuse that I was aiming for a minimalist style, I came up with a few varieties that looked OK. They did seem a little boring, though. One of the things that had just been covered in my Unity course was animation, so I messed about with that quickly, setting a simple animation that made the sprite shrink a bit then grow (as if the virus was breathing). Surprisingly (for a change that took about two minutes), it looked pretty good and made a big difference. It gave me the idea that the viruses shouldn’t be removed when treated, just suppressed – so they’d become active again if you moved a drug away or added the wrong drug next to it. I quickly made another animation that made the virus shrink and stop moving.

As a programmer, I’m pretty sure this is what viruses look like in real life.

To test things out, I made a script to pick random hexes and spawn viruses of random colours, then edited the “do stuff when a drug is dropped” script to check the colour of any adjacent viruses and set an “isSuppressed” flag if the drug colour matches the virus. That triggers the animation to change from “idle” to “suppressed”. I was rather pleased when I ran the game, saw a few viruses spawn and start “breathing”, then stop when I placed drugs next to them. It was starting to feel like a game! We made a minor adjustment to the drug sprites here – adding a “C” to the centre of them – to make it more obvious when a hex contained a drug.

Testing the game out. Some UI has appeared, along with a “reset” button to start the level again if needed.

Something that I’d learnt from the Unity course was that adding sound makes a big difference, even if it’s just a small thing. I didn’t want to spend ages looking though lists of sounds, so just grabbed a microphone and recorded myself making a “pop” sound. Playing that when a virus spawned made things feel better, but it still seemed that something was missing. We thought that perhaps a sound for when a drug was picked up or dropped would help, so I recorded a “chk” sound. Almost there – but the whole thing was a little quiet when you weren’t doing anything. We added a bit of background music (a track from our friends at Vivid Muzik), and everything came together 🙂

It started to feel like things were almost done, but then I realised the big oversight that I’d made. Whilst the virus spawning system seemed to work well, it was just picking random hexes with no consideration for whether the puzzle would actually be solvable. I’d not had to write anything like this before, so wasn’t sure if there was a standard approach for it. In the end, I reasoned that if I made the game generate a solved grid, then pick viruses to spawn based on that, it would always be solvable. It appears to work, but perhaps there’s an edge case that I haven’t thought of!

I spent a few hours on Monday putting together a basic UI, instructions for the game (just some simple buttons and images), and a “plot” (you’re a scientist trying to prevent a pandemic) and the whole thing started to look like an actual game. On Monday afternoon we packaged the game, uploaded it to itch.io and submitted it to the Ludum Dare site – a few people have already tried it and left encouraging feedback.

I’m proud of what we managed to get done in a weekend (I think that our active time on the game was probably under 40 hours), and I’m tempted to add a bit more polish and release an updated version after Ludum Dare is finished. There’s a few things that would need changing, like trying to increase the replayability: at the moment, the grids are programatically generated – it would be interesting to generate levels based on a seed value (so different players could try the same level, and see who could solve it the fastest). Another improvement would be to calculate the optimal solution for each grid, so players could see how many steps over par they are.

Having spent a good few hours playing around in Unity, I’m very impressed with it – things that I expected to be tricky to implement were a lot easier than I anticipated, and being able to build for web, Windows, MacOS and Linux at the same time is excellent.

We’re definitely looking forward to the next Ludum Dare, but have decided to try and make a small game each month as a break from our big projects – it’ll give us a chance to try out random ideas without having to work out a long term plan for them. If everything goes to plan I’m going to document the process and share the results at thelab.wearecentrifuge.com.

If you’d like to try the finished game, then you can find it at centrifuge.itch.io/superbugs – we’d love to hear your feedback 🙂

Taking Part in Ludum Dare Game Jam – Part 1

Nathan has been wanting to take part in a Game Jam for quite a while – so when we saw that the Ludum Dare game jam was about to take place – and they were celebrating their 15th year – we decided we would give it a go this time.

Amazingly, as we are busy most weekends, this particular weekend everyone cancelled on us and we had an entire weekend to ourselves – we took this as A Sign and resolved to definitely try to make a game in just one weekend. We have never done this before so we thought it would be a great challenge and possibly fun 🙂

The first step was to vote on the possible themes on the LDJam website – these had already been posted by other users and game jam enthusiasts. The actual theme of the competition would be announced at 2am (UK time) on Friday night while we were sleeping. We were hoping that it would be “Keep it alive” as we’d thought of a really great idea for that – but when we stirred in the night and checked our phones we discovered that the actual theme was Small World.

We tried to go back to sleep and hoped we’d dream up a really good game idea before morning. We had a brainstorming session as soon as we woke and talked about what Small World could encompass:

  • there are already games out there already featuring small worlds that are fought over because they won’t fit everyone on
  • small world can also mean child-sized things
  • small world theory where everyone turns out to be connected to everyone else – could we make a game about that or would it just end up being too massive?
  • then, we had the brainwave that small world could also mean – microscopic!

That idea really got the cogs turning and we came up with superbugs – a game where you’re in a science lab and peer through a microscope at viruses in a petri dish. The aim of the game would be that you have to kill them off with combinations of drugs before they grow too big and become Superbugs – and resistant to ALL drugs.

We’d start with a few simple levels , where you just have to kill one virus with a drug of the same colour. This would be scaled up to many viruses – some needing multiple drugs and others needing colour combinations to kill them off.

As Nathan, our developer, is halfway through his first course on Unity – we thought we’d make the game in that. It seemed like a good way of testing his understanding so far!

Our first prototype was one petri dish containing the viruses – but it wasn’t very interesting and did not need a lot of skill. Also it was difficult to animate the viruses and get them to interact with each other.

Then Nathan came up with the idea of hexagonal cells – like a beehive – where each drug would affect the cells around the target one. This would make it into a proper puzzle game. It also allows for drug colours to be combined to make the other colours needed.

We didn’t have any access to sounds – so Nathan did the sound effects himself and recorded them to put them in the game.  I especially like the “pop” as each virus explodes as it is eliminated by the correct drug combos!

One of the hardest parts of making the game so far is working out how to automate the production of each level to ensure that it is still solvable. They do it with Sudoku – so it must be possible!

Check back in a few hours for part two, where we’ll show how the game turned out and how you can play it!

Find the game here: https://centrifuge.itch.io/superbugs

Zeitgeist – How Trump Influences Online Games

When you are running a game where there is mainly user content generated – like Interference our drawing and describing game – you get to see the current zeitgeist. With players being able to start games on any topic it’s something we find fascinating, seeing what subjects players describe and draw over time.

Recently, as you would expect, there’s been a lot of Donald Trump popping up in our games. Some seem to be complimentary and others humorous or insulting – as you might expect in real life! Not just our US players but everyone all over the world has an opinion on what he’s doing.

Descriptions that players put in to start new games have been showing what most consumes players’ thoughts – these include some of his key election pledges such as “Drain the swamp” or “Trump’s wall“.

It’s also interesting to read the discussions taking place between the players in the Comments after the games. Recently some have been upset about the negative representation on the President – and some have resolved to try to resist this in future – as our community is usually very supportive and respectful of each other.
As game devs we obviously have our own opinions – but Interference is resolutely neutral – like the BBC 🙂

During the election period there were fewer Hillary Clinton pictures or mentions – except in relation to Trump. For example the charming portrait below:

Obama didn’t get as much attention when he was president – but again can be seen popping up in relation to Trump in more recent months.

Needless to say – it’s not only our game that Donald J Trump is affecting – he has been appearing in more games that any US president before.

For example Surgeon Simulator added a special Trump mode where you could give him a heart transplant with a gold or stone heart (At the time of writing stone hearts are winning with 56%).

A new game called Mr President came out, where you play a bodyguard and can decided to save (or not) Ronald Rump, a billionaire president, from a raft of crazy assassination attempts.

There are a slew of mini games such as Trump Donald – where you can just spend all day blowing his hair with a trumpet.

So, love him or hate him at 100 days in to his presidency he’s certainly been influencing popular culture in a big way. All eyes are on him to see what he does next.