[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tads3] knowledge / 'seen' / npc knowledge base
- From: "steve breslin" <versim@xxxxxxxxxxx>
- Subject: Re: [Tads3] knowledge / 'seen' / npc knowledge base
- Date: Wed, 10 Sep 2003 20:37:53 +0000
- To: tads3@xxxxxxxxxxx
Mike replied, quoting me:
Let's have two vectors for each actor, one for 'knowledge' and one for
'experience' or something like
that.
I'd probably use a lookup table rather than a vector, since it's much
faster to find a key in a lookup table than a value in a vector.
I'm not sure I understand. I'm thinking of lookup table like a mapping of
keys to values. Do you mean that we'd just be looking for the presence of
keys, and never assign values, or assign boolean values for keys? Presumably
the key would be the potentially known objects; the lookup table would be
specific to the actor?
If we have a basis for this in the main library, any modules which need to
deal with NPC knowledge don't have to write a new mechanism for doing
this.
My inclination has been to leave things as they are in the base library,
which already has the necessary *interfaces* to track known/seen status per
object and per actor.
I'm trying to argue for simplifying these interfaces into simple
implementation. As far as I can tell these interfaces are somewhat painfully
complicated; it would seem easier to provide support for NPC knowledge out
of the box. One good thing about such a simplification is that there's a
number of different ways these number of interfaces could be deal with, and
it would be nice if different NPC-knowledge-relevant modules were dealing
with these interfaces in the same way.
I suppose it might end up a wash in terms of memory overhead, though, if
per-actor knowledge is optional at run time according to the existence of
each actor's knowledge tables. I think it would cost a bit of cpu, though,
since there'd be a lot of testing for the existence of the PC's knowledge
tables.
I don't see this as a lot of testing, and only a tiny bit of cpu. Make Actor
a preinit object, and check for the existence of a memory table. Or you can
probably suggest an even more efficient solution.
Anyway, if you still don't like including this in the main library, I think
I'll write up a quickie NPC-knowledge module.
_________________________________________________________________
Send and receive larger attachments with Hotmail Extra Storage.
http://join.msn.com/?PAGE=features/es