Introduction

You have been shown a naive implementation of a massively multi-player Space Battle game. In this assignment, your task is to improve the implementation so as to improve the efficiency of the server and to reduce the number of messages sent using interest management. For extra bonus, you can improve the scalability of the server by using multiple servers while maintaining a seamless world.

Team

You should work in a team of two for this assignment. You can choose to keep the same team as your Assignment 2 if you wish to.

Deadline and Submission

Zip up a copy of your code (without node_modules subdirectory) and your assignment report in PDF format into a single zip file named
A01234567X-A9876543Y-A3.zip (replace A01234567Y and A9876543Y with your own matric number) and upload it into IVLE workbin, before 18 April 2015 (Saturday), 11:59pm.

Your Task

First, pull the latest copy of the git repo https://github.com/weitsang/nus-cs4344.git. The naive implementation is available under the a3 subdirectory. Read through the code to understand what is going on. The code should be self explanatory with comments.

The current implementation is naive in two ways:

  • Every message is sent to every player. There is no interest management implemented.
  • To check if a rocket hits a ship, the code iterates through every rocket and every ship.

Your task is to implement an appropriate form of interest management so that only messages relevant to a player is sent to the player, and only rockets “of interest” to a ship is checked for hits.

This is a completely open ended assignment, so you are free to implement any interest management technique you think is best to solve the problem.

Bonus Task

For extra 40% of the Assignment 3 grade, you may choose to implement multiple servers to improve the scalability of the game. The game world, however, has to be seamless (handover from one server to another should be transparent to the player).

Report

Your report should explain your solution, as well as point to sections of the code that you have changed to implement the solution. A short explanation of each change is expected.

The total length of the report excluding front cover should be no more than 5 pages. (If you attempted the bonus task, your report can include an extra of 3 pages).

Notes

  • You might note that, for bots, since no rendering is required, many of the messages can be ignored. It is tempting to change the server so that those messages that would be ignored by the bots are not sent. This is not allowed, however, because bots are used to simulate human players, and the server should treat every player as the same, regardless of whether the player is a bot or is human.
  • You can design your solution to work in a low delay environment. Consistency and visual disruption are not the focus of this assignment.
Print Friendly, PDF & Email