December 3, 2024

More Learning Through Games

In a previous post, I highlighted a few computer games that I thought could teach you something about programming. There were a few games I didn’t get round to discussing, and a few additional suggestions I’ve come across since so I thought I’d do a follow-up post. I considered trying to follow the same classification I did previously, but it doesn’t make sense given the games I want to discuss, so we’re going for a different way of breaking down the list. I will, however, mention when a game fits into a category from the previous post.

Also, the original post restricted the games to things that run on my linux laptop. I’ve relaxed that constraint in various ways, and I’ve included some games that don’t satisfy that criterion (in various ways).

I’m probably being a little bit more flexible in what counts as a game that teaches programming in this post.

2D character games

In Rogue Bit you play a byte of data that contains, GASP, a rogue bit. You move around in memory, and if you happen to be sitting in a particular part of memory when it is read then you can affect the program that is running. It’s a very clever idea and leads to some nice little puzzles. Would you actually learn much about computer memory and assembly code instructions if you didn’t already know the basics? I’m not so sure you would. But this is, nevertheless, a clever and unique puzzle game.

Patrick’s Parabox is a nice little top-down puzzle game. It’s relying on that classic puzzle mechanic of “you can push the block about, but you can’t pull them.” The unique thing about this game, though, is that some of the blocks are blocks you can go inside, and some of the blocks you go inside are also the block you were in originally. What? Look, it makes sense if you play the demo. It’s basically stealthily teaching you about recursion. The mechanic takes some getting used to – it feels pretty mind-bending at first – but it makes for some really neat puzzles.

A game that takes that same “push blocks around” mechanic, and does something very different with it is Baba Is You. In this game, the rules are written out in blocks in the game world: Baba Is You, Wall Is Stop, Rock Is Push etc. And by moving the blocks around, you can change what the rules are. So if you move the block that says “Rock” so that it now says “Rock Is You”, you now control the rock, rather than the Baba character. It’s a very clever mechanic, and the puzzles are really good. Does the game rely on any distinctively programming-related concepts, over and above the standard puzzle game requirements of logical thinking? Not especially, but it’s such a clever game that I thought it was worth mentioning.

I have to admit, I didn’t play very much of Hack n Slash, but it looked like an interesting take on the genre of adventure game. You play as a character with the ability to modify aspects of the environment. So you can adjust the properties of a bush to make it drop health, and then turn the “is on fire” boolean to True. The bush burns up and drops its hearts. You can also adjust the behaviour of entities in the game world by modifying the code they run. It seems like a fun and interesting idea, but I found the controls kind of clunky and the early game seemed to involve quite a lot of aimless walking around. Steam reviews seem to agree that this is a nice idea, but not terribly strong on the execution. It also seems, like Rogue Bit above, that this is a game to play to make use of your coding knowledge, rather than a game you could really learn much from.

A game that I thought might involve a bit of programming learning is Cool Headed which is a puzzle game where you control a number of robots. Each robot has a handful of abilities, and you tweak the timing of what it does when in order to beat the level. Figuring out the right orders and timings involves a little bit of trial and error, and I don’t believe that the control over the robots goes beyond providing a list of instructions with timings to be executed in order (I haven’t played that far into the game yet, so maybe I’m wrong here). So no branching or other tricky stuff where you could reasonably argue that it’s a game that teaches you about programming. So not great as an aid to learning, but a nice puzzle game nonetheless.

3D puzzlers

There’s a genre of puzzle game that I maybe overlooked in my last post that involves lasers, mirrors, beam splitters and that sort of thing. It’s a kind of puzzle that often shows up in other kinds of game It’s a feature in the Talos Principle, and Portal 2, for example. Prelogate is a simple, barebones example of taking that kind of puzzle as your core gameplay mechanic. Prelogate then adds in logic gates to that formula. I have to admit I didn’t get far enough into it to actually play the puzzles involving logic gates, but I can see how they’d add some extra complexity to the puzzles. I can’t say how complex the puzzles become in this direction, but this is a nice minimalist puzzle game either way. One interesting thing about this game is that you can switch back and forth between a 3d and 2d representation of the puzzle.

I also tried to play a game called Glitchspace but it lived up to its name and was unplayably glitchy. It sounded like a really neat idea though, similar to Hack n Slash in that you’re modifying the code that describes your environment. It’s a shame I couldn’t get it working because it’s a neat idea.

Games where you type

A game that would have fitted in to the “Games that use a (high-level) programming language” section from my previous post is The Farmer Was Replaced. This is a game where you program a drone to run your farm using some subset of the python language. I enjoyed it up until the part where you have to program the drone to solve a maze. At that point, I felt that I was fighting against the drone’s API rather than solving an interesting puzzle. For example, you have no way to “look” at what is in an adjacent square, so to check where the walls are near you, you have to try to move in a particular direction, and if your position after the move is the same as it was before, then there is a wall in that direction. Up until that point though, this was a fun exercise in problem solving. I think that, as with a few games above, this is going to be a pretty hard way to learn programming, but for someone with a little experience, this is certainly a good way to deepen and exercise that knowledge.

Another game that revolves around typing is Hacknet. This is a game where you play a hacker who breaks into other people’s computers. There’s some nice story-telling touches and interesting worldbuilding as you follow the story and learn bits and pieces about the various groups in the world from text files left on the computers you hack into. The gameplay is, however, quite samey and gets boring after a while. You are also interacting with your computer through a unix-like interface but it doesn’t contain all the commands you’re used to, so that can be frustrating when you encounter something you can’t do in the game computer. As with The Farmer Was Replaced, I wouldn’t suggest this as someone’s first introduction to navigating in a unix shell, but it’s maybe a nice place to practice.

Visual programming

Part of what prompted me to actually write up this follow-up was that several of the games I mention here were heavily discounted so I picked up a bunch of them to try out (steam wishlist, sort by discount FTW). But another part of it was seeing this list of games that involve what the author, Ivan Reese, calls “Visual Programming”. The obvious examples of visual programming I covered last time include things like Turing Complete or Shapez. Games where you’ve got blocks and connections between blocks linking up outputs to inputs. Two new examples of this that I got from the above list are ABI-DOS and Linkito. ABI-DOS has real Zachtronics vibes, down to the PDF instruction manual for the fictional computer system in the game, and the uncompromising puzzle style. Values move along wires and are acted on by blocks of various types. So you have to think about both the logic of what values are being acted on, but you also have to coordinate the timing of the inputs to a block. ABI-DOS could definitely have fallen under the “Games that teach you about process and control flow”. Linkito looks to be similar to a mixture of something like Silicon Zeros and Signal State, two games I mentioned in the first post.

Three other games that have a similar vibe to games I discussed last time out are Shapez 2, Mini Settlers and Beltmatic. These are all pretty similar to games like Shapez or Word Factori. Shapez 2 is, as you might expect, an incremental improvement on the same formula from the original game. The game moves up to three dimensions which adds some complexity, and increases the demands on the computer you’re running it on. Is the increase in complexity of the game worth the increase in system requirements? I am not convinced. I enjoyed the original, and I’m not sure the sequel is worth it. That said, I’ve not played a huge amount of Shapez 2, so take my assessment with a pinch of salt. Beltmatic is basically Word Factori but for arithmetic. Mini Settlers is the same kind of formula but wrapped up in a city builder. In all these cases, we’re looking at games that rely on process and on control flow. Honestly, any one of these games provides same kind of challenges so you don’t learn anything else by playing more than one of them.

Another game with an art style that fits with the above mentioned kinds of games, but a different subject matter, is Rail Route. In it, you are in charge of planning routes and running the signals for a train network. You have to think quite hard about what can safely be done in parallel and what things will block other things. In the game, you’re thinking about which train route sections can be occupied at the same time, and which signals might block the progress of other trains; but it’s the same kind of thinking involved in programming any kind of parallelism.

A more explicitly didactic game is while True: learn(). This game sort of covers the history of machine learning, and in parallel, it is a puzzle game about connecting up outputs to inputs in the right way. The blocks you’re moving around and connecting purport to be kinds of machine learning algorithm, but the puzzles aren’t really relying on details of the different algorithms. The learning part and the puzzle part of the game don’t really connect up. I played this one on my phone, and the controls were a little fiddly, but it was perfectly playable.

There’s also been a mechanic in the last couple of Disgaea RPG games where you can program each character for the auto-battler mode. It’s a little clunky, and it isn’t really a core part of the gameplay to dig into it, but I thought it was probably worth mentioning in this section.

Closing remarks

There are a few other games I looked at, and a few I’d like to look at. But this is more than enough games for one post.

Of the games listed here, the ones I have enjoyed the most are Rail Route and Baba Is You.

© Seamus Bradley 2021–6

Powered by Hugo & Kiss.