Advice on multiplayer


#1

Any good resources to make great multiplayer like games using playcanvas like slither.io or games like that. With huge player sizes.

The tutorials on the site are very helpful but any more would be helpful. Cheers


#2

I don’t know much about multiplayer games like the one you want, but I do know that you have to create a server in your game. Sorry if I wasn’t much help.


#3

You are probably looking at a more in depth series like this: https://victorzhou.com/blog/build-an-io-game-part-1/

Unfortunately, there is less likely to be a single resource for this type of stuff as there are so many different areas to tackle and varies pending on each individual needs.


#4

Thanks!

It’s not just about having a single source but just whatever you are able to provide me with! Any resource(s) will be helpful to me!

My buddy mentioned to me something along the lines of react.js but wasn’t sure what he meant by this.


#5

React.js is a front end library commonly used for web apps. Your buddy might be thinking of using it for the UI such as the lobby etc.

For the server (backend) part, node.js is what a lot of resources will point to to use as servers are quite wildly available. There are also services that you can get which can get you going quicker (eg Photon) so it depends on what angle you want to go at. (Build it yourself or use an off the shelf product).

For the game and UI, PlayCanvas and some HTML would be enough.


#6

I see yea I thought so too.

Yea in the tutorial you sent to btw he suggested Express which seems to use Node.js but also a service. Not sure exactly https://expressjs.com/

Like I said I’m pretty noob so any if not all types of links and resources to steer me in the right direction are helpful! @yaustar thanks again, always helpful!!

I agree that playcanvas will do most of the heavy lifting I just need the extra wisdom to make the multiplayer work. Cheers!


#7

@Robotpencil - Take a look at Nakama, I’m implementing something with it at the moment.

https://heroiclabs.com/

It provides real-time multiplayer messaging, and a host of other APIs that MP games need. You will need to set up a server, which is easy to do if you are familiar with docker.

Express isn’t really suitable for your use-case, nor is React.


#8

There is no tutorial. No easy lib, no easy path to making good multiplayer games. It’s all trial and error, lots of researching, testing again, failing and making progress at the same time.

All you need:

  • Time.
  • Patience.
  • Learn about WebSockets.
  • Decide which backend language to use for your game servers (NodeJS is easy for starters, but can get wild on memory or cpu leaks, but it’s a nice starting point for newbie backend developers).
  • Learn about Network Optimization and Lag mitigation tecniques like interpolation and extrapolation algorithms.
  • Make a test game and try to apply everything you’ve learned.

Things to take in count:

  • You will fail.
  • You will fail.
  • You will fail.
  • But keep going. If you have enough discipline you’ll be able of handling hundreds of simultaneous players someday.

Additional notes:

  • Don’t use socket.io.
  • Don’t use JSON to serialize network packets on a realtime multiplayer game. IT’S HEAVY.
  • Use uWS (available in both NodeJS and C++ backends), and say thank you to its creator: https://github.com/alexhultman
  • Don’t be afraid to try out stuff or to fail.

#9

Dang this is all helpful advice!

Im going to begin this journey sometime starting next week. And wanted to collect as much info to study as i travel but this is awesome.

Ill share first steps with yall soon enough and again any and all resources are welcome. Im looking for things to learn from, not necessarily an easy solution! Cheers!