first, I would like to apologize for my bad English, I hope you’ll understand me!
So, I am making a video game (very original!) for a uni project. It is an online multiplayer game. I am using Meteor and Phaser.
It is basically a game in which you control a boat and you need to shoot on other players’ boats.
My problem is that the other players positions doesn’t update in real time on the client machine. Actually, the is a latency between 5 and 10 secondes (maybe more, I didn’t timed it).
I think this is due to the way I update the position of other players. In my phaser main update loop, I update the database with the new position of the boat. I think the update function is called 60 times per second, it is quite a lot! I don’t know if Meteor can handle so much updates in such a short time?
So this is how I update the database, then I need to update the other players position on the user machine.
For that, I have a subscription to the Boats collection, and I have an observeChanges function that update the position of the other players each time the database is changed.
I guess this is not the easiest way to do it, and not the most efficient!
My first idea was to use something like Meteor streams or Streamy, so that each user could broadcast constantly his position. But I read that Meteor streams is no longer updated, and I couldn’t make Streamy work.
So my question is: what do you recommend to broadcast very (very) often datas to other users?
If I manage to do that, I think I can save boats datas in the database every 10 seconds for example.
Again, I’m sorry for my english, I hope I made my problem understandable. Also, I am quite new to Meteor, so please don’t judge me if I have very bad practices ^^