Requesting Suggestion on Multiplayer setup
Posted: Sun Oct 13, 2013 4:34 pm
I'm putting together a quick proof of a concept game. This proof will have 3 playable areas. A "Home Base", "World 1" and "World 2". My original version used an Canvas and a very basic Isometric viewer that I wrote. The "server" was a set of php files that accessed a MySQL database to pass world information to the client. This data was requested with a javascript timer that called for the data via AJAX every 300 ms. The world data was passed based on the session created in php to know what map the player was requesting data for, and the xy cords of the top left corner of the view port in world coordinates.
So, now that I'm moving to Isogenic server and using the Node.js server I am presented with a few questions about the "correct" way to do this. Since the server broadcasts to all clients connected to it, I would assume that, like other MMO style games, it would be best to limit the amount of packets by breaking up the connections to logical areas or zones. I don't see a way this can be done "out of the box", so I'm going to assume that I would need to run multiple servers to handle the different play worlds. (SubQuestion1, Is that assumption correct?) If I was going to set the game up to connect to different servers (SubQuestion2, Better to use different servers, or just run multiple instances of Node on different ports?) should I limit the resources of the client by loading individual pages for each of the worlds? (example: homebase.html, world1.html, world2.html) Or would it be better to load everything in a single page (index.html) and then let the server manage what needs to be displayed, and resetting the connection to a new server via a javascript call? I know that sounds confusing and I'm sorry, it's the best I can explain it.
Also, The "Home Base" map is really a single player map that will interface with a server trigger the display of menus and update UI elements. I'm thinking that the best way to do this is to make it a page that uses the Isogenic engine to display the map and UI, but use AJAX and php to pass information to the server. Since this does not need to be real-time I don't see a reason to waste the server on it, and since this map will be single player interaction, there is no reason for a server to update any other clients. Once the user enters a world I would just load a new page that would handle the world. That world page would then connect to a real-time server. Would this be the correct way to handle the "Home Base"?
A little background on the game type, in case it makes a difference in the way to handle this game. The game will be real-time strategy / resource management. The "Home Base" will be where the player can check stats, build new units/buildings, do upgrades, etc. The worlds will be playable to users based on level. So, leaving the "Home Base" will only take you to your current World. Once a player reaches a certain point in the game they will transition to a new world. Once they leave the old one behind they will never return. So for example, all new players will start on "World 1", once they reach 25km of area and x number of resource generators captured the game will progress them to "World 2". The server needs to know what player owns certain map tiles and how many units are stationed at those tiles, but once a player has moved to another world they will never interact with that world again.
Thank you for any input you might have.
So, now that I'm moving to Isogenic server and using the Node.js server I am presented with a few questions about the "correct" way to do this. Since the server broadcasts to all clients connected to it, I would assume that, like other MMO style games, it would be best to limit the amount of packets by breaking up the connections to logical areas or zones. I don't see a way this can be done "out of the box", so I'm going to assume that I would need to run multiple servers to handle the different play worlds. (SubQuestion1, Is that assumption correct?) If I was going to set the game up to connect to different servers (SubQuestion2, Better to use different servers, or just run multiple instances of Node on different ports?) should I limit the resources of the client by loading individual pages for each of the worlds? (example: homebase.html, world1.html, world2.html) Or would it be better to load everything in a single page (index.html) and then let the server manage what needs to be displayed, and resetting the connection to a new server via a javascript call? I know that sounds confusing and I'm sorry, it's the best I can explain it.
Also, The "Home Base" map is really a single player map that will interface with a server trigger the display of menus and update UI elements. I'm thinking that the best way to do this is to make it a page that uses the Isogenic engine to display the map and UI, but use AJAX and php to pass information to the server. Since this does not need to be real-time I don't see a reason to waste the server on it, and since this map will be single player interaction, there is no reason for a server to update any other clients. Once the user enters a world I would just load a new page that would handle the world. That world page would then connect to a real-time server. Would this be the correct way to handle the "Home Base"?
A little background on the game type, in case it makes a difference in the way to handle this game. The game will be real-time strategy / resource management. The "Home Base" will be where the player can check stats, build new units/buildings, do upgrades, etc. The worlds will be playable to users based on level. So, leaving the "Home Base" will only take you to your current World. Once a player reaches a certain point in the game they will transition to a new world. Once they leave the old one behind they will never return. So for example, all new players will start on "World 1", once they reach 25km of area and x number of resource generators captured the game will progress them to "World 2". The server needs to know what player owns certain map tiles and how many units are stationed at those tiles, but once a player has moved to another world they will never interact with that world again.
Thank you for any input you might have.