Multy worlds problem

Options
oman
oman
edited June 2012 in Photon Server
In my project, I need create several worlds(map or scene), but if when one player exit from one world and enter to another, it must destroy the actor and the create a new one(even interestArea or item) , because the world is related to them(the vital is the world has not a setter, and only can be set with constructor), but this is very ineffective, if the world member has a setter, the problem will be settled, any other way?

Comments

  • dreamora
    Options
    don't destroy it, simply register and unregister the desired interest areas.
    The MMO sample project has no concept of worlds, its for a single continous coordinate space, as such it does not care about such 'world limitation' and your code that handles the IA registrations can make good use of that for your own purposes :)
  • oman
    Options
    Very fast response, thanks very much.
    How to register and unregister the desired interest areas ? how to change the world related to the interest area?
    How to change the world related to the player actor and it's avatar item if I don't destroy them and recreate them?

    such as i have two world(map or scene), worldA and worldB, when a client connect to the server, the server create an actor and an ia like this: Actor act = new Actor (...worldA,......), InterestArea ia = new ClientInterestArea(...worldA...), if the player exit the worldA with teleporter and enter to worldB, I think I must destroy the actor and ia and recreate them to relate them to the worldB, right? any way else to avoid that?
  • dreamora
    Options
    Actors can not change worlds. Those are distinct spaces, if you want to transit from one to the other you need to disconnect and reconnect to the new world (how its done in any MMO upon server transition).
    If you work with manually controlled IAs and an expanded MMO example framework its not needed to do that, but it has its own limitations and you will definitely need to implement different aspects yourself (but that shouldn't be a problem, for an MMO you are going to heavily work with the Photon MMO code anyway as it only handles the network data syncronization and thats a few percents of the server / backend code you are gonna write for an MMO)
  • oman
    Options
    as i know, photon's mmo world just like a map which is devided into many cells, not the " world" as the wow, so I think when i exit from a world(map) and enter to other, it needn't disconnect and reconnect, I just want to change the world and anything else is the same,. I am confused.
  • dreamora
    Options
    Photons MMO world is a single continous space.
    The cells are only for interest management and is how most MMOs out there work actually, otherwise you get a network bandwidth usage explosation that already at 200 CCUs easily exceeds a GBit uplink
  • oman
    Options
    first thanks very much dreamora, but I am the first time developping mmo game server and using photon, so there is many problem.
    In my project, my mmo world is not a single continous space but have many scene(gridWorld), every one has it's own boundary、cell dimension and coordinate, and in one application(one game logic sever) every world can be handled(not one app handle one world), as for bandwidth usage explosation problem, it is settled by expand other logic server.
  • dreamora
    Options
    Your use case sounds like you could benefit from using Lite and backporting the IA mechanism or implement an own network scoping functionality that limits who is receiving what data (as not everyone needs everything, otherwise your zones will be limited to a few dozen actors including NPCs or only very very few zones - unlikely the target you are after ;))

    Doing the IA through a simple grid for spatial seperation is the easiest approach there :)


    If you use the MMO framework, the easiest way to tackle your problem is implementing own logic for the InterestArea registration and unregistration and/or work out and expand the existing world functionality