Understanding the different APIs for authoritative/realtime games

Hi there! I’m really liking Nakama so far, but I’m a bit confused about the methods available in realtime vs authoritative. Can the client only interact with an authoritative game through RPCs? Methods on the client like socket.SendMatchStateAsync are only available for realtime games or can you hook onto those events in your custom go/lua module?

Hi @au-re welcome :wave:

I can answer your questions and clear up the confusion.

Can the client only interact with an authoritative game through RPCs?

Different multiplayer solutions tend to refer to messages sent that form command messages as part of the netcode for the game as “RPCs” but in Nakama both client and socket-based RPCs are essentially cloud functions that can be written in Go, TypeScript/JavaScript, or Lua. These functions you can write are essentially RPCs in the original sense of the definition remote procedure calls invoked on the server.

Basics - Nakama server

Methods on the client like socket.SendMatchStateAsync are only available for realtime games or can you hook onto those events in your custom go/lua module?

The multiplayer features in Nakama server fall into two categories:

Irrespective of which of the two multiplayer systems you use in the server the game client interacts with the server via the exact same client API. This is by design because it makes it impossible to know via game client code whether the match is authoritative or not.

Let me know if you’d like more information or have a specific multiplayer game design in mind to talk through.

Hi @novabyte thank you for the quick and clear answer! I think I have a good idea on how to proceed now. The guides (.NET/Unity client guide - Nakama server) are really useful, but is there an API reference in the documentation for the client as well? Something similar to: Function Reference - Nakama server but with all methods available in the client.