Four in a Row
A beautiful redesign of the all-time classic game four in a row! With online multiplayer, local play, CPU battle, and much more.
Available for Android and the web: play.fourinarow.ffactory.me.
The perfect game to lighten up boring hours - challenge your friends or play world wide.
# Features:
- Online multiplayer
- Collect points (SR) by winning ranked games
- Two players on one device
- CPU Battle
- (in development) change the game’s theme
- Add your friends and challenge them
- Check out the leaderboards to find out who’s the best (in development)
- Chat with anyone while waiting for a match
When I was in school, I used to play four in a row with a friend of mine. We kept our scores and were pretty even. During the first lockdown in April of 2020, I found myself with a lot of time to spare and started programming a version of Four in a Row with Flutter. First offering local versus, later expanding it to online multiplayer and adding extra features, like accounts, friends, CPU battle, chat and more.
You can check out the homepage at fourinarow.ffactory.me.
# Development
Four in a row was my first “big” project, but it started out very small. In the beginning there was only the game board and you’d take turns playing on one device. Step by step, I expanded it with more features and whenever I noticed that the current data structure / architecture was not working, I rewrote large parts of the app to improve it. This took a lot of time, effort, and careful thinking. These failed attempts led to the project’s architecture you can see today.
One example is the reliable online multiplayer. I created a very simple version first, but noticed that I often lost my connection, which caused the game to end for both players. To solve that, I came up with the idea to wrap each network message in a numbered package and re-send it when the connection was interrupted. This was inspired by the way TCP works.
Publishing a game on the Play Store and getting >5000 downloads taught me a lot:
- Mobile development: advanced state handling, animations, UI/UX design.
- Ensuring stable connections (reconnection handling).
- Creating a fast, authoritative game server in Rust.
- CI/CD to improve my own developer experience.
- Launching an app and listening to user feedback.