[Divunal-devel] The Problem with Perspectives

James Knight jknight@MIT.EDU
Tue, 20 Jul 1999 12:15:37 -0400


At 9:09 AM -0400 7/20/99, Michael Dartt wrote:
>How about this:
>
>As it stands, we already have to generate a list of objects based on the
>person's perspective when the person enters the room.  Why not maintain
>this list while the person's in the room, and query it instead of the
>normal room list to avoid perspective processing every time a person
>performs an action?  To save space and increase speed, the lists could be
>associated with the given perspective "tag"/property, so that if there are
>multiple people in the same room with the same perspective, you only have
>to maintain one list for all of them.

The usual case is that either people will see an object normally, or will
not be able to see an object at all (say the room is dark or something).
So, it makes sense to optimize for these cases, and special case a slower
method for anything else (e.g. name being a dynamic property).

The perspective idea is good, except that you can manipulate objects not in
your perspective. Right now you can manipulate things in the current
location, in the outermost location, in your inventory, and in
your focus. So you'd have to keep a up-to-date list of all those places.
Not to mention that focusRefresh is (currently) the only notification
mechanism available. But that could be changed...So maybe a good way to do
it is to cache the items' 'perspectivised names' for each player in a
seperate table in the location until a refresh gets called on it, at which
point the cache has to be flushed. This would avoid doing the dynamic
property evaluation for each Thing lookup, which would really suck.
Instead, two table lookups have to be done for any location that has a
dynamic-named thing in it, which is much faster.

Keeping a shared perspective tag probably won't help in many situations,
and will just complicate things a lot.
-James

--
You are in a maze of testy little Java VMs, all subtly different.