Game Programmer
Multiplayer Network - Unity
Brief Overview:
-
The aim was to produce a multiplayer simulation/game where multiple players could connect to the server via their game instance.
-
The game aspect of this proposal had not been fully designed and was a simple implementation so that the Network could be focused on fully.
-
The network, in simple terms, allowed multiple players to connect to the server via their game menu and interact with the game world and/or other players.
​
Network Architecture:
-
The network relied on a server-to-client architecture to support players.
-
This was the best way to implement this in regard to this specific project, as the network was created using a blend of Unity (Game Engine) and Visual Studio (using libraries such as System.Net, System.Net.Sockets, and other relevant libraries).
-
The network uses TCP to communicate data/packets between the server and client(s), however, UDP was implemented to support this process of communications.
-
The network sent any data that was not shared by all players by default (individual player position as an example) as when data like this was shared, it allowed all players to see the actions and interactions of other players in real-time.
-
TCP was used on data/packets that needed to be securely sent and received, such as the connecting of clients to the server. UDP was used on less important information such as information that was changed many times in a short period (such as the position of a moving player).
​
Technology:
-
The main technologies used included Unity Game Engine and Visual Studio using a mix of relevant/required libraries.
-
Unity was used for the game-side of the network including aspects such as player movement and actions.
-
Visual Studio used libraries and APIs such as System.Net, System.Net.Sockets, and Threading.Tasks. These were used to handle different aspects of:
-
Server
-
Client
-
Packet
-
-
ServerSend And other sections in which had not been briefed yet. It was believed that a combination of these technologies supported and handled a game's network well and efficiently.
​
Prediction/Interpolation:
-
As the gameplay section of the network was handled within the Unity engine, some research was required.
-
Upon doing said research, it was found that Unity used a blend of different types of interpolation including:
-
Rigidbody Interpolation: Used to manage the appearance of ‘jitter’ in regard to rigidbody objects such as players, props, scenery, and more.
-
SmoothDamp: a mathematical library which was used to reduce the rate of change when working with variables and the values found within. This could be used on the camera within Unity also.
-
​
-
Another method of interpolation to be included which was not unique to Unity:
-
Linear Interpolation: used to smooth numbers, vectors, and quaternions over passing time.
-
​
Miscellaneous:
-
Some other aspects were implemented into the network including:
-
Handling disconnections properly
-
Improved player movement
-
Collisions in-game
-