About Mmo Actor class

xzlxt720
xzlxt720 ✭✭
edited January 2012 in Photon Server
I'm trying to write a MMO project, I found the MMO example of the actor class does not seem useful, it seems that what the actor class done the peer class can done, without actor class the project can run as well, then I confused.

In the docs I found that when the state is connected, the message in the peer processing; in the state for entry into the world, the message handling in the actor; in disconnected, back to peer. If I write a handle array processing all messages in the peer without using actor, is that Ok? What problems will arise?

Comments

  • If you correctly forward everything so interest management etc etc all still works, then thats fine I guess, but keep in mind that Actors are used for much more than only networking. The whole interst management and alike is hooked in on top of it while peer really is only for the networking and as such 'not relevant' for your code as the actor is in states, the actor 'sees stuff' and you will often need to access these informations which you can only do on the actor.

    You also limit other things if you start to move player / actor stuff to the peer when it comes to using the peer for other things (like surveilance clients / god clients for GMs etc)
  • hi,dreamora,
    Thank you for your reply, if I enter another world from a world, then I need to destroy the old actor, and then create a new one?

    Another problem is about the interest area , it seems an actor can add multiple area of interest, but the area of ​​interest is not based on the position of actors ? Multiple, overlapping areas of interest have any effect?
  • There is no 'worlds'
    MMO is written to work with a single continous world only (thus the interest management)

    If you have worlds then it sounds more like you would want to use a mix of MMO (or at least the interest management) + Lites room concept.

    As for the interest areas: yes you can have multiple ones and they will go along whatever they are owned by.
    Registering does not make it 'yours', instead it tells the owner of the interest area whenever you update (as he is interested in you not vice versa in this case).
    This is of importance if you have Area of Effect triggers but naturally on the very base its also the fundamental aspect required to do only 'distance based' network syncing, which is a fundamental requirement to do a continous world at all
  • @dreamora - I am considering creating two world, one for a low-level players, another for high-level players, all players through the teleporter inside the world sent to a different world.The size is different for each world,I will create two different GridWorld instance for each world.When a player enter a world, I will create an actor for this player in the world, then when the player sent to another world, I have to create an new actor for this player again because the actor constructor is relevant to the current world.

    As so far, I only use an interest area to see the other players, update the location of other players.You said they can do more things, can you give me a few ideas.
  • Seeing items / npcs works through IAs too and as mentioned you can also throw a fireball with an AoE effect on hit for example (spawn a temporal item at the hit position with an IA) or a firearea or whatever :)

    The idea with the two different gridworld instances is a thing I can't comment on if that would work well or not.
    Often such 'low to high' seperations are just done with different areas / continents (Tibia is a good example with its newbie island)