[MUD-Dev] data structure design in a new mud
J. Coleman
stormknight at alltel.net
Tue Mar 13 22:13:00 CET 2001
pauli.saksa at ztango.com wrote:
>> From: "Justin Coleman" <JMCOLE at ENOREE.DJJ.STATE.SC.US>
>> I seem to be doing fairly well with the player and room structures,
>> but it seems to me that there's no "clean" way to have one list of
>> all the items in a world without having ungodly numbers of pointers
>> back and forth.
> The question, how I see it, is whether to have one central list of
> items in addition to smaller lists or not. Those smaller lists have
> to be there in some form or the other.
Exactly. I wanted to know if there was any way to do the central list
without 50 billion pointers back, forth, up, down, and sideways.
> A central list allows some operations that smaller lists do not,
> e.g. fast searching of items. Also general administrating of items
> would be trivial to implement with a central list. There are down
> sides as well. How the indexing would be done? I.e. How to make a
> difference between two similar items. I'd hate to force my immortals
> to 'add item #24562 to this mob'.
It also (IMO) lends itself more to the "x copies of y item, w copies
of z item" that seems to be used on most every mud there is. We don't
particularly need locate item spells, but we do plan to have mobs
create 99% of their own equipment through the same crafting system the
players use. I think it might be easier to just keep the smaller,
inventory lists in this case.
> The more interesting part of the topic is the connections between an
> item type and an item instance. If a blacksmith wants to create a
> sword, where does the code find the correct attributes? If a
> blacksmith creates 20 similar swords, all the attributes don't have
> to be stored separately in the memory for each sword.
Well, the way I plan to handle this is to have the crafting code do
this automatically, not just reading from a data file and making a
copy. No reason to have extra startup time, and no significant
disadvantage (on a small mud, 50-200 ppl online) doing it this way
that I can see.
> In our model each item has two different sets of attributes: item
> type data (=shared) and item instance data (=unique). Shared data
> is actually shared in the memory as well. In addition to saving
> memory, this is a major step towards easier balancing: if some type
> of a sword is too good, all swords of that type can be downgraded in
> one place.
All data, the way I plan it now, is unique, or at least separately
kept in memory. Since the game is based on a LARP I help run,
everything's pretty well balanced already.
> If there's no central list of item instances, should there at least
> be a central list of item types? Item types can be easily forced to
> have unique names since those names don't have to be seen by
> players. An instance of 'sword done by human blacksmith' and an
> instance of 'sword done by orc baker' may both be called 'a sword'
> without core dumps. With a central list of item types, one could
> define several types of items for a blacksmith to create. Although,
> this could be done without a central list as well.. so.. you
> choose :-)
Doesn't matter to me. They're both "a sword", they do the same damage,
have the same weight, etc etc. The stats will vary a little bit
depending on skill level, materials used, and all that, but basically
all weapons of a given type are the same.
-Justin
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list