Hi, I’m a bit confuse how to sync AI or Custom Game System in a server-side. I’m talking about the architecture of how does OpCode and Match State works to make sure that non-client-side objects are running logically in Server (For example to prevent Cheating).
Is this must be coded in Runtime Module or can I just code everything in the Game Engine? Can developer only works with the gameplay without touching the server code in this case?
I’m using Linux - Fedora 43, Nakama Unity SDK version 3.19.0
Nakama Server running in local using Docker Compose, version Nakama 3.34.1
@JoenTNT The match handler system in Nakama is designed to be completely decoupled from game object lifecycles and Netcode implementation. It’s a low level system for complete control over how game state is represented server-side.
If your goal is to utilize it like Netcode for Game Objects in Unity or the Unreal Netcode you’ll be better off with their builtin system run as headless game instances on a Fleet manager service.
Ultimately it depends on what kind of multiplayer game you’re working on and what your requirements are for game object synchronization, world system replication, and entity interpolation. What kind of multiplayer game are you building?
It’s more like a Cooperative Game and can be Competitive in the future where there will be Enemy AI lingering in the game and sync the transform and states for all Client.
I’m doing experiment using Lua Code as API Runtime Modules for testing server logic. I run my own server which I have control in the Console and it’s Runtime Module. I have followed the documentation about Match Handling but I’m not sure if I do it right.
So I created a game_match and register it in Server-side.
-- main.lua
local nk = require("nakama")
local gm = require("rpcs.game_match")
nk.register_match(gm, "sample_match");
The closes example of game that I’m currently try to make it’s Multiplayer system is mo.co from supercell. The system will have 2-3 room for each mode that will run 24/7.
Nevermind, I decided to follow the Authoritative Server code template. I guess it’s required to code for server-side to handle network game logic, specifically Matchmaking System.