Gaming —

How an accountant created an entire RPG inside an Excel spreadsheet

Arena.Xlsm puts macros to work for leveling, battling, and collecting items.

A communique from the emperor, above, expresses interest at my formidable skill in killing bunnies and koalas with rocks.
A communique from the emperor, above, expresses interest at my formidable skill in killing bunnies and koalas with rocks.

It's not always easy (or possible) to install your favorite games on your work computer. Sometimes a bit of Solitaire or some collaborative Bomberman might be all you can manage—and it had better look like work to any nearby screen snoopers.

Over this past winter, Cary Walkin created the perfect solution to this problem: an entire RPG made of a spreadsheet and many macros. The game, called Arena.Xlsm, is a turn-based RPG encompassed entirely in an Excel file. Players can progress through levels, collect items, and battle enemies and bosses with melee and ranged attacks as well as spells.

As the game carries on, the hero finds new items to equip to bash on/lance at enemies.
Enlarge / As the game carries on, the hero finds new items to equip to bash on/lance at enemies.

While the game isn't a beauty to look at—the hero is represented by a smiley face and all enemies are all bracket-parenthesis pairs—it's fairly complex for, well, a spreadsheet. Attacks include a range of damage-inducing and healing spells that players buy and use with "blood," which regenerates with each turn. Players also find and can equip a range of weapons, including rocks, slingshots, bowling balls, rifles, ninja stars, and brass knuckles.

The game also engages in some light borrowing of characters and elements from other fictional universes. Players start off fighting bunnies and bees but quickly progress to vampires, ghosts, and dragons. The need to physically click on arrows to navigate around the screen can be a little bit cumbersome, but if your job is most easily simulated by a lot of clicking, your cubicle-mates may never notice a difference.

Instructions for the game come wrapped in letters from your presumed significant other, with whom you have a son. Kylem is unusually knowledgeable.
Enlarge / Instructions for the game come wrapped in letters from your presumed significant other, with whom you have a son. Kylem is unusually knowledgeable.

The whole game is driven by an anachronistic story involving the hero's battle through an emperor's arena of monsters. As he progresses, he gets letters from his wife, Kylem, who talks about their son going to school, the police, and mercenary messengers. We can't say much for Kylem's exposition style ("The police came to the house today... They completely ransacked the house... Obviously I can't go to the police to report this") but she knows a suspiciously large amount of info about the abilities and attacks of the monsters our hero encounters. She guides you throughout the game.

In a Reddit Ask Me Anything (AMA) session with Walkin, he said that he decided to use Excel due to his extensive knowledge of the program (Walkin is an accountant by trade). “There is an old adage that underneath every RPG is a massive spreadsheet, so now the massive spreadsheet IS the RPG!” Walkin wrote.

Some players noted in the AMA that the macros in the spreadsheet are password-protected, so it’s impossible for players to tweak the game themselves. Walkin said that this was partially due to the code not being as tight as it could be, stating it’s “actually quite embarrassing.”

In response to requests, Walkin has released some code snippets that he hopes are clean enough for others to tinker with, but he still received plenty of feedback on how the code could have been better. Below is a variant of a subroutine for moving and collision detection that Walkin published on his blog:

Sub MoveLeft()

Range(PlayerCell).Activate
If (ActiveCell.Offset(0, -1).Range(“A1″).Formula = “XX”) Then

Else
Selection.ClearContents
ActiveCell.Offset(0, -1).Range(“A1″).Select
ActiveCell.FormulaR1C1 = “:)”
PlayerPositionColumn = PlayerPositionColumn – 1
PlayerCell = Cells(PlayerPositionRow, PlayerPositionColumn).Address

End If

End Sub

He notes that four of these subroutines are required for all directions of movement, but it would be possible to have eight in total to incorporate diagonal movement as well. In the published game, players can only move in four directions but can attack and be attacked by enemies across diagonally adjacent tiles.

A few users expressed concern that the macros were locked, preventing would-be players from verifying that the .xlsm file contains no malware. Walkin stated that he understood the concern, but said that he had put his name all over the game and that the version hosted on his own site was the only one he could promise the integrity of (other versions have popped on new hosts). Others wrote that locking the macros was good practice to keep the game working, but that the source code should still be available.

Since its original release, Walkin has released version 1.1 with bug fixes. One fix is that—spoiler alert—Alec Trevelyan (originally James Bond's colleague-turned-nemesis in Goldeneye) manages to restore his energy after dying. He will now die when killed regardless of whether he is exhausted. Sounds like canon to us.

Channel Ars Technica