Poll for information

From: George Greer (greerga@circlemud.org)
Date: 08/20/01


I think it's rather useless for a MUD to still print:

Inventory:
a bread
a bread
a bread
a bread
a bread
a bread

So I'm investigating a method of combining objects.  Currently I have two
options:

a) Keep everyone's inventory sorted and count number of duplicates. (Gets
messy if an object is modified while sorted because it may have to move
position.)

b) Keep a 'multiple' count on each object to specify how many of that item
this particular obj_data structure represents.  Any modifications to an
object would be treated under the same principle as copy-on-write.

So I was wondering if anyone with a large playerbase could give the
following two numbers:

  1) The number of unique objects owned by players.
  2) The number of objects owned by players.

The following two lines should do that (Bash shell):

--- 8< --- #1 --- 8< ---
for i in lib/plrobjs/*/*; do bin/listrent $i | grep '^\['; done | sort | uniq | wc -l
--- 8< --- #1 --- 8< ---

--- 8< --- #2 --- 8< ---
for i in lib/plrobjs/*/*; do bin/listrent $i | grep '^\['; done | wc -l
--- 8< --- #2 --- 8< ---

From that I'll be able to determine how frequently multiple people
cart around numerous items besides the obvious "30 bread in a bag."

Side note: This was actually prompted by reviewing the shop code.  It'll
allow a lot of cleanup if the generic code were to sort or count objects.
As a side benefit we would no longer have to put up with large screens of
duplicates in a room or inventory.

--
George Greer
greerga@circlemud.org

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST