I'm designing a simple game where all players use one battlefield via browser. I'm using websockets. So I'm wondering should I always send all data about battlefield to every user when smth is being changed or there is a way just to send delta to users who already have a data about battlefield? Will message brokers (like activemq and rabbitmq) help with this type of architecture?

  • 2
    Sharing your research helps everyone. Tell us what you've tried and why it didn’t meet your needs. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Also see How to Ask – gnat Nov 3 '14 at 22:32
  • 1
    Consider: Do your players need to know the full state of the battlefield all the time? Usually, these games have very large play areas and it's pretty rare for a single player to have full and current knowledge of the whole thing. If the players DID get all the data about the whole battlefield, how much of that data would actually be usable/useful to them? – FrustratedWithFormsDesigner Nov 3 '14 at 22:41
  • I'm not planning to make a large field. Now I send all data about players position every time. But if there will be many players won't this design affects the server. Is there a way to optimize it? – cadmy Nov 3 '14 at 23:14
  • And I think if I would send only changes if some lag will happen or there would too many messages thus they won't reflect actual situation. Is this point of view consistent? – cadmy Nov 3 '14 at 23:21
  • @cadmy these are problems with design issues that have trade offs. There as been quite a bit of work in this area - from netrek back in the 90s with limited information, UDP packets (rather than TCP) to academic papers like The Effects of Consistency Maintenance Methods on Player Experience and Performance in Networked Games. There are trade offs in the design that you have to accept and design for. Which way you go is one that you need to think about - both approaches can be right – user40980 Nov 4 '14 at 1:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.