[MUD-Dev] Naming and Directories?
cg at ami-cg.GraySage.Edmonton.AB.CA
Tue Mar 16 23:05:37 New Zealand Daylight Time 1999
[My stuff about costs of NPC activation snipped.]
>Ever heard of event driven interaction?
Sure. I'm completely event driven - no polling, no broadcasting. The
search I'm talking about is a fast scan down an in-memory linked list,
doing about 2 compares per node. It was *that* that became too expensive
when the counts got large.
In your description of Diku/Cthulhu events, one detail you don't mention
is this: does the in memory data structure for a room contain a list
(or array, whatever) of the characters and NPC's that are in the room?
Such structures having to be updated every time they move. My system
is disk based, not memory based, so doing that directly isn't an option.
So, secondary, in-memory data structures are used for active characters
and agents. Before getting a machine powerful enough to handle hundreds
of active agents, my simple linked list was completely adequate. The
cost being order N squared, combined with the much higher count, has
forced a redo of the tradeoffs - its now quite a bit more complicated.
But then, such tradeoffs is what programming is all about.
Don't design inefficiency in - it'll happen in the implementation.
Chris Gray cg at ami-cg.GraySage.Edmonton.AB.CA
MUD-Dev maillist - MUD-Dev at kanga.nu
More information about the MUD-Dev