Jump to content

How do you guys do multiplayer


Nicolai
 Share

Recommended Posts

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

Hey @Nicolai,

I'm using Colyseus for my prototypes. It was designed to be really easy to integrate server and client. 

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!

Link to comment
Share on other sites

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

@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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 4 weeks later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...