Snake 99

99 snakes battle in the arena until only one is left crawling

Featured image

In 2019, Tetris 99 was released for the Nintendo Switch. It was a very fun multiplayer Tetris game where you competed against 99 other players until only one was left. That game made me wonder if any other classic games could use the same battle royale style. Snake made perfect sense for this in my mind.

At the time, I was experimenting with same-screen multiplayer technologies where all of the players were in the same physical location, connecting to the same game instance and controlling their characters using their phones. I came across a multiplayer system called Happy Fun TImes which promised to handle exactly the sort of game I was trying to build for Snake 99.

placeholder

The Build

I did some quick prototyping with the Happy Fun Times javascript library to ensure that the network performance was good enough for a fast-paced game like Snake. The way Happy Fun Times works is that all of the players connect to the same WiFi endpoint and send messages via WebSockets. Interestingly enough, the latency was fairly minimal on a decent WiFi connection. According to the documentation, the number of players that can be supported is limited by the networking hardware and bandwidth.

Once satisfied with the prototype, I started building out the core of Snake using Phaser. I had a little bit of prior experience building Snake, so this part didn’t take too long. The bulk of the work was in integrating the Happy Fun Times library and converting single-player Snake into a multiplayer battle royale game. Players were able to connect to the game by joining the same WiFi endpoint and navigating to happyfuntimes.net on their mobile browsers.

placeholder

There were some core features that I wanted the game to have such as power-ups, different play modes, and multiple control schemes.

For the power-ups, I implemented the following:

These randomly spawn around the play area and players need to eat them to trigger their effects.

The play modes I wanted to support were Domination Mode, where the longest snake wins, and Deathmatch Mode, where the player with the most kills wins.

Finally, the three control methods I implemented for the game were the Directional Pad, Joystick, and Swipe Gestures.

placeholder

The Problems

While the Happy Fun Times javascript library worked very well and was critical for the core of this project, unfortunately, it was deprecated shortly after by the developer on GitHub. This means it will no longer be supported by the developer and may break in the future. Additionally, the happyfuntimes.net rendezvous server will likely not be available at some point which will prevent players from being able to connect to the game using this method.

This means I may need to revisit this project at some point to replace the Happy Fun Times functionality if it breaks.

The Result

All of the above was implemented in a few days and then presented to a group of visiting students at Teleios Systems as part of a “what we do at Teleios” segment. It was very well-received and quite fun to play. The game is free to download on itch.io here. Grab the game and try it out with your friends!

placeholder