[Divunal-devel] The Problem with Perspectives

Glyph Lefkowitz glyph@divunal.com
Tue, 20 Jul 1999 12:46:21 -0400 (EDT)


On Tue, 20 Jul 1999, James Knight wrote:

> At 9:09 AM -0400 7/20/99, Michael Dartt wrote:
> >How about this:
[snip]

> 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).

That's pretty much the case.

> The perspective idea is good, except that you can manipulate objects
> not in your perspective. Right now you can manipulate things in the

The word `perspective' is really vague here.  I think what you mean is you
can manipulate objects out of your *focus*.  You can't just manipulate
random objects anywhere.

When I was using the word "perspective" I was referring to the feature
that allows the same thing to look different to different people -- it's
not a technical term so let's not use it as one.

> 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

I've made a few baby steps in that direction in Location and Room, but
yes, updating needs a lot of work.  1.1.

> 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.

Dynamic property evaluation is to be minimized wherever possible... but I
am afraid I don't really understand the *other* method you're talking
about here.

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

I suppose I don't understand what you mean by a "shared perspective tag"
here -- it seems to me that you are both proposing the same thing.

I think that a good way to do this might be just to cache a second table
of synonyms for the *object* rather than the player.  That way, if bob
turns into the Masked Man upon putting on his Super Conceal-O-Matic Mask,
you can still refer to him as 'bob'.  Also, after he takes *off* the mask,
it seems appropriate to be able to refer to him as 'mr. mask' or
something.

I have a feeling this might just be me and my infocom nostalgia though --
it made sense to me if I played a game and I found out something was a
scepter after a while I could still refer to it as a stick, or when I
restarted the game I could refer to it as a scepter before my character
knew of it as such, because it made more sense to me that way.

I think this (being the change in structure of hears()) is the last major
change that should happen before the 1.0 release.  Everything else we want
to do can be done pretty well within the framework that exists -- although
I think that better docs are a necessity to call this thing a "release".  
Javadoc'ing needs to happen in the source code, and a lot.

--glyph