I'd like to add to my Ruby on Rails app a javascript front end using basically Rails a json api sending data to the front end. the question for me is: React or Ember 2 (or maybe another viable solution)?
Now I'd like the app to - be on web and mobile (ultimately even with mobile app) - it's massively multi-player kind of warcraft so players will need to see on their screen (even on mobile phones with slower connection) what other players do and where they move on the screen. I'll use firebase to distribute among clients info about players position.
If I want to have at least 1000 simultaneous players, that's a lot of data to distribute among clients in real time: imagine 1000 people moving in the tile map at the same time.
As each time player moves, I fear I will lose a lot of millisecond changing the css (for example, I'd like to have a "hover" css on the tile he is on currently, so that other players know his location). And if a player is on a certain tile, the other 999 can't go on it so I need to update firebase database for this tile to prevent others from going on his tile. With 1000 simultaneous player, that's a massive amount of data: each time a player moves, i must send to all other 999 clients data with what tile he is on and maybe (I'm not sure) that's where it could slow the app terribly.
I understand React would enable me NOT to redraw the whole screen/tile map and only update the tile he is on (as it changed css color because he just moved on it). Am I in the right direction with this assumption ?
But now Ember has glimmer that acts more or less like React virtual dom and diffs, I wonder if Ember wouldn't be a great fit (i like the proximity of thinking with Rails). so ember 2 or React ?
And maybe I'm totally crazy and this kind of massively multi player game where 1000 players can in real time see where the others are going with little delay (<200ms) is crazy with either ember 2 or react. In that case, what javascript tool or framework would be more efficient for me to use ?
Thanks,
Mathieu
Aucun commentaire:
Enregistrer un commentaire