Original Post
Hi, I''m drafting the design for the server side of my multi-player game.
I am having some trouble with hierachy and cross referencing.
Lets say I had a door with a key. I put the door inside the object level, or floor or building. Then I put the key object inside the player object.
If the player arrives at the door they collect the serial number for the door and if it matches the serial number for the key the door is opened.
Similarly I have a graphical player representation object. This is also kept in the worldmap object. When the player arrive in the world the server returns all things proximity range to them. So they get the player.
Lets say the owner of that player logs in or out. This means the players graphical image might be ''asleep'' and not ''live''. Again I could use a serial number but how do I get access to the player to change him/her?
It seems that the owner would have to scan the entire map to find the player that belonged to him.
OK so maybe we turn it around the other way. This time the ''other'' player, who is looking into the world for nearby players has to scan the complete player list for nearby players!
This is what i''d call cross referenced objects. The object is repeated for the reason of what it will be used for. This kind of thing feels wrong when OOP is meant to be so well organised and encapsulation issues too!
Do I need three objects? A player object. A player ''map-foot print'' object and a ''admin player access'' object?
How can I arrange these so that when I add the player it all constructs correctly.
Now my hierachy mindset says I should but the ''admin player access'' and the ''map-foot print'' into the player object! How can they be in that and in the map and admin areas at the same time? Help!