MMO MultiServer

Options
chris
chris
edited June 2012 in Photon Server
Hello there,

we are actually programming a MMOPRG with Photon as Network Framework.
There are some problems i got while doing the core implementations of the Server.

1. Question: We are planing/doing a Multi-Server enviroment.
Each Physical Server got 1 "World" to hold.
1 Server holds the First "Zone"
1 Server holds the Second "Zone"
1 Server holds "Battlegrounds"
1 Server holds "Instance 1 - Instance 5"
and so on...

What is the best way to do this?
Reconnection the Client to the new Server and save all Data in DB fom Old Server and Query all Data from DB on the new Server?
or is there any other better way of doing this?


2. Question: Have you any implementations or ideas how to "split" the World in Zones and Areas on the Server-Side?
So for example in WoW: 1 Zone like "Stormwind" got 4 or more "Areas". I want to be able to instantiate only one Area of these Server-Side to allow changing a Weather per Client for example*


Hopefully someone can help me with ideas/implementaions,

BR,
Christian

Comments

  • Tobias
    Options
    It's good that you plan to keep Zones inside a single machine's boundaries. It makes things easier.

    > Reconnection the Client to the new Server and save all Data in DB fom Old Server and Query all Data from DB on the new Server?
    Reconnecting has the benefit of being directly in contact with whatever server a client needs. In worst case, you can keep connections to more than one server.
    Saving data to the DB makes sense, as you can't trust clients to connect to another server in all cases (they might be shut down before that).
    So, yes, in general this sounds like you should do it.

    I don't really get what you're after with question 2. But then, I'm not a WoW gamer ;)
  • chris
    Options
    Hi Tobias,

    So it is good to hear the zoning the World would be good.
    BUT: My Question is, how would i implement this that my Server recognize it when my client walks from one zone to another?
    Just OpCodes from Client and Server dont know where he is?

    Or what would you recommend?

    Question 2 is not that neccesary right now..

    Thank you in advanve
    Regards,
    Chris
  • duke
    Options
    Keep in mind that you don't want a situation where a player is running back and forth over a zone boundary, thus triggering the server transfer continually.

    The server transfer itself entails connecting the player to both servers and doing necessary calculations on both at once, until the transfer is complete, and the previous server can discharge itself. In other words, server boundaries are soft boundaries, with transition zones rather than hard switch-overs. There are many edge cases to take care of, for example, transactions should only take place on one of the servers, and any combat should only take place on one. In other words, your setup ought to be tolerant about where a service is located.

    edit: I see you're not talking about a seamless word. In that case, transfer every non-db persistence data about the player to the other server, and confirm it got it. Second server should receive this, verify it, connect to player and grab any necessary stuff from the db (AFTER first server has released its responsibility for that player).
  • chris
    Options
    Hi Duke,

    thank you for your answer.
    The things you mentioned are already built in. Thanks!!
    I transfer the Character objekt to the other ( new ) server and do a cross check with the DB.

    The bounding between Zones ( Severs ) iam doing so:

    If the Player leaves Zone A ( on Server A ) and gets into Zone B ( on Server B ) the connection to the Server B is already opened before he reaches the end of the grid.
    The Connection of Server A is not closed then immeaditly. It is Closed whenever a Client Leaves Zone B to another Zone ( regardless of any other Server ) perhaps on Zone C ( on Server B too ) . With this i can get the Problem of "Hopping" between Servers on a Zone change if the Player runs in a circle on the Zone Line :)

    BR,
    Christian
  • Tobias
    Options
    BUT: My Question is, how would i implement this that my Server recognize it when my client walks from one zone to another?
    Just OpCodes from Client and Server dont know where he is?

    In the other posts it sounds like you solved this already.
    There are many implementation options. If the servers should control which position maps to which zone, then you will have to send your client's position to the server. This would be some operation.
    To send the "switch zone, connect to server X" to the client (when it's position belongs to more than one zone) use either way:
    Send an operation return or
    send an event.
    Just cause you send an operation result in this one case, doesn't mean you have to do that all the time. Sending the info by result fits nicely into the pattern "client does something and gets a result".

    Or did I misunderstand your question again? :)