WoodyLau

How to make a multiplayer game

Recommended Posts

Without meaning to sound negative, how comfortable are you with JS and web programming?

If the answer isn't at least 'yeah, I'm pretty good' then maybe don't try a multiplayer game. They are orders of magnitude harder.

If you're going for it though:

I'd start looking up and learning how websockets work, and really understand it. If you're familiar with pub/sub or observable patterns then they aren't super complex. The problem you always face (with any program to be honest) is dealing with the asynchronicity of events. If you get that down then you're most of the way there. It certainly isn't easy though.

Then I'd look up server-authoritive architecture i.e. the server is where your game live, your clients (players in the browser) are windows on to that server. Then get a handle on what stuff you can/should do on the client and what stuff must be done on the server. Once you get this then you can employ the lessons learnt above (websockets) to propagate that server state to all your players.

After that you've pretty much got the whole multiplayer thing done from a technical stand point and you can work on the really fun stuff of making your game fun.

Oh, as with all projects, keep your scope initially super small, like, really small, as in, way smaller than you think would be viable. Get it working on that small scope, then expand outwards. You'll hopefully find that even with a tiny fraction of your 'ideal scope' that your core concepts shine through and you have the beginnings of something fun, it probably *will* be fun at that stage if your core concepts are good.

Share this post


Link to post
Share on other sites

I want to make multiplayer games too. I have some suggestions for you. Set a simple first goal for youself. I think that free Heroku is the best. Make a very simple server app that will send the "hello, world"  message + "counter" to your clients. Chose client side: Canvas API, WebGL, Phaser, Pixi.js, Three.js, Babylon.js, Unity WebGL and so on.

I choose Unity for client. I wrote the very simple server in TypeScript. I built client in WebGL and in desktop app. I uploaded my simple server on Heroku.

You can try run:

You will see a message that server send every one second. If you want, I can explain you in TeamViewer or Skype how to make it for free. Write me a private message.

 

UnityWebGLAndDektopClient.png

Share this post


Link to post
Share on other sites

Designing Multiplayer games has a few general things in common, but much of how you will implement them will vary based upon which platform you use. Here a link to one of my favorite tutorials on the subject that goes as much into the theory as it does the technical walkthrough:

http://www.schibsted.pl/blog/back-end/developing-lag-compensated-multiplayer-game-pt-1/

Many tutorials over simplify by just saying "Make it a single player game then add multiplayer support later", which is usually NOT a good idea for most platforms; in the tutorial that I've linked to the writer goes over some of the pitfalls of that approach, pointing out that it's good to design and plan for multiplayer from the start.

One of the largest challenges for most starting out is getting a good understanding of net-sockets so the clients can communicate, then understanding how to make them sync together. It's good to get a decent understanding of both of those conceptually and technically for your platform before becoming too invested in a large project.

I'd also highly recommend this article by Gabriel Gametta on general theory of client-server architecture; it covers some of the history of multiplayer games and the concepts that were used as the industry advanced:

http://www.gabrielgambetta.com/client-server-game-architecture.html

I totally agree with what has already been said by others on this thread: Start Small. It's a lot easier to learn net-sockets and syncing clients for Pong than Ultima Online.

Hope that helps, and most all Good Luck!

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.