Games and life

Yesterday, July 25, was a big day. Ironhide Games released the long-awaited fifth edition of their tower-defence game ‘Kingdom Rush’. I bought it as soon as it launched and completed its primary campaign in one sitting of several hours. Called ‘Alliance’, the game combines the gameplay of ‘Kingdom Rush: Vengeance’ and Ironhide’s ‘Junkworld’, together with aspects of ‘Legends of Kingdom Rush’. The game also continues a long storyline that began with the first ‘Kingdom Rush’ game, released in 2011, and last updated in ‘Vengeance’. For what it’s worth, it’s a good story, too.

In ‘Kingdom Rush: Origins’, Ironhide introduced Vez’nan as a powerful wizard who becomes corrupted by a gem called the Tear of Elynie to become a malevolent power threatening the kingdom of Linirea. In the games that followed, heroes and towers from several parts of the kingdom, ultimately including King Denas, were tasked with defeating Vez’nan and his allies. In ‘Vengeance’, Vez’nan returned to exact revenge against King Denas — or so it seemed. ‘Alliance’ describes Denas’s return as well as Vez’nan’s efforts against a greater evil called the Overseer, who is also the ultimate boss in ‘Legends of Kingdom Rush’.

A screenshot from the game 'Kingdom Rush: Alliance'.
A ‘Kingdom Rush: Alliance’ skirmish begins…

I love tower-defence games and among them ‘Kingdom Rush’ is my favourite by far. I own all editions of it as well as have unlocked most towers and heroes in each one. At more than a few points during a work day, I like to break one of these games out for a quick and hairy skirmish or — time permitting — a full-on campaign on a high difficulty setting.

But while I like to play as often as I can, tower-defence doesn’t fit all moods. I have 13 games on my phone: the five ‘Kingdom Rush’ games, ‘Junkworld’, ‘Monument Valley’ I and II (and the expansion packs), ‘Loop’, ‘1010!’, ‘Idle Slayer’, ‘Rytmos’, and ‘Lost in Play’. They’re all great but I’d single out ‘Idle Slayer’, ‘Loop’, and ‘Monument Valley’ for particular praise.

‘Idle Slayer’ is a top-notch incremental game (a.k.a. idle game): the game will continue irrespective of whether you interact with the player-character, the player-character can’t perish, and gameplay is restricted to tapping on the screen to make the character jump. The whole point is to slay monsters — which the character will if she/flies runs into them, automatically pulling out an omnipotent sword when she gets close — and collect slayer points and to pick up coins and gems, which the character also does if she runs/flies into them. ‘Idle Slayer’ thus eliminates the player (you, me, etc.) having to be challenged in order to reap rewards. It’s just a matter of time, although occasional bursts of speed and character abilities purchased with slayer points can make things exciting.

I agree with what journalist Justin Davis wrote in 2013:

“Idle games seem perfectly tuned to provide a never-ending sense of escalation. They’re intoxicating because upgrades or items that used to seem impossibly expensive or out of reach rapidly become achievable, and then trivial. It’s all in your rearview mirror before you know it, with a new set of crazy-expensive upgrades ahead. The games are tuned to make you feel both powerful and weak, all at once. They thrive on an addictive feeling of exponential progress.”

Right now, this is where I’m at: 209 decillion coins in my kitty and racking up 110 octillion coins per second, plus whatever I pick up as I keep running…

A screenshot from the 'Idle Slayer'.
My player-character is named Mintana. She’s awesome.

Second is the amazing ‘Loop’, an endless series of puzzles in each of which your task is to link up some open-ended elements on a screen such that they form a large closed loop. You can tap on each element to rotate it; when the open ends of two elements line up in this way, they link up. The game is minimalist: each level has a plain monotone background and elements of a contrasting colour, and there’s beautiful, low-key instrumental music to accompany your thoughts. ‘Loop’ is the game to get lost in. I’ve played more than 3,500 levels so far and look forward every day to the next one.

A screenshot from the game 'Loop'.
The two rings in the bottom-left corner are linked up.

Third comes ‘Monument Valley’, but in no particular order because it’s the game I love the most. I don’t play it as often as I play ‘Kingdom Rush’, ‘Idle Slayer’ or ‘Loop’ because its repeatability is low — but it’s the game that redefined for a younger and less imaginative me what a smartphone product could look and feel like when you play it. ‘Monument Valley’ is an ode to the work of the Dutch artist MC Escher, famed for his depiction of impossible objects that toy with the peculiarities of human visual perception. The player-character is a young lady named Ida navigating a foreboding but also enchanting realm whose structures and vistas are guided by the precepts of a mysterious “sacred geometry”. The game’s visuals are just stunning and, as with ‘Loop’, there’s beautiful music to go with. The objects on the screen whose geometries you change to create previously impossible paths for Ida take time to move around, which means you can’t rush through levels. You have to wait, and you have to watch. And ‘Monument Valley’ makes that a pleasure to do.

A screenshot from the game 'Monument Valley' II.
Unobtrusive pink, lush green, obsidian black.

It should be clear by now that I love puzzles, and ‘1010!’ is perhaps the most clinical of the lot. It’s Tetris in pieces: you have a 10 x 10 grid of cells that you can fill with shapes that the game presents to you in sets of three. Once you’ve placed all three on the grid, you get the next three; once a row or a column is filled with cells, it empties itself; and once you can no longer fit new shapes in the grid, it’s game over. ‘1010!’ takes up very little of your cognitive bandwidth, which means you have something to do that distracts you enough to keep you from feeling restless while allowing you to think about something more important at the same time.

A screenshot from the game '1010!'.
What does losing mean if you can never win?

‘Rytmos’ and ‘Lost in Play’ are fairly new: I installed them a couple weeks ago. ‘Rytmos’ is just a smidge like ‘Loop’ but richer with details and, indeed, knowledge. You link up some nodes on a board in a closed loop; each node is a musical instrument that, when it becomes part of the loop, plays a beat depending on its position. Suddenly you’re making music. There are multiple ‘planets’ in the game and each one has multiple puzzles involving specific instruments. You learn something and you feel good about it. It’s amazing. I’ve only played a few minutes of ‘Lost in Play’ thus far, and I’m looking forward to more because it seems to be of a piece with ‘Monument Valley’, from the forced-slow gameplay to the captivating visuals.

A screenshot from the game 'Lost in Play'.
A scene from ‘Lost in Play’.

Aside from these games, I also play ‘Entanglement’ in the browser and ‘Factorio’ on my laptop. ‘Factorio’ is the motherlode, an absolute beast of a game for compulsive puzzle-solvers. In the game, you’re an engineer in the future who’s crash-landed on an alien planet and you need to build a rocket to get off of it. The gameplay is centred on factories, where you craft the various pieces required for more and more sophisticated components. In parallel, you mine metals, pump crude oil, extract uranium, and dig up coal; you smelt, refine, and burn them to get the parts required to build as well as feed the factories; you conduct research to develop and enhance automation, robotics, rocketry, and weapons; you build power plants and transmission lines, and deal with enormous quantities of waste; and you defend your base from the planet’s native life, a lone species of large, termite-like creatures.

I’ve been playing a single game for three years now. There’s no end in sight. Sometimes, when ‘Factorio’ leaves me enough of my brain to think about other things, I gaze with longing as if out of a small window at a world that has long passed me by…

A screenshot from the game 'Factorio'.
[Polyphonic robot voice] This facility mines copper ore, smelts it to copper plates, and feeds it to factories that make copper cables.

The thing about π

Consider the following setup, from the game ‘Factorio’, the game about factory management and automation:

There are two factories visible in this image – the two rectangular, green-walled buildings. Take the one on the left: it’s manufacturing electric furnaces, with steel plates, stone bricks and advanced circuits as ingredients. These three resources are visible on conveyor belts leading up to the factory (top, left, bottom resp.), terminated by blue and green inserters that move the objects from the belts to the factory floor.

In order to maintain a steady supply of electric furnaces, I need to keep the ‘resource pressure’ up. Think of it like a strong wind blowing against your window: even if you opened the window just a little, there’s enough air pressing on that side of the wall for a lot of it to flow into your room. Similarly, I need to make sure sufficient quantities of steel, stone bricks and advanced circuits are available whenever the factory needs it. And within Factorio, as in the real world I imagine, maintaining this resource pressure isn’t easy.

Even if we assume that all the raw materials for these ingredients are available in infinite quantities, the time taken to transport each resource, manufacture the required parts and then move them to the factory takes a different amount of time. And in the factory itself, each electric furnace consumes different quantities of each ingredient: 10 steel plates, 10 stone bricks and five advanced circuits). As a result, for example, if I maintain all three resources with equal pressure on the factory, I will still run out of steel plates and stone bricks faster than I will run out of advanced circuits.

In fact, I will run out of steel plates first because its crafting time is 32 seconds, versus 3.2 seconds for one stone brick. So the proper pressure to maintain here is P for advanced circuits, 2P for stone bricks and 20P for steel plates. (I’m ignoring the crafting time for advanced circuits to keep the example simple.) If I don’t keep up these proportions, I won’t have a steady supply of electric furnaces. Instead, I’ll run out of steel plates first, and by the time more plates are available, stone bricks will have run out, and by the time stone bricks are available, advanced circuits will have run out. And so on and on in a continuous cycle.

The concept of orbital resonance is somewhat similar. Did you know that for everyone two orbits Pluto completes around the Sun, Neptune completes three? This is the 2:3 resonance. And it’s comparable to the Factorio example in that the ratio between the two periodic activities – Neptune’s and Pluto’s revolution and the rate of repetitive consumption of stone bricks and advanced circuits – is a rational number. ‘Rational’ here means the number can be expressed as the ratio of two integers.

Animation of planets in a 2:1 resonance. Credit: Amitchell125/Wikimedia Commons, CC BY-SA 4.0
Animation of planets in a 2:1 resonance. Credit: Amitchell125/Wikimedia Commons, CC BY-SA 4.0

With Pluto and Neptune, it’s 2/3 of course, but in a more intuitive sense, the implication is that if you wait for long enough, you will be able to count off the number of times the orbital resonance plays out – i.e. the number of times both planets are back to their starting positions at the same time, which would be once every two Plutonian revolutions or once every three Neptunian revolutions.

Similarly, the resource-pressure resonance plays out once every 10 stone bricks or once every five advanced circuits are consumed.

This meta-periodicity, a term I’m using here to refer to the combined periodicity of two separately periodic motions, allows us a unique opportunity to understand how bizarre the number known as π (pi) is. π is an irrational number: there’s no way to express it as the ratio of two integers. (The following portion also applies to e and other irrational numbers.)

In ‘Factorio’, all resources are integral, which means there can only be 1, 2, 3, … stone bricks, and never 1.5, 2.25, 3.75, etc.; the same constraint applies to advanced circuits as well. So there is no way for me – no matter how I align my resource extraction and processing chains – to ensure that for every advanced circuit, an integer-times-π number of stone bricks are consumed as well. I can alter the length of the supply lines, increase or decrease the ‘normal’ processing time, even use faster/slower conveyor belts and inserters for different ingredients, but I will never succeed. So long as the quantities in play remain integers, there’s no way for me to achieve a resonance such that the ratio of its terms is π.

This is what makes π so beautiful and maddening at once. It exists on terms that no two integers can recreate by themselves.

There’s another way to look at it. Say two planets begin orbiting their common host star from the 12 o’clock position in their respective orbits. If they are in a π:1 resonance, they will never be exactly at the 12 o’clock at the same time ever again. It doesn’t matter if you wait a century, an epoch or forever.

This example offers to my mind an uncommon opportunity to understand the difference between attributes of π and ∞. There’s the oft-quoted and frankly too prosaic statement that π’s decimal places extend infinitely. I prefer the more poetic: that efforts using simple mathematical combinations of integers will never create π. Even if a combination operates recursively, and each cycle produces a closer approximation of π, it can run for ∞ time and still not get here.

Like there’s an immutable barrier between two forms of unattainability.

A future obscured by exponential growth

A couple months into the COVID-19 pandemic, I think most of us realised how hard it is to comprehend the phenomenon of exponential growth. Mathematically, it’s trivial – a geometric progression – but more physically, the difference between linear and exponential growth is very non-trivial, as a cause-effect chain where each effect leads to multiple new cases according to a fixed growth ratio. The effect is an inability to fully anticipate future outcomes – to prepare mentally for the ‘speed’ with which an exponential series can scale up – rendered remarkable by us not having planned for it.

For example, the rice and chessboard problem is a wonderful story to tell because it’s hard for most people to see the punchline coming. To quote from Wikipedia: “If a chessboard were to have wheat placed upon each square such that one grain were placed on the first square, two on the second, four on the third, and so on (doubling the number of grains on each subsequent square), how many grains of wheat would be on the chessboard at the finish?” The answer is 18,446,744,073,709,551,615 – a 100-million-times greater than the number of stars in the Milky Way. Many people I know have become benumbed by the scale of India’s COVID-19 epidemic, which zipped from 86k active cases on May 30 to 545k on July 31, and from 1M total cases on July 17 to 7.3M on October 15. On August 1, 1965, Vikram Sarabhai delivered the convocation address at IIT Madras, which included the following quip:

Everyone here is undoubtedly familiar with the expression ‘three raised to the power of eighteen’. It is a large number: 38,74,20,489, thirty-eight crore, seventy-four lakh, twenty thousand, four hundred and eighty-nine. What it means in dynamic terms is quite dramatic. If a person spreads gossip to just three others and the same is passed on by each of them to three others, and so on in succession, in just eighteen steps almost the entire population of India would share the spicy story.

Because of its mathematical triviality and physical non-triviality, I think we have a tendency to abstract away our impression of exponential growth – to banish it out of our imagination and lock it away into mathematical equations, such that we plug in some numbers and extract the answers without being able to immediately, intuitively, visualise or comprehend the magnitude of change, the delta as it were, in any other sense-based or emotional way. And by doing so, we are constantly surprised by the delta every time we’re confronted with it. Say the COVID-19 epidemic in India had a basic reproductive number of 1.4, and that everyone was familiar with this figure. But simply knowing this value, and the fundamental structure of a geometric progression, doesn’t prepare people for the answer. They know it’s not supposed to be N after N steps, but they’re typically not prepared for the magnitude of 1.4^N either.

I recently came across a physical manifestation of this phenomenon in a different arena – technology – through a Twitter account. The oldest Homo sapiens technologies include fire, tool-making, wheels and cropping. But while the recursive application of these technologies alone may have given rise, in a millennium (i.e. 1,000 steps), to, say, a subsistence agriculture economy with some trade, that’s not what happened. Instead, two other things did (extremely broadly speaking): the technologies cut down the time required for different processes, and which subsequently came to be occupied by the application of these technologies to solve other problems. The geometric-like progression that followed exponentiated not the technologies themselves but these two principles, of sorts, rapidly opening up new methods and opportunities to extract value from our surroundings, and eventually from ourselves, to add to the globalising value chain.

To get a quick sense of the rapidity of this progress, check out @MachinePix on Twitter. Their latest tweet (as of 11 am on October 17) describes a machine that provides a “motion-compensated” gangway for workers moving between a ship and an offshore wind turbine; many others depict ingenious contraptions ranging from joyously simple to elegantly complicated – from tape-dispensers and trains windows that auto-tint to automated food-packaging and super-scoopers. There’s even a face-mask gun that seems to deliver an amount of pain suitable for anti-maskers.

But closer to the point of this discussion: taken together, @MachinePix’s tweets demonstrate the extent to which we have simplified and/or automated different processes, and the amount of time humans have collectively saved as a result. This, again, can’t be a straightforward calculation: we don’t just apply the same technologies over and over to perform the same tasks. We also apply technologies to each other to compound or even modify their effects, effectively leading to new technologies and, thus, new applications – from the level of toothbrush plus toothpaste to liquefaction plus rocket engines. The tools we develop also alter the structure of society, which in turn changes aspirations and leads to the birth of yet more technologies, but ordered along different priorities.

In the last few months, I learnt many of these features in an intimate way through Factorio, a video-game that released earlier this year. The premise is that your spaceship has crashed on an alien planet, with many of the same natural resources as Earth. You now need to work your way through a variety of technologies and industrial systems and ultimately build a rocket, and launch yourself off to Earth. The ‘engine’ at the game’s centre, the thing that drives your progress, is a recipe-based manufacturing system. You mine resources, process them into different products, combine them to make components, and combine the components to make machines. The machines automate some or all of these processes to make more sophisticated machines and robots, and so forth. To move objects, you use different kinds of inserters and conveyor belts; for fluids – from water to lubricant – there are pipes, tanks, even fluid wagons attached to trains.

A zoomed-out scene from Factorio. This is ‘Main Station’, one of five bases I operate in this scenario.

I’m still finding my way around the extent of the game; the technology tree is very high and has scores of branches. The scenario I’m currently playing goes beyond a rocket to using satellites, but doesn’t include the planet’s alien creatures, who attack your base if you antagonise them or pollute too much. I often think it would’ve been much better to allow final-year students of mechanical engineering (which I studied) to play this game instead of making them sit through hours of boring lectures on logistics, quality control, operations research, supply-chain management, etc. Factorio doesn’t set out to teach you these things but that’s what you learn – and on the way, you also discover how easy it is for things to get out of control, become too complicated, too chaotic – sometimes just too big to fail.

Sometimes, you’ve invested so much in developing one technology that you’re unable to back out, and you start to disprivilege other ambitions in favour of this one. This happened to me recently: being hell-bent on building nuclear reactors to keep up with the demand for power, I had to give up on building a satellite.

Instead of a linear or even a tree-like model of technology development, imagine a circular one: at the centre is the origin, and the circumference is where you are, the present (it’s not a single point in space-time; it’s multiple points in space at one time). Technologies emerge from the origin and branch out towards the perimeter in increasingly intricate branches. By the time they’ve reached the outer limits, to where you are, you have nuclear power, rocketry, robotic construction networks and high-grade weapons. But in this exponentially interconnected world, what do you change and where to effect a difference somewhere else? And how can you hope to be sure there won’t be any other effects?

My new favourite example of this, from the few-score @MachinePix tweets I’ve scrolled through thus far, is the rotary screen printer. It shows, among many other things, that there’s a second way in which exponential growth disrupts our ability to predict its outcomes. Could a fantasy writer working all those millennia ago have predicted this device’s existence? They may have, they may have not, just as we contemplate what the future might look like from today, but sometimes presume to anticipate – even though we really can’t – the full breadth of what lies in store for humankind. Can we even say if the rotary screen printer will still be around?

Featured image: An artist’s rendering of spaceships hovering above a city. More importantly, this image belongs to a genre quite popular in the 2000s, perhaps the late 1990s too, when image-editing software wasn’t as versatile as it is today and when the internet was only just beginning to democratise access to literature and videos, among other things, so the most common idea of first contact looked a lot like this. Credit: Javier Rodriguez/pixabay.