Hello everyone, I’ve recently stumbled across PlayCanvas again and after a few days of fooling around with it I really fell in love with the editor and tools that are here. One thing that I’ve been wondering for the longest time now though is how to write a multiplayer game with an authoritative server that can still utilize all the tools of the engine.
The way I’m seeing it is that each client only ever passes basic inputs to the server and receives back position/other information. With my limited experience in 2d html game development this wasn’t so bad as it was pretty bare-bones and I was able to produce some effective results but whenever I want to move into the world of 3d and get into bigger game engines like Unity/Godot/PlayCanvas I always get lost in how to execute this model as it all seems to revolve around an entity-component system that seems pretty coupled on the client.
I’ve got 2 ideas that I just quickly thought up of on how to achieve multiplayer.
1- Create the client in the PlayCanvas editor as a project and a backend node server that uses the PlayCanvas engine and receives/emits websocket messages.
2- Create 2 PlayCanvas projects, 1 for the client and 1 as the server. Build out the same “world” in each project and run the server project for each server instance thats needed without any drawing/graphics, not sure if this is possible, kinda like Unity does it.
For #1 I feel like it would be a much longer development process as I’d have to make sure everything in the editor matched up to everything I write in code for the server, like terrain/static objects. For #2 it’s sort of the same problem, but at least I get to use the editor tools and such, and I’m not sure if it’s even possible.
I’m just trying to wrap my head around all this before I jump in and any insight into this would be much appreciated, thanks!