Skip to content

A showcase of working multiplayer game (to some degree) on Godot and RakNet.

Notifications You must be signed in to change notification settings

Blika/GodotClientServer_Showcase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

GodotClientServer_Showcase

A showcase of a working multiplayer game (to some degree) on Godot Game Engine and RakNet.

Server

The server part is written in C++ and uses RakNet to handle networking. For now, it handles creating and closing sessions (basically a class for connections that contains handful functions), managing packets, spawning and syncing player actions across clients.

Additionally, you can configure settings in input/settings.json. There you can set the limit for incoming connections (in other words players connected) and sleep time for the main thread (to get a more consistent tickrate).

Client

We are using Godot Game Engine as a game client, and GDExtension to use C++.
Players can move, jump and kick other players. Movement actions use interpolation so they look nice on the client. All player actions are synced.
You can open multiple clients to join the server.

Client Controls

W - move forward;
S - move backward;
A - move left;
D - move right;
Space = jump;
F = perform a kick;
Left ctrl - lock/unlock mouse cursor.

Usage

Download from releases. Unpack the archive, and run the server first.

If you run the client first instead, it won't load because it will be waiting until the connection is established.

Afterwards you can open as much clients as you like.

Alternatively, you can build it yourself. To build the server you'll need CMake (there are build scripts available); to build the client you'll need to build the libraries using Scons (in godot_client run cmd scons platform=windows for windows libraries) and then export the project (godot_client/demo) from Godot.