What are the basics of multiplayer?

I want to make a simple multiplayer game, where do I begin?

There are various types of multiplayer game:

  1. Local multiplayer (e.g. Monopoly)
  2. Online asynchronous multiplayer (e.g. Online chess)
  3. Online realtime multiplayer (e.g. TANX)

To learn about 3, go here.

Any way I can make this system to work for a chromebook, I do not have a pc…

I am using award space for hosting. How can I use this to create a server?

Heroku probably does what you want:

Is it posible just to create a basic server and use that for the multiplayer? if so then how?
I just need a way to make a home screen, and when the player starts the game he spawns in a world with the rest of the players. I am also trying to make a data persistence system that can save the player’s position and other data for later.

Also what about controls?

It is possible to create a basic server to be used for a multiplayer game, yes. Without having tried it myself, you would:

  1. Register with a cloud based NodeJS capable server provider like Heroku.
  2. Provision a server.
  3. Ensure Node is installed.
  4. Create your web server script (as described in the Tutorial on multiplayer game development). Heroku should have a text editor you can use on your Chromebook that runs in the browser.

What about them? :slight_smile:

When i worked with the unity engine, if you did not code them right, when you press “W”, not only will your player will move forward, but everyone elses will to… You had to create a code that allowed the server to tell which computer is sending what input, and which should happen to which player based on that input…

I’m afraid I don’t know anything about that. I’m not a Unity user.

How will I get the game’s multiplayer controls system to run real time by having a system that can tell which computer is giving what input, and to which player should be affected by that input?

Also when you say “Make sure node is installed”, is that compatible with a basic chrome book/ web browser?

How do I send values to a php/js file on a web domain then get playcanvas to retrieve values from that same php/js file? I think I may be able to use that for multiplayer server comunication.

look at this https://developer.playcanvas.com/en/tutorials/real-time-multiplayer/

1 Like

The problem with my multiplayer game was that it was very slow so you saw the other like 10 times a second. I dont know if this was because of the server but I think that prediction would solve it.

How do you implement that?

Hi @SayHiToMePls,

If you are receiving positional data for the remote players every ten seconds and you use that using setPosition /setRotation then yes the movement will appear choppy.

You need to either keep a buffer of the last 2-3 positions received and interpolate between them, to render smooth movement. Or extrapolate from the last received position to the received direction using a prediction strategy that fits your game.

You can use the pc.Vec3.lerp() method to smoothly find the correct position each time.