I’m in the process of making a browser based multiplayer turnbased strategy game similiar to Risk.
Right now, the easiest way to do things seems to be to just make it like a regular webpage. Each time a player refreshes, the webpage queries the database for the information it needs.
This is acceptable, but I’d MUCH rather have the page update in real time so the players don’t have to constantly refresh the page.
I could just have the web page query the database every X seconds, but I’ve heard this isn’t efficient.
What would be the best way to do this?
Try Socket.io library or Juggernaut2.
You will need a Redis adapter to use Juggernaut2, take a look at PhpRedis.