Server running multiple levels, I can't think of a solution.
How would you run multiple levels on the same server at the same time?
Take for example the old-school 2D Zelda games. You'd have one giant world, and a crapload of little zones or levels. Player could be in the Dungeon, or on the Roof, etc.. etc..
How would the server run all the zones, when all the zones are defined in the same space?
ie..
Player1 is at 0,0,0 of the Dungeon. Player2 is at 0,0,0 of the Castle.
It seems like an awful mess to keep track of everything in seperate zones, when there could be 1000s of zones for the world.
Any idea on some common solutions?
[edited by - GroZZleR on February 21, 2004 1:43:17 AM]
Spawn each little world as another process. Each worldlet exposes a connection which communicates with the master server. This allows you to insulate each worldlet, and if it goes down doesnt take the entire world out. Also this model allows you to spawn a worldlet on another machine, distributing the worldlet load.
They all have to communicate to a DB to synchonize player stats. That might cause some contention with 100''s of worldlets so there might be an issue there.
So there might be a lobby world which dispatches players to running worldlets, or can spawn worldlets. The worldlets themselves and the DB server.
Good Luck!
-ddn
They all have to communicate to a DB to synchonize player stats. That might cause some contention with 100''s of worldlets so there might be an issue there.
So there might be a lobby world which dispatches players to running worldlets, or can spawn worldlets. The worldlets themselves and the DB server.
Good Luck!
-ddn
Either you can move all the zones to different pieces of the world, so they don''t overlap, or you can have coordinates be 4-tuples, where, there''s x,y,z and "zone", where "zone" is just an integer between 1 and your number of zones. (reserve 0 for "not logged in" or whatever)
If you really want to run all the zones on the same socket (multiple processes would require multiple port numbers) then you could store what zone the player is in in your player record. When packets come in, you have to track the packet back to a connected player the first thing you do anyway; looking up which zone he''s in and dispatching to that zone object should be simple.
If you really want to run all the zones on the same socket (multiple processes would require multiple port numbers) then you could store what zone the player is in in your player record. When packets come in, you have to track the packet back to a connected player the first thing you do anyway; looking up which zone he''s in and dispatching to that zone object should be simple.
enum Bool { True, False, FileNotFound };
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement