RocketChat / meteor-streamer

2 way communication over DDP with better performance.
MIT License
82 stars 27 forks source link

Can one create an MMO game in meteor with this? #38

Open pagesrichie opened 5 years ago

pagesrichie commented 5 years ago

1) Can one create an MMO html5 game in meteor with this? For example to update the x and y coordinates, game state etc.

2) I do not see a broadcast emitting function to send a broadcast message to all connected clients, also is there a way to see whether the user has joined and left?

3) Can we set up private rooms and only members of those rooms will receive updated game messages , and we can have multiple private rooms?

4) Is there any way to connect this to redis-oplog or redis (or is there no benefit of that regardless)?

I like that this package works with load balanced horizontally scaled servers.

Is this all possible with meteor-streamer. Thanks!

ggazzo commented 5 years ago

hey @pagesrichie sure you can, I would recommend you see that code: https://github.com/RocketChat/Rocket.Chat/blob/streamer/packages/rocketchat-lib/server/functions/streamer/stream.js we made some changes to test performance improvements I

and here https://github.com/RocketChat/Rocket.Chat/blob/streamer/packages/rocketchat-lib/server/functions/streamer/streamer.js instead of `Meteor.StreamerCentral.emit(`` you could use redis/natis or any kind of message broker... I'm not sure if meteor its the best choice for games... how many users/players and rooms do you expect?

pagesrichie commented 5 years ago

@ggazzo Is there documentation for these functions?

I am planning on having 4-8 players per room, rooms well, that depends on traffic ... with horizontal scaling that shouldn't be an issue right?

Is Meteor.Streamer faster than socket.io?

I'm a little confused on what you said here: "instead of `Meteor.StreamerCentral.emit(`` you could use redis/natis or any kind of message broker..." - could you elaborate a little more? Thank you

ggazzo commented 5 years ago

probably socket.io is faster than Meteor + Streamer, because socket.io doesnt deal with reactive data. What I tried say with "redis/nats" is because our library doenst communicate with other instances by default. you should "bind" your instances using a message broker (pub/sub). can I ask you why you want use meteor do develop a game?

pagesrichie commented 5 years ago

@ggazzo For multiple instances, isn't this enough? https://github.com/maxnowack/meteor-sync-eventemitter

Sure would love to answer that, what's your email? If you don't want to put that publicly, my email is (my github username) AT gmail.com. Shoot me an email would love to explain/discuss more