Language

C++

For the game development

Libraries Used

Client

  • Alpha-Engine, a Digipen devoloped graphics libraby, that utilises OpenGL
  • WinSock

Server

Tools

Overview

Computer Networks Project

In my Computer Network Module, we learn the basics of networking. At the end of the module, we had to create a multiplayer game from scratch using the Windows Socket Library and grpahic library of our choice, #include <WinSock2.h>

After learning networking fundamentals, such as TCP and UDP, a three way handshake, and how data is sent. A requirement for the game is for 3 core networking features to be implemented which are:

  • Server Reconcilation
  • Client Prediction
  • Entity Interpolation

After implementing the various techniques, we then had to test its effectiveness by artificially causing lag with a script provided by out professor. Client-side prediction + server reconciliation.

Roles and Task

For the client side, I set up the the

  • Graphics
  • Client to Server Connection
  • Client Predition

For the Server:

  • Set up the project, threads that receives messages from connected clients
  • Set up ImGui and various interfaces to send commands that

Assets

Research Material

Summary

With many popular online and multiplayer games, it is easy to forget the amount of work and the increased complexity that goes into developing it. Many major engines such as Unity, Godot or Unreal Engine have libraries and frameworks that simplify the process.

Screenshots and explanation

Client Menu screen When the user launches the game, they will be greeted with a simple menu screen. MenuScreen

Client Lobby Screen
Clicking on the join game button, will bring then to a server connect screen. Since i am launching both client and server on my machine, i will connect to the localhost and use the default port 5050 ConnectToLobby

The game screen
When the user successfully connects to the server, it will wait for the game to start.

GameScreen

The server UI
This is the server UI. It allows the server host to control various aspects of the game such as

  • Which map to load
  • Viewing how many players are connected
  • View player stats
  • Send custom commands to any or all players

It is important for both the client and the server to have the same copy of the map. The map data read by the client is purely for rendering purposes whereas the map data in the server is used for physics and collision detection.

When any client does an input, it will compact it into a small message and sent to the server. The server will receive the message, validate it, update the clients position and broadcast it to the other clients.

ServerUI

Player Connected
When a player is connected, it will show in the server

PlayerConnected

Player Stats

PlayerStats