Assignment 2: Real-time network multiplayer game

Due date: 7 14 October, 2022

Introduction

Multiplayer online gaming is one of the most popular forms of entertainment in the world. Games like Counter-Strike, World of Warcraft, Minecraft, and so on allow multiple players to connect to a game server over the network and making their moves simultaneously to compete or cooperate in a shared game world.

In this assignment, you must develop such a real-time multiplayer game that can be played over the network. The gameplay must be real-time, meaning that the players should be able to make moves simultaneously instead of waiting in turns. It must support at least two players at the same time; whether you support more than two players is up to you. Finally, the players must be on different machines, with their copy of the game communicating with the server over the network.

The choice of game is totally up to you. Some ideas you can consider are multiplayer versions of Snake, Tetris, Agar.io, etc., though you are welcome to do anything else. Note that the updates in the game world must be controlled by the server, i.e. the player client should communicate its actions to the server, and the server should make the corresponding changes to the world, handling any potential conflicts due to asynchrony (e.g. trying to pick up an item that another player has just taken). The code can be written in any language of your choice, and the client application can be a desktop application or browser-based.

Requirements

  1. You must create a library that contains the code to be shared commonly by the client and server, such as the representation of the game world and the operations on it. This library must be separate from the client and server application code.
  2. The clients and the server must be on different machines, communicating with each other over the network. You may have the player enter the IP address of the server to connect to it.
  3. The game may be of any type, whether competitive or co-operative, but it must have some scope of players interfering with each other in real time. For example, two players contending for the same item, or one player getting blocked by the movement of another.
  4. The clients and the server must be able to deal with the above conflicts arising due to asynchrony among multiple players. The server should resolve these conflicts and act as the ultimate authority of the game state, and the occurrence of such conflicts not break the gameplay.
  5. Create a report explaining the design of your system with flowcharts and diagrams. Include screenshots of the game in the report. Describe the software architecture followed along with the reasons and benefits. Your marks will depend not just on the functionality of the application but also on code modularity and software architecture.
  6. Complete any 3 of the 4 additional requirements mentioned on the course webpage.

Additional requirements for groups with three students

Three-member teams should put in more effort to design a networking system (i.e. “netcode”) that allows a smooth experience even for players with high-latency connections.

  1. Add a client-side option to simulate a high-latency connection to the server, for example by delaying the sending of each message to the server, and delaying acting on each message received from the server.
  2. Use a rollback approach (see the Wikipedia article) so that the client does not have to wait for a response from the server before acting on user input, thus a high-latency player still sees their own controlled characters/objects as perfectly responsive.

Submission Instructions

List all of the resources you have used in the report. Any plagiarism will be grounds for severe penalties.

Submit a zip file with name <entry_numbers_of_members_separated_by_underscores>.zip to the Moodle site for this course. The zip file should contain the entire code, as well as the report containing the architecture details and screenshots from the project. Only one member should make the submission for the whole group.

Grading Policy