I'm exploring the server-client relationship in game development, aiming to understand the necessary information for transmission from the server to the client in a multiplayer game where I'm using a graph data structure as my source of truth. (I don't know how far I'm going to get, but it seems like a fun idea.)

For example, I'm in the process of constructing a server for a WebGL game, omitting SSR. This setup utilizes WebSockets (TCP) for real-time communication between the server and client. Let's consider a scenario where a client joins an empty server: the client then sends lightweight data to the server, adding it as a node in the graph {id, {name, color, position}}. In response, the server transmits the graph's object containing the current state of all players {id, name, color, position} to initialize the client's game world. Additionally, it broadcasts the details of the new player {id, name, color, position} to all players (if any). However, would this approach be correct and scalable? It seems unsafe and expensive.

  • \$\begingroup\$ What exactly do you understand by the "graph data structure" and how is it going to be a source of truth? \$\endgroup\$
    – Kromster
    Mar 28 at 20:23
  • \$\begingroup\$ By using a graph data structure as the "source of truth" in a multiplayer game, you establish a centralized representation of the game world. Nodes could represent entities in the game world (e.g., players, NPCs, objects), and edges could represent spatial relationships between them (e.g., proximity, adjacency). Network Topology: Nodes could represent servers or game instances, and edges could represent network connections or communication channels between them. In addition the nodes can represent regions of the game world. I dont understand why I got downvoted. \$\endgroup\$ Mar 28 at 20:35
  • \$\begingroup\$ Your explanation contains a whole lot of "could"s, looks like you don't know what you are doing. In fact, the "where I'm using a graph data structure as my source of truth" could be easily replaced with "where I'm using any data structure as my source of truth" and it won't change its meaning. \$\endgroup\$
    – Kromster
    Mar 28 at 20:38
  • \$\begingroup\$ On the same vein, what "safety" and what is "expensiveness" in your understanding? *Please add details to the question body itself, not in comments. \$\endgroup\$
    – Kromster
    Mar 28 at 20:41


You must log in to answer this question.

Browse other questions tagged .