Skip to content

refactor: World::Update loop should parallelize individual Map updates #400

@andreionoie

Description

@andreionoie

Rough ideas on how I envision the future scalability of this server:

  • a Map simulation update runs single threaded and should require no synchronization
  • a GameServer can host 1 or more Maps; it would simulate each Map in parallel taking advantage of however many cores the hosting server has available (8 cores is not uncommon)
  • a player Connection has a Channel ID as its state, selected from the initial auth screen
  • a Channel has it own full World copy (i.e. full set of supported Maps instances, different for each Channel)
  • the mapping is (Channel, Map) -> GameServer (a GameServer can host Maps belonging to different Channels)
    • we mostly want to keep a 1-to-1 mapping between Channels and GameServers, but not enforce to allow deployment flexibility
    • some lightweight TCP proxy could route to the correct GameServer by a facade "channel server" stored in the game client config
    • could perhaps allow live shard migration (a busy ch1 map1 full of shops and buyers could be moved alone in one server)
  • warping keeps the player in the same Channel, possibly (but not necessarily) hopping to another GameServer

As a first preparation step I suggest to simply parallelize Map simulation updates within a World, so we find and squash any synchronization bugs early.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions