Lyrenhex: Blog

On maths in video games

11 February 2024 8 minute read

Musing on recreational mathematics as applied in video games, such as maths puzzles and buildcrafting.

I was reminded of Lockhart’s Lament recently, and somehow it sprung to mind my thoughts about random maths problems that cropped up in Alan Wake 2 and Final Fantasy 16. These were very similar in principle, but different in motivation; whereas Alan Wake 2 was a maths puzzle for the purpose of working out a code for a padlock (to get at that sweet loot in the box), Final Fantasy simply had a casual maths problem as a note you could read in your base; the game provided no actual motivation to solve it beyond your own curiosity about the answer (or, put another way, beyond being nerdsniped). I really liked both of these - I posted about the Alan Wake 2 one at the time as it was funny to me that I was nerdsniped into some basic maths while watching a Twitch stream. That said, I think there’s some measure of things that these did right, and some ways in which they don’t hit the mark.

To start with, I think it’s very good that both of these examples were purely optional; the loot in Alan Wake 2 wasn’t necessary as it was standard consumables that you can find more of elsewhere, but it’s nice to have! Final Fantasy didn’t even draw attention to it or provide any incentive. This, I think, is good, as it provides capacity for the game to still be enjoyable even if you’re not interested in maths or (more importantly) if you, for example, have dyscalculia or acalculia. Mathematics should not be a forced activity, as is a central premise of Lockhart’s complaint with mathematics’ place as a mandatory part of curricula. That said, an obvious solution would be to simply not involve maths in video games - it’s easier to do nothing than include something that you must ensure you don’t necessitate in order to complete an objective; I don’t particularly support this thought, though, as I particularly enjoyed both of the examples I’ve given! Providing an ad-hoc mathematical rationale in a Twitch chat was, honestly, quite fun at the time (especially since I didn’t end up being the only one who tried to solve it), and I was on a Discord call with a friend at the time I stumbled across the Final Fantasy example which led to a fun aside as we discussed it for a short time. Yes, I’m particularly susceptible to nerdsniping, what of it?

However, both examples I’ve discussed thus far were very similar puzzles with very simple solutions. They didn’t particularly stretch any skills, nor did they have me reaching for my notes1, so whilst they did provide some sense of satisfaction for my mathematically-starved mind2, they did leave me wanting something… more.

Perhaps more egregiously, however, both examples were also still in a similar form to a maths exam question! They were prescribed, contrived questions seeking a singular response. I don’t think this is an unforgivable sin, personally, as I think there is some room for this form of recreational mathematics - there remains a level of creative expression in the fact that, given it is not a maths exam, the method taken to resolve the answer is completely up to the player. A simple question like this still retains some merit.

This thought sequence further led me down a rabbit hole of considering how games might incorporate more of this, however, and particularly more complex problems (ideally with some non-prescribed questions). How could this be done?

A detour: Atlus’ Persona series

An immediate thought that springs to mind is Atlus’ Persona series of video games, of which I’m very much a fan. These generally include classroom segments and pseudo-exams, whereby you are asked questions sometimes during class and providing a correct answer can increase a so-called “Social Stat”. These questions are possible to mostly ignore in newer incarnations, thanks to the network functionality (whereby you can see what everyone else chose, and it’s probably correct), or simply looking up a guide3.

Personally4, I think these would be a prime candidate for more complex direct maths problems. It’s even in the correct setting for a not-particularly-creative style of question: a school classroom!

Back on track

However, coming back to the point, it occurs to me that most games actually do provide some room for more interesting mathematics - and, indeed, it’s something I deal with occasionally with some of the games I play: buildcrafting, min-maxing, and optimisation!

All of these common activities in games stem from trying to optimise for some statistic, and especially when the game provides sufficient information, you can easily turn these into a maths problem for yourself to address; particularly with more complex build systems, you can end up resorting to much more traditionally-advanced fields of mathematics than any of the intentional maths puzzles in games that I’m aware of. In Destiny 2, for example, exactly this approach led to Ager’s Sceptre being deemed best in slot for DPS. This is a thing! Am I actually advocating for anything specifically to change in video games, now, then? Not really - we’ve just established they’re already a huge catalyst for recreational mathematics!

On that note, though: what if video games in general are a better medium by which to learn maths than traditional teaching methods? I personally wasn’t done a disservice by maths lessons (rather, I find the techniques taught in them a convenient shortcut for some of the tedium that I’d rather not care about, myself), but Lockhart’s Lament clearly expresses a general dissatisfaction with how maths is taught - and it’s certainly a view shared by many (and, to be honest, I certainly vibe with the views expressed in the Lament).

Oh, wait, Persona again?

All of this culminates in a conclusion that I didn’t expect to draw today, and which I’ve been wondering myself for a while now: my friends will happily tell you that I’m not a fan of making decisions. Choosing where to go eat? Uhh… Up to you! Deciding on a movie to watch? No thanks. You get the idea. This belies my views on Persona, however, as at its core - minus the dungeon-crawling part - the games are a sequence of constantly making decisions: who am I going to spend time with today? Should I work on a social link, or should I work on a stat tonight? If the latter, which one? This suddenly sounds like my worst nightmare made into a game, so why do I enjoy it so much‽

The answer, as this entire post has been about, is simple: maths.

Persona can be distilled into a very complicated matter of min-maxing and optimisation: what I should do today isn’t a decision, because it can be answered, clearly, with maths: which activity provides the best progress towards a character’s story, or an achievement, et cetera. You could, given all the information about when social links are available, and how many days you have in total, determine an optimal route through the game using an algorithm like Minimax. I don’t have all of that information to hand, but I can use what information I do have to basically reduce the decision to a maths problem - and those, I enjoy!

Thus is the conundrum solved, and the answer is maths. I’ve been turning my games into maths problems without explicitly realising it all this time.

Perhaps I should put more effort into buildcrafting at some point..?



Rather than manually rediscover all of mathematics; Lockhart may encourage rationalising about things from first principles, but I do opine that results you already know - whether by being taught or by discovering them prior - are fair game to just refer back to, and I interpret this as being consistent with Lockhart’s perspective on maths in a more general sense.


The idea that Computer Science is particularly tied to maths is, I find, egregiously misleading. I rather enjoy CS - it’s my particular field of expertise, which I practice both for hobby, career, and study, but I do not find that it scratches the itch that pure maths does at all. They are, fundamentally, two distinct (even if one is an applied form of the other) fields, in their own right.


I know that Polygon has one for basically every game I’m aware of.


Pun intended. Sorry not sorry.

Header image for this post is a screenshot from Persona 3 Reload © ATLUS © SEGA 2024.