[Reality] getting started?

Eric Wong reality@twistedmatrix.com
Sun, 24 Aug 2003 13:29:03 -0700


On Fri, Aug 22, 2003 at 01:52:05PM -0500, Glyph Lefkowitz wrote:
[cut]
> However, I can recommend the excellent paper by Allen Short (and, 
> nominally, myself), "Twisted Reality: A Flexible Framework for Virtual 
> Worlds", which was presented at PyCon 2003 in DC this year.  It should 
> at least give you a good idea of where we're trying to go.
[cut]

Hello again.

Thanks for the pointers!

I've read the paper and started the servers in sandbox/ and I've poked
around the code a little bit and now I'm trying to wrap my head around
the whole interface/adapter way of doing things.  Would it be more-or-less
right to distill TR's philosphy to this one sentence?

    In TR, "things" interact with one another through their "adapters"
    which conform to and implement "interfaces", all of which are objects.

For example, if I wanted to add the ability to speak to players, I'd
first define an interface ("ISpeaker" and "IListener", or if I were using
action.TargetAction, "ISayActor", "ISayTarget" and "ISayPlace") write
an adapter that implements that interface and register that adapter it
to things.Player or things.Actor.  Then, later on, if I wanted to make
a Bugs Bunny-like Singing Sword, I could just register the same Say
adapter to an ordinary sword (thing with Weapon adapter).

This is probably a common complaint from someone not used to interface/
adapters, but one thing that sort of bothers me is that an objects's
adapters are registered in the adapter, not with the object.  For example
Actor is defined in things.py, but the Damagable interface is registered
to Actor in harm.py.

Eric