Hi there, I have a client/server FPS game where we have to separate projects for both client and server. I have a few questions about how to structure the code.
For example, let's say on the client we have this structure:
Main
---- HUD
---- ---- ChatBox
Now when a client types a message and presses enter, we could have an RPC call directly in chatbox.gd. If we look at the RPC call documentation:
Sends a remote procedure call request for the given method to peers on the network (and locally), optionally sending all additional arguments as arguments to the method called by the RPC. The call request will only be received by nodes with the same NodePath, including the exact same node name. Behavior depends on the RPC configuration for the given method, see rpc_config and @GDScript.@rpc. Methods are not exposed to RPCs by default. Returns null.
Due to the restraint that the request will only be received by nodes with the same NodePath, then that forces the server to also at least have the same structure :
Main
---- HUD
---- ---- ChatBox
so that it can receive the rpc call on the server side so that the NodePath matches.
My question/problem is that this doesn't really make sense for the server to have a hud or a chatbox since it's simply a headless server which runs, so what could I do in this situation?