Archived

This topic is now archived and is closed to further replies.

Server running multiple levels, I can't think of a solution.

This topic is 5047 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites