An Excel Game

Hackathons are a regular way that software engineers let their hair down and show off their ideas and technical prowess. Actuaries can code too, right? Well, though we don’t hold a candle to software engineers, we do at least have VBA and Excel Formulae. Last Christmas I decided to try to make a game in excel, and this is how it went.

The Idea

I was inspired by the grid system of cells that many actuaries stare at all day long. I saw this lending itself to a grid-based “dungeon crawler”. The challenge was that how do you signal to the user that a character is in a particular cell? The answer is Unicode.

Unicode is a standard for text and symbols. This includes, but is not limited to, Latin letters, Arabic numbers, Greek symbols, and chess pieces. I had this idea that the player could play as the King or the Queen searching for their lost companion.

It was important that the game could be replayed, which led to the necessity that the map would randomly generate upon a new game. This meant that I had to write some code to draw a map. The method I chose was to place the two companions randomly on the 100x100 board, and then random walk a Path until it reached the companion. I had to ensure that the path didn’t leave the 100x100 board.

The Product

The game presents the player with up, down, left and right buttons to move their character through the dungeon. There is a new game button to regenerate the map, select your character and the companion, and start some ambient music from YouTube.

The player can see a 5x5 grid with their character in the centre, the aim is for them to move through the dungeon until they find their companion, which triggers a win.

The player moves through the dungeon, walking along the path until they stumble upon their lost companion. A final message appears when they reach their companion, congratulating the player on completing the game.

The Limitations

Games are meant to be fun – I would say that I succeeded in the initial base design, however the slow nature of macros, and the lack of stakes keeps the game from feeling fun.

I have started designing skeleton pieces that will move towards the player if seen, causing damage to the player if caught or cornered. The idea would be to hide a sword that will allow the player to pass these enemies, however with a randomly generated map, the logic to ensure that the sword is always available to the player character ahead of any enemies is complex.

Though there is ample opportunity to add features that may improve the players experience, the problem of efficiency is a bigger problem. Often it can take up to a second for the player to move a square. This is one of the big hurdles with creating a game in excel through macros.

The Challenge

I have been successful in creating “something” in excel, whether it can be considered a game or not is up to the player. I’d be happy to share a copy of the game, so please contact me if you are curious.

My challenge to you is to try making a game in Excel or some other innocuous business software that you use daily. I found this exercise a great way to practice my coding in a fun setting. Let me know if you have any ideas, products or challenges you come across on your own personal hackathon.

Next
Next

Bespoke, Or Not to Be