Nicolai Posted December 14, 2016 Share Posted December 14, 2016 Hi all, I've made a couple of small shitty games, with phaser. I'm really enjoying how fast you can get something up and running, and see actual progress. Now, I'm currently working on a multiplayer game and I'm a bit curious how others are handling this. Personally, I've decided to use Microsofts SignalR, mostly because I already have some experience with that from work, but also because it will fallback to "crappier" transport methods, if websockets are not available. What are you guys doing, to enable multiplay or server-run logic? Link to comment Share on other sites More sharing options...
endel Posted December 14, 2016 Share Posted December 14, 2016 Hey @Nicolai, I'm using Colyseus for my prototypes. It was designed to be really easy to integrate server and client. JavaScript client: https://github.com/gamestdio/colyseus.js Server: https://github.com/gamestdio/colyseus I'm currently working on a multiplayer racing game that I plan to release by mid of next year. I'd be glad to support you with yours if you have any question. The beauty is that you can code both client and server using TypeScript, which is quite handy. Cheers! jerome and Nicolai 2 Link to comment Share on other sites More sharing options...
mickeyren Posted December 14, 2016 Share Posted December 14, 2016 Or you could use the industry grade developed by NetEase - https://github.com/NetEase/pomelo Nicolai 1 Link to comment Share on other sites More sharing options...
Nicolai Posted December 15, 2016 Author Share Posted December 15, 2016 So nodejs backend is all the hype, huh? How much control does that give you? Can you setup timers that control npc's and stuff like that? Does it scale well? Also, it seems like both solutions only do websockets (from what I could find), are you not at all worried about clients who doesn't support that? Link to comment Share on other sites More sharing options...
rgk Posted December 15, 2016 Share Posted December 15, 2016 @Nicolai The reason for the hype is it gives you tons of control, I take a more lightweight approach and use primus.io with primus-rooms and have built majority of it by scratch. It is simply a great solution, setting up timers can be done, and it scales well especially if you implement correctly. Websockets is the pretty standard right now, but socket.io does try other ways to send data. If your creating a reasonably complex multiplayer game, chances are people with browsers that don't support websockets wouldn't be playing your game anyways. Nicolai 1 Link to comment Share on other sites More sharing options...
mattstyles Posted December 15, 2016 Share Posted December 15, 2016 Most implementations should support fallbacks, if they don't they're doing something very very wrong (although it isn't unreasonable to assume those who can not support websockets probably can't run your stuff anyway). Socket.io is very popular and supports fallbacks to polling (which is all anyone can do without a stay-alive connection). There are numerous others, such as websocket and ws which are very well maintained, but take a look at µWS. 2 hours ago, Nicolai said: Can you setup timers that control npc's and stuff like that? Node is just JS, if you can do it in JS then you can do it in node (do note that accessing DOM functions isn't strictly JS, thats just a JS interface to operations/functions the browser runs and they obviously are not available in node). JS might be a bag of crayons but it would have been abandoned before it had even begun if it could not do stuff like that. Also, and it's probably just a use-of-language thing, node can hardly be considered hype, it is mature and used by just about every company on the planet, including IBM, Microsoft, Sun, Oracle et al who have their own stuff. Nicolai 1 Link to comment Share on other sites More sharing options...
mickeyren Posted December 18, 2016 Share Posted December 18, 2016 also, since your just starting. I think i would just recommend to go with a much simpler setup using Firebase realtime databse infrastructure - https://firebase.google.com/ latency might be a problem but depending on your type of game it might not be an issue. Link to comment Share on other sites More sharing options...
Nicolai Posted December 20, 2016 Author Share Posted December 20, 2016 Thank you guys, that is all very helpful. I think I'll try going the nodejs + socket.io route instead. Link to comment Share on other sites More sharing options...
namel Posted January 14, 2017 Share Posted January 14, 2017 Here's another option, check out http://incheon.gg It's an open-source nodejs library which implements multiplayer physics in javascript, and takes care of position extrapolation, step drift, object marshalling, re-enacting steps on the client, etc. etc.. Hopefully it's way faster than firebase. Link to comment Share on other sites More sharing options...
Recommended Posts