Skip to main content
gamedev.net
🔒 Locked

OOP drafting

Started by plugwatson Feb 22, 2003 at 1:07 PM 1 replies 600+ views
Original Post
plugwatson
plugwatson
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!
Shannon Barber
Shannon Barber
pointers
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
plugwatson
plugwatson
Good answer. So as I''m using Director lingo to makae this game which has no pointers I have to think like this...

In lingo when you copie a list unless you add .duplicate() to the end of the function your only referencing the list. Which is good if you want it. So that''ll be really complicated then :-) Thanks for the solution.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.