A game’s just loops within loops…

Image from https://love2dev.com. Don’t know where they got it from, but it looks pretty enough and has some loops in it. I could go take this photo myself, but I’m being lazy enough just to link instead.

In March, after the Global Game Jam 2019 (GGJ19), I started work on a new idea that I tried to work on from a different angle as normal. Rather than just build a tech demo and then get bored with this idea, I focused on making something that’s vaguely playable so I could then refine the fun part.

Unfortunately, between a holiday and then increased commitments with work, I stopped progress on it about a month ago, just as I was coming up to creating the turns part of the gameplay (as it’s a turn-based RPG at heart). If you want to have a look at the current progress then go to ditt.to/tags/dungeon-golf/.

Trying to pick it back up again after that break, I’ve got stuck with trying to work out how to actually add the turn-based bits in. I know, in theory, how it should all go, but it felt like an Ikea project with no instructions, no tools, and missing half the screws. Trying to work out where to start was just wasting time I didn’t (and don’t) have.

This ties quite neatly into my experience with GGJ19. I came up with an idea that fit the theme, spent a lot of time trying to make something that fit that theme and then kind of forgot (or ran so far out of time the game’s only about 15 seconds long) about the game play, the fun, and the experience.

To be fair, this is also my general experience with game jams that I’ve participated in, both solo and as a team - a focus on the idea and not on actually making it a game until very late in the process.

This blog, then, is going to cover the basics required to make a game. I’m not going to include fun, as there are plenty of un-fun games (such as any walking simulator), but instead look at those initial steps into a game - loading a main menu, loading a level, and completing a level that either allows you to play another one, or forces you to replay the current one due to you sucking so much.

I’ve broken these down to 2 parts that I’m referring to as the “Level Loop” and the “Game Loop”.

The level loop

For my purposes, the Level Loop is what takes us from loading the game, through the Main Menu and into a level. It then allows us to leave that level and start another one, repeatedly doing this until we win or give up. This is the "Live, Die, Repeat" part of your game build.

Without a Level Loop, you have no way to get into the game - you’re always stuck at the tech-demo stage. I’ll do a blog later that walks through what I expect a very simple Unity Level Loop should look like, but I’d expect it to contain the following:

When the game starts it loads you into the Main Menu (you may have some 1 or several hundred intro screens by this point). From the Main Menu you can go into a level. From the level you can either move to another level or back to the Main Menu. The user’s always within this loop at some point in your game as it’s the sticky bit that holds your game together.

Even if you want to do a single-level sprawling epic (or just a very small game), having the Level Loop sorted first gives you a nice easy foundation to work from.

The game loop

The Game Loop, on the other hand, is what happens inside one of those levels. Once the level starts you’re inside that game loop, generally moving around, trying accomplish the objective or objectives that will allow you to complete that level, and trying not to have the level loop ask you re-try the level for the 46th attempt.

I’m going to cover Gameplay Loops in the next blog a bit more, but the Game Loop is basically the code that contains all the Gameplay Loops. I’m viewing it as the Game Loop is how the game engine views your loops instead of your design document (which would be the Gameplay Loops).

To put it another way, the Game Loop is the millisecond-to-millisecond loop that’s job is to check you’re either alive or dead and tell the Level Loop what to do next.

When building the Game Loop in a game jam, if you focus on the most basic aspect of your game first, which is normally movement (unless you're doing a puzzle game and then it tends to be click this block to win) and get that working as soon as possible.

Once this and the Level Loop have been created you can then start adding interest to your game, as in, adding the actual game bits unless you've made a walking simulator.

Next blog, I’m going to crib various ideas from other people to expand on the Gameplay Loop concept as I really hadn’t given it enough thought before.