This project enables players under complex NAT environments to experience typical client-hosted/client-authoritative multiplayer design, by leveraging a centralized, high-performance
ASP.Net Core AOT
server to handle traffic relay. When using the project, game logic still runs on the host's computer, this puts lesser computational weight on the server, which should make this project a better candidate for small to mid-scaled studios compared to server-authoritative when choosing a multiplayer design.
GodotKcpServer
: AnASP.Net Core AOT
server that handles room creation and traffic relay for players inside one room.GodotKcpPeer
: A sample Godot project that contains theKcpRelayMultiplayerPeer
, which has the implementation of using the relay server.kcp2k-span
: A fork ofKcp2k
that translates everyArraySegment
usage intoSpan
orMemory
for better performance.
- Build and run the
KcpGameServer
C# project. - Open the
GodotKcpPeer
Godot Project, turn on multi-instance from the debug menu, and click play. - Use the
List Rooms
button to check the currently opened rooms on the server. - Use the
Create Room
button along with the arguments to create a room on the server. - Use the
Join Room
button along with the arguments to join a room on the server. - Alternatively, or for testing purposes, use the buttons in the
Direct
section for traditionalENet
based Godot Multiplayer implementation.
The current implementation has no authentication, and by the nature of an open-sourced project, this means anyone can exploit your hosted server for their own relay purpose, so do implement your customized in-house authentication mechanism on top of this project.