Quaternity is a chess game online. The mechanics of the pieces follow that of regular chess. That’s it for the similarities! Because Quaternity brings a new chess experience to its users, being played on a 12×12 board and with 4 players.
When Quaternity approached us, they had an offline, physical version of the chess game and wanted to bring it online. We started with developing the back-end of the app, with a complex game engine at its heart. Later on, the whole front-end development was moved to Neoteric as well so we could take care of the platform development holistically.
There are many engines for 2-player chess online but no clear benchmarks when it comes to the 4-player games so everything had to be designed from scratch.
The main task was to build a rules engine for Quaternity and a computer-based player following these rules.
At this stage, the bot is not expected to be a good player – just good enough to occupy a seat at the table following the engine rules. In the future, it will be possible to choose a player of a certain level.
As the engine is the heart of the platform, it’s the frontend part that lets the users play and interact with it. Based on the delivered designs, we created the user interface.
With no existing engines for 4-players chess, it was necessary to write everything from scratch. Every rule of the game had to be taken into account and validated by the engine. The engine was supposed to suggest the possible moves, prevent users from making forbidden moves, and keep control over the time and the order of the moves.
The bot – known as a computer player – also needed to follow these rules, making it possible to play the game even without having 4 real players as opponents.
In the case of an online game, it’s not enough for the engine to work based on the set of rules. It needs to do it almost in no time so the users don’t experience any lags. That’s why the engine’s performance and efficiency were of the highest priority. Our goal was to validate moves in less than 0.5 seconds.
In order to support Quaternity’s business goals, the platform needed to scale to handle more games at the same time, with thousands of users playing simultaneously, and still keep high its performance and efficiency. The aim of the system was to be able to horizontally scale to 10k people.
One of the goals was to build a strong community of engaged users around Quaternity. In order to achieve this, we needed to provide users with different sorts of interactions – with real players who can be invited to join the game or with the bots – and enable running chess tournaments.
As there were no existing engines to integrate with, we developed a new one. The engine is based on a set of rules, both “standard” chess rules and the ones specific only to 4-players chess. With every change on the chessboard, it needs to validate the possible moves, suggest them to the user, block the forbidden moves – and do it in no time (0.5 seconds, to be precise) so that users do not experience any delays. Additionally, it controls the order of the moves and time limits.
The players can invite each other to join the game and if they don’t have enough people to start the game – a bot will join them.
The system that we created uses as many instances as required to handle all the games going on. When the traffic is lower, the number of used instances decreases. Thanks to that, the engine remains efficient even with thousands of chess games going on.
Before the official release, access to the platform was granted to those who have already played the board version of the game. As they already knew the mechanics of the game, the entry-level was relatively low for them.
To support the development of the game in a crowdfunding-like way, users can buy art tokens. The tokens will have their representation in the game – the players will be able to integrate their wallets with Quaternity and set the artworks as a background for the chessboard in the games they create.
The platform was already released and the feedback from users is positive. Among the players, there are even chess masters such as Alexander Morozevich – a Grandmaster, a two-time World Championship candidate, two-time Russian champion who has represented Russia in seven Chess Olympiads, winning numerous team and board medals. His Quaternity game stream was watched by over 4000 people.
The validation of moves responds in less than 0.5 seconds. With such a short engine response time, the users do not frustrate over the lags so they can fully focus on winning the game. What’s most important here, though, is that as we eliminated all the logical errors from the engine, the system itself does not affect the game and its final results.
The first four-player chess tournaments have been already hosted on the Quaternity platform.