- CODE REPORT -

09

Tenbin - Alice in Borderland

A 5-player mini-game inspired by a TV show on Netflix. (今際の国のアリス)

Sep 2023

Try it now (Google Play, preferred)

Try it now (iOS TestFlight)

What's so special about Tenbin?

What can be improved?

Technologies


My plan was to try out different programming languages and frameworks while doing this project and work out how to make a multiplayer game. The main gameplay this time is arguably simple, just receiving the guesses and calculating the average. However, the challenge actually comes in communicating via WebSocket. Traditional REST APIs should not be used for real-time communication like this. WebSocket requires ping and pong messages to be exchanged at a fixed interval while handling the main gameplay. This is calling for a lot of asynchronous code. Luckily I can still handle it with what I have learnt from my Concurrent Programming lectures. Another difficulty is to keep the server up when a player disconnects from the game at any possible moment. I typed my JavaScript backend as I heard that the backend of a project has to be more robust. I am also amazed how ExpressJS can be used as a proper server without having a frontend like I usually do in the past.

Source code (ExpressJS TypeScript backend)

Source code (Python CLI frontend for testing)

My main requirement for the frontend is the ability to compile into an Android app. After writing the Python CLI frontend for testing my backend, I am too lazy to switch to another language. Therefore Kivy became my choice. I kind of regret it to be honest because the community support is quite little in my opinion. I hit a lot of obstacles especially when building the app into executables and apks. But at least it works so I probably should not complain too much about it.

Source code (Kivy Python frontend)

Game Rules


TL;DR Just choose a number between 0 and 100 each round and have fun. :)

Every player chooses a number between 0 and 100 in each round. The player closest to the target wins the round. The target would be the average of the numbers multiplied by 0.8.

All players start with 0 points. If a player reaches -5 points, it is a GAME OVER for that player. The last person standing wins.

A new rule will be introduced for every player eliminated.