How to create Multiple Instances for multi-player?
Posted: Thu Sep 20, 2012 12:43 am
I'm trying to figure out how best and how to create multiple instances for players using ImpactJS and Node.js. I'm not looking for codes, but rather the best way to tackle this. This is the example of the problem:
Taking Sid Meyer's Pirates as a reference. Players start in seaports which act as a sort of lobby or hub. From there, players can then go into the big pond (large strategic map) and begin there travel, seeing themselves as tiny ships. The big map is likely to be broken down into smaller maps, just to provide ease of segregation of players. But when say two players (or more) encounter one another, then combat may occur, which would go into an Instanced Tactical Map. Of which more detail and larger images are used.
What I am guessing off-hand would be to that server side PHP would be used to manage when combat instances occur. And when they do occur, the server (via PHP) temporary create a new game ID (or gamename), and then would direct ImpactJS to load up a given map and place the given players into that map. This would then prevent other players from entering that game (as well as have some routine checks with the database to verify the correct players are in the given instance).
Would that be the best way to tackle this or is there a better or already an existing method for this?
Just for added information, I am thinking of using ImpactJS for the front end, with the server using PHP scripts to verify the actions (and hopefully reduce cheating). The Lobby session is not needed for real-time use and thus likely to use AJAX calls to the server. But once going into travel mode or a combat instance, then that is when the real-timing is needed to be used. I'm not looking for precise timing, as like a FPS, but something to near real-time.
I hope that made sense...
Taking Sid Meyer's Pirates as a reference. Players start in seaports which act as a sort of lobby or hub. From there, players can then go into the big pond (large strategic map) and begin there travel, seeing themselves as tiny ships. The big map is likely to be broken down into smaller maps, just to provide ease of segregation of players. But when say two players (or more) encounter one another, then combat may occur, which would go into an Instanced Tactical Map. Of which more detail and larger images are used.
What I am guessing off-hand would be to that server side PHP would be used to manage when combat instances occur. And when they do occur, the server (via PHP) temporary create a new game ID (or gamename), and then would direct ImpactJS to load up a given map and place the given players into that map. This would then prevent other players from entering that game (as well as have some routine checks with the database to verify the correct players are in the given instance).
Would that be the best way to tackle this or is there a better or already an existing method for this?
Just for added information, I am thinking of using ImpactJS for the front end, with the server using PHP scripts to verify the actions (and hopefully reduce cheating). The Lobby session is not needed for real-time use and thus likely to use AJAX calls to the server. But once going into travel mode or a combat instance, then that is when the real-timing is needed to be used. I'm not looking for precise timing, as like a FPS, but something to near real-time.
I hope that made sense...