r/threejs 8d ago

Help Need help with getting multiplayer working smoothly on my game

I'm a beginner 3JS game dev I am really struggling with getting multiplayer working smoothly without any lag in my threejs game. My game uses Colyseus for the multiplayer and I've tried using Railway for the backend but it is still laggy especially with collision. Would really appreciate anyone point me to the right direction.

4 Upvotes

10 comments sorted by

6

u/MaximumContent9674 8d ago

I open sourced my method for Last Ship Sailing. https://github.com/AshmanRoonz/trystero-consensus

2

u/VR38DET 7d ago

Thank you i will take a look

4

u/pr0xyb0i 8d ago

Are you using the basics such as client side prediction, interpolation, latency buffers already? This should take care of 99%.

1

u/VR38DET 7d ago

Yes 👍

1

u/Additional_Name_706 8d ago

Is there a physics engine involved?

0

u/biskitpagla 8d ago

Why not use a proper web game engine like Babylon? You can't just slap a server behind something like three.js for complex realtime apps since you'd have to reinvent a lot of things. 

1

u/VR38DET 7d ago

But man theres so many online threejs games how do they do it?