iwiwis Posted October 21, 2020 Share Posted October 21, 2020 Hello everybody, I want to make a multiplayer game using pixiJS, and I need advice. I'm trying to make it using pixiJS since it seems to be a good choice for simple 2D "top-down" view real-time games. I've made a prototype without pixiJS, but using native JS and Canvas (with nodeJS and socket.io for the server and multiplayer part). I want to use a game framework to handle the rendering and collision parts. From what I read, pixiJS can handle both parts, but I'd like it to handle the collisions in the server and only the graphics in the clients. This is where I get 2 problems : 1) PixiJS seems to need the browser window to run properly, and does not decorrelate its physics from its graphics, so the rendering would slow down the server. 2) I'm not sure how to make the clients do only graphics (not physics) without duplicating object-types for the clients. I've found threads about "pixi-shim" that could help me handle the back-end problem, but most discussions ended 2 years ago, so I'm not sure it's still up-to-date ? Most multiplayer tutorial simply make the physics run on every client, but that's not something I'd like to do (for "cheating players" reasons). Thanks Quote Link to comment Share on other sites More sharing options...
b10b Posted October 22, 2020 Share Posted October 22, 2020 As a primer and insight into the not-always-obvious I'd recommend a read of @Antriel multiplayer platformer devlog: jonforum and 8Observer8 1 1 Quote Link to comment Share on other sites More sharing options...
8Observer8 Posted October 23, 2020 Share Posted October 23, 2020 (edited) You can install Matter.js on server side using the command: npm i matter-js This article describes how to create authoritative server with client prediction: http://buildnewgames.com/real-time-multiplayer/ You should use physics on server and on client sides with the same update rate and synchronization with server on client side for correction of mistakes of client prediction. Edited October 23, 2020 by 8Observer8 b10b 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.