![]() ![]() A downside to this is possible cheating in inspect elements. In the end, I created a global state object indexed with the game code for state management, and opted for client side computation to decrease load on the server. To solve this, I referred to online tutorials such as this and this to learn more about multiplayer games. Additionally, deciding between client-side computation and server-side computation was also difficult. The idea of maintaining states so a single server can allow a large amount of rooms was very difficult. When first designing the game, the flow of events was very challenging as this is my first game developed. It is also supported by a firewall allowing public access from VPS#1 to port 27017 Challenges I ran into Architecture Decisions This VPS was started from an image found on the Linode Marketplace. Lastly, the mongodb database is hosted on another Linode running Debian 9. The VPS above is attached to a custom domain from using the DNS manager. The backend is also hosted on the same Linode but with forever - an auto restart tool for NodeJS servers in an event of a crash. The frontend is hosted on a Nginx web server on Linode running Ubuntu 20.04 - provisioned from scratch. The following services from Linode are used: Tetris Rivals is entirely hosted on the cloud using the Linode's suite of services. Once all the clients leave the room, it clears the state and deletes the code for future reuse. After any update to the game state, all (both) clients in the game room are notified and respectively update their UI. These events (and more) continuously update the collection of game states stored at all times on the server. It actively listens to key game events such as: This is accomplished through generating random 6 digit codes, storing them in a database, and listening/emitting events to sync all players. The server is responsible for generating game codes, managing game state, and maintaining game rooms. ![]() It keeps a channel open for communication while still offering security. ![]() The web socket communication protocol is better suited for real-time data transfer over the https protocol. The backend is a NodeJs server which operates on Socket.IO and MongoDB to implement web sockets. Socket.IO client implementation for real-time updates.Client side computation to alleviate server load and reduce costs.Game logic and construction (collision, validity, line clears, animation and opponent tile substitution).All of this is powered by several JS files which handle the application logic. Additionally, it has 2 CSS files responsible for the styling and the responsiveness of the application. It consists of an index.html which renders both the home screen, and the game room (more on that in challenges). The frontend is built entirely from vanilla HTML, CSS, and JavaScript. The introduction of new mechanics guarantee everlasting entertainment!.A single strategy is useless due to the constant variability.Just before he places it, you turn it into a square and declare war.You notice your opponent is about to clear 4 lines with the line tile.The game starts on a larger board giving you more time and freedom.Ability to make 1v1 rooms with friends or queue in solo to make new friends.No email | No Account | No data - Hassle free play.A true multiplayer experience with the OG sound tracks.Here's what Tetris Rivals brings to the table: You repeat the best strategy, keep winning, and get bored.Your opponent might not even be playing, but you have no time to focus on silly details.The game starts and you're furiously bringing down tiles.Here's an outline of what happens in the classic game: Tetrisrivals.tech What it does differently In the spirit of bringing back the classic arcade games with a new twist for Hack-Cade, I decided to create the true multiplayer Tetris. Since that only requires you to focus on your game and play fast, it essentially becomes a single player game. The goal in competitive play is to outlast or score higher than your opponent. Aesthetical changes, tweaking the board size, and most importantly, the popularized multiplayer mode for competitive play. Since 1984, the original Tetris has gone through several iterations. My interest for combining unrelated features and innovating in unexplored directions helped me to create Tetris Rivals. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |