WoodyLau Posted December 5, 2018 Share Posted December 5, 2018 Hello everyone, I wanna make a multiplayer game, How you guys have a suggestion for me? Quote Link to comment Share on other sites More sharing options...
8Observer8 Posted December 5, 2018 Share Posted December 5, 2018 How to Make HTML5 Games: Javascript Tutorial for Beginners Quote Link to comment Share on other sites More sharing options...
8Observer8 Posted December 5, 2018 Share Posted December 5, 2018 That is a wrong link above. This is the right link: 1- Making Multiplayer HTML5 Game: Setup & Sending Files. NodeJs Tutorial Guide Quote Link to comment Share on other sites More sharing options...
8Observer8 Posted December 5, 2018 Share Posted December 5, 2018 I found a of lessons from link above: Multiplayer Nodejs Game Tutorial This is a step-by-step instruction how to deploy your game server on Heroku: Getting Started on Heroku with Node.js Quote Link to comment Share on other sites More sharing options...
mattstyles Posted December 5, 2018 Share Posted December 5, 2018 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. 8Observer8 1 Quote Link to comment Share on other sites More sharing options...
8Observer8 Posted December 16, 2018 Share Posted December 16, 2018 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: Unity WebGL Client: Click to run in browser (sometimes you need to run a few times to wake up Heroku app) Unity Desktop Client for Windows: Click to download 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. Quote Link to comment Share on other sites More sharing options...
ShrewdPixel Posted January 30, 2019 Share Posted January 30, 2019 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! 8Observer8 1 Quote Link to comment Share on other sites More sharing options...
10basetom Posted July 15, 2020 Share Posted July 15, 2020 Hi guys, if I have a turn-based game built in vanilla JS and HTML4 (way before HTML5) where you play against the computer in a local HTML file, and I want to host this HTML file somewhere and allow two humans to play each other -- what's the best way to approach this in 2020? I've seen tons of online tutorials on how to build real-time multiplayer HTML5 games using Node.js and Sockets.io, etc., but all of them walk you through creating a game from scratch using a modern game engine, whereas all I want to do is retrofit my existing HTML4 game to add turn-based multiplayer. Any suggestions would be much appreciated. Quote Link to comment Share on other sites More sharing options...
8Observer8 Posted July 27, 2020 Share Posted July 27, 2020 (edited) I study this book: Multiplayer Game Development with HTML5 I rewrite the classic Snake game example from the book to TypeScript. Author uses Node.js, Express and SocketIO. I want to make 3D version of the Snake game. I will deploy the game on Heroku for free: https://www.heroku.com/ You can use OpenShift (https://www.openshift.com/) - it is the same. I found a very good tutorial how to make a smooth movement using lag compensation and client prediction methods: Real Time Multiplayer in HTML5 I deployed the example from the tutorial on Heroku: https://battle-world.herokuapp.com/?debug (I use a free plan and if no one runs it 30 minute you need to wait 10 seconds) You can open two browser pages to test it. The example from the tutorial on GitHub: https://github.com/ruby0x1/realtime-multiplayer-in-html5 Edited July 27, 2020 by 8Observer8 Quote Link to comment Share on other sites More sharing options...
chefstudios Posted December 1, 2022 Share Posted December 1, 2022 I'd use something like webtick.gg for this. Best networking solution available IMO. Uses Netcode and WebRTC instead of websockets, so it's a lot faster and more stable. 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.