Item vs Actor?

edited July 2010 in Photon Server
I don't really understand the difference between Items and Actors in the Mmo namespace of Photon. From what I thought I understood, Items represented everything in the world, such as NPCs and players (i.e. Player would inherit from Item, and NPC would inherit from Item). However, Player's in fact seem to be Actor objects, but I don't know what the difference between the two is.

Can someone explain?

Comments

  • zoultrexzoultrex
    edited July 2010
    I think item is whatever entitie you have in a world.
    And actor have an item representation in the server world, i think thats the way the communication is done to the other items(players and npcs).
    But an item class itself does not make things happen in unity like make your player mesh move or get the keyboard inputs or change the gameobjects properties, thats where Actor comes in with with the player class.

    If you have a look at the actor class there is almost no mention of the server functions.

    The way i see is, Item is totally focused to talk to the server, the actor is totally focused on controlling things in unity, and the player class is in between, getting stuff from the server and the items and working them alongside with the actor clas.

    But thats me, maybe im wrong.

    I would also like to see the definitions and differences of Item, Actor, Player AND also Avatar, i dont get the avatar very much.
  • zoultrex, you keep mentioning the client, but I'm asking specifically about Actor on the server (Photon.SocketServer.Mmo.Actor)
  • Oh i see, that just puts me completly off track then.
    It would be nice to hear it from them then =)
  • zoultrex wrote:
    Oh i see, that just puts me completly off track then.
    It would be nice to hear it from them then =)
    Sorry for the confusion! I do appreciate your help though.

    For the most part, I think a lot of what you said also applies to the server. At first I would have expected Actor to inherit from Item. That would have made the most sense. However, Actor is capable of containing multiple items and interest areas. I don't understand why there would need to be support for an actor having more than one item. I would guess that Actor only needs 1 item, and that would be its physical representation in the world (Avatar).

    Actor looks to be a bit pointless. I don't see what value it adds to Photon's MMO framework. With my current understanding of Actor and the surrounding system, I could simply inherit my own Actor class from Item and use that instead. At this time I fail to see a need for Actor. I also don't understand what value it adds to the system. These are the questions I would like to see answered.
  • Mee too, one thing that would be nice is if other developers that are using or used photon on their projects could come in here and help us a bit, like what people do in unity forums, even if they are not part of the team they help each other.
    That makes me think how did the other developers managed to use photon successfully in their games.
    I wish network programming were "generic" and we could learn about the server framework by books or other resources online but it doesnt seem like thats the case.
  • BorisBoris ✭✭
    The Actor is the connection between the client peer, its items and its interest areas.
    The MmoActor is also the peer's operation handler after entering the world.

    You are right, the Actor could be an Item. However, what if you just wanted the Actor to be a spectator with no representation? Even one item would be too much.

    Why an Actor can have multiple items: Assume the player can have a pet or another inventory item that he can show others. Such items are very similar to the actor representation: they need to move, have properties, send events, and they have to vanish when the client disconnects.
    So why not just reusing the mechanism of the actor representation and use it for all items?

    You did not ask, but I'll answer it anyway:
    Why an Actor can have multiple interest areas: For level flights, to be able to look through the eyes of others, for binoculars, ...
  • BorisBoris ✭✭
    Don't know if you've seen it, but you can spawn multiple items in the WinGrid client by pressing insert, they appear as bot in the world.
    When you press F5 in the Island Demo it shoots an item (a ball) with an interest area attached away from the player, and suddenly you can see players further away around that ball.
  • Boris wrote:
    The Actor is the connection between the client peer, its items and its interest areas.
    The MmoActor is also the peer's operation handler after entering the world.

    You are right, the Actor could be an Item. However, what if you just wanted the Actor to be a spectator with no representation? Even one item would be too much.

    Why an Actor can have multiple items: Assume the player can have a pet or another inventory item that he can show others. Such items are very similar to the actor representation: they need to move, have properties, send events, and they have to vanish when the client disconnects.
    So why not just reusing the mechanism of the actor representation and use it for all items?

    You did not ask, but I'll answer it anyway:
    Why an Actor can have multiple interest areas: For level flights, to be able to look through the eyes of others, for binoculars, ...
    Excellent explanation. Thank you. You should certainly put this in your documentation somewhere.
  • One other question. In the MMO Demo server, every MmoItem has an owner. However, what about NPCs? These do not map directly to a peer, and thus having an owner for them (assuming we represent NPCs as Actors) wouldn't make much sense. Would it make sense in this case to make MmoItem actually MmoActorItem (deriving from Item) and have MmoNPC derive from Item?
  • BorisBoris ✭✭
    yes, you can find a similar discussion here: viewtopic.php?f=5&t=69
  • BorisBoris ✭✭
    well, the solution here: viewtopic.php?f=5&t=69&start=10#p429
Sign In or Register to comment.