«

»

Network Game Development

SuperNetworkGame

As part of the MProf course at Abertay, I selected to take a module that focused on Network Game Development. Through this module, I aimed to translate the skills I learnt at Teesside into a C++ environment as well as adding a dead reckoning implementation required by the brief.

To fulfil this, I created a multi-player top down shooter called “Super Network Shooting Game”. This game combines local and network multi-player, letting up to 8 players take part in simple top down combat. Each terminal support four controllers (thanks to SDL 2.0’s robust controller integration and Microsoft’s wireless controller receiver).

The network model is server-client, with both machines having players. The server is responsible for starting and ending the game. Required information for both machines (such as start and end messages) are sent via a TCP connection formed when the applications start. Standard game events are transferred via UDP. Linear interpolation is used to mitigate packet loss or delay.

In addition to networking, I used C++11’s multi-threading features to move the TCP and UDP listeners to separate threads to improve performance. This was my first major experience of using multi-threading in C++ environment and took a while to learn, however the application performs well and exits cleanly.

To assist in development, I used several third party libraries to assist:

  • SDL 2.0 was used for the basic framework, particularly the rendering and input elements
  • SDL_Net was used for the network framework, providing a feature packed layer to implement TCP and UDP connections.
  • SDL_Image was used to allow the game to render PNG and JPG images used for sprite sheets
  • SDL_TTF was added to allow the outputting of text – this feature was added after handing the module in.

For this project, I received an A20, the highest mark that Abertay awards for its module grades. After development I look forward to improving this demo, adding additionally game-play features while using it as a test bed for improving my C++ skills in a multi-threaded, multi-machine environment.

Source Code

All source code for this project can be found on my bit-bucket at https://bitbucket.org/michael_charge/super-network-shooting-game

Please note that I have branched off at the version I handed into Abertay which is titled “Handin_Branch” – it is missing the text rendering and some structural improvements.

%d bloggers like this: