[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUDs
. -> [Folder]  MUD Design Concepts
. . -> [Subject]  Drop/Loot tables
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Drop/Loot tables

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Serenity   (18 posts)  [Biography] bio
Date Tue 01 Sep 2009 10:58 AM (UTC)
Message
Hi Everyone,

I'm working on a C++/lua based Mud that's progressing nicely. It's using a C++ engine, XML files for area/room/mob/item definitions and lua scripts for the dynamic stuff.

I'm currently working on Drop/Loot Tables. There are several options:
* specify in xml files, like
<drop_table id='goblin_rare'>
<item id='sword' chance='80' />
<item id='gem' chance='10' />
</drop_table>
* or use lua drop scripts on a mob.
The first solution would be static, but easy to use for
builders; the second one would be more dynamic but more
work for simple drops.

Any ideas on this? or other solutions?
[Go to top] top

Posted by Nick Gammon   Australia  (21,324 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Tue 01 Sep 2009 09:04 PM (UTC)
Message
The general idea sounds good to me. I think I would use a drop table on a class of mobs, rather than a particular one - except for rare mobs perhaps, like bosses.

For example, any humanoid-type mob, level range 1 to 10, might drop linen, levels 11 to 20 might drop wool, levels 21 to 30 might drop silk, etc.

Humanoids might be carrying gold, so they might drop a random amount (again depending on their level as to the exact amount).

Mammals might "drop" skins, and so on.

I think putting Lua scripts on individual mobs might make it harder to control a consistent drop pattern. Having overall rules that get applied to mobs in general would probably be easier to control.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Erendir   Germany  (47 posts)  [Biography] bio
Date Reply #2 on Wed 02 Sep 2009 03:55 AM (UTC)
Message
IMHO the item drop system of Diablo 2 is one of the best, so I recommend to read the text at
http://forums.diii.net/showthread.php?t=412453
and perhaps play a bit with
http://diablo3.ingame.de/tips/calcs/dropcalc/dropcalc.php?lang=en&patch=110&mode=lod&interface=default&window=true
(a Drop-Calculator)
[Go to top] top

Posted by Serenity   (18 posts)  [Biography] bio
Date Reply #3 on Wed 02 Sep 2009 11:07 AM (UTC)
Message
The difference between Diablo and a Mud is that Diablo is created/balanced by a small group of people with a lot of knowledge. In muds, content is created by many people that dont (have to) know a lot, but want to create a cool area. So there must a balance between a complex system and a simple system.

* It must not be too much work to add a mob/class with a simple loot system
* The loot system must be flexible enough to allow special cases. (quest only drops, etc)
* The system must be easy to understand without studying.

I'm not sure what system fits this description.
Maybe a system where the basic things are very simple, but complex things are possible... Sounds obvious....hmm
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #4 on Wed 02 Sep 2009 04:08 PM (UTC)
Message
Serenity said:
Maybe a system where the basic things are very simple, but complex things are possible... Sounds obvious....hmm

Why not simply have both?

Have a library of standard loot-drop scripts that people can set as-is on their mobs. Then, allow overriding that with a script that intercepts the standard loot-drop script, and does its own thing.

You can extend this by something like what Nick said, where a mob created of race X, class Y and level Z is automatically associated with a loot type template. That way, mobs will always drop stuff that's appropriate. Builders can override things if a particular mob happens to be richer than it should be (say, change the template to the "rich man" template); and if they really want control, they can drop into custom script mode.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by KaVir   Germany  (117 posts)  [Biography] bio
Date Reply #5 on Thu 03 Sep 2009 03:50 PM (UTC)
Message
I just supply each mob with its own sequence of droppable items, with an optional weighing added to the front - so "sword gem 3:none" means there's a 20% chance of a sword, a 20% chance of a gem, and a 60% chance of nothing. Placing a "*" in front of the item name indicates that it should be assigned magic bonuses, and it's also possible to specify material and colours by use of commas, eg "*trousers,leather,black" would create a pair of magical black leather trousers, while "*ring,metal" would create a magical ring made from a randomly selected precious metal.

The names can also be prefixed with "!" to indicate that the drop is a creature rather than an object.

It's pretty simple but it does the job, as most of my creatures only drop a small selection of item types.
[Go to top] top

Posted by Nick Gammon   Australia  (21,324 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Thu 03 Sep 2009 09:25 PM (UTC)
Message
I still like my idea of global loot tables. That way the overall MUD designer can have consistent loot drops. Having individual builders set up loot tables lends itself to the very high likelihood that some areas will be more generous than others.

I would start by grouping my mobs into broad categories, eg.


  • Humanoids
  • Undead
  • Animals, like wolves, bears
  • Insects, eg. spiders
  • Marine animals, like fish
  • Elemental apparitions, like fire elementals


It makes sense for broad groups to drop different sorts of things.

Then you might decide that the maximum number of items in a particular drop might be 4 or 5.

For each item group, you could have something like this:


  • Group 1 - gold. Drop gold in a random range (eg. 20 to 50)

  • Group 2 - good equipment. (eg. nice swords, armour)

  • Group 3 - poor equipment

  • Group 4 - junk


Then each group could have a probability you get anything at all from the group (eg. 80% chance of some amount of gold, 1% chance of good equipment, 10% chance of poor equipment).

Once you decide that a group will drop, the group itself could be a list of possible items, from which one is selected randomly.

This system stops some mobs dropping 4 good items, and other mobs nothing, as the most you would ever get is one good item.

You could add to this:


  • Zone-wide rare items (maybe something that starts a quest)

  • MUD-wide very rare items


Any quest-related item could then be added by builders to their own mobs. Obviously if a particular mob needs to drop a key, then this has to go on the mob by the builder. But general "nice to have" loot would be better handled by the global loot tables.


The loot tables I describe would then need to be designed for level ranges, so (say) levels 1 to 10 have one batch of tables, and levels 11 to 20 another batch.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Hanaisse   Canada  (114 posts)  [Biography] bio
Date Reply #7 on Fri 04 Sep 2009 01:29 AM (UTC)
Message
I like the way you think Nick. That's almost exactly the kind of 'random loot/drop' system I've been thinking of since I started developing my Mud but I'm not a coder so would most likely never be able to pull it off. I'll probably do a quasi-loot system with mud_progs.

aka: Hana
Owner in Training of: Fury of the Gods
alm-dev.org:4000
[Go to top] top

Posted by KaVir   Germany  (117 posts)  [Biography] bio
Date Reply #8 on Fri 04 Sep 2009 09:22 AM (UTC)
Message
Nick Gammon said:
I still like my idea of global loot tables. That way the overall MUD designer can have consistent loot drops. Having individual builders set up loot tables lends itself to the very high likelihood that some areas will be more generous than others.


If you're using some sort of random item generator for the loot, then you would presumably already be basing the power of the items on the level of the mob that dropped them. But even if not, it wouldn't be complex to scale the bonuses based on the mob. For item types that are innately more powerful than usual, you could just specify a minimum mob level at which that item can be selected as loot.


Nick Gammon said:
I would start by grouping my mobs into broad categories, eg.

*Humanoids
*Undead
*Animals, like wolves, bears
*Insects, eg. spiders
*Marine animals, like fish
*Elemental apparitions, like fire elementals


It would obviously depend on the specifics of your design, but personally I like to base the loot on things the individual creature is using, or (for creatures which don't use any equipment) something that could reasonably come from its body.

A fire giant carrying a bronze greatsword might well drop a magic bronze greatsword, but he wouldn't drop an iron greatsword or a bronze shortsword - and a hill giant armed with a cudgel shouldn't drop any type of sword at all. Categorising them both as humanoid wouldn't really help me. Even a loot table for "fire giant" wouldn't help that much, as another fire giant wielding a greataxe should have its own loot table.

I could define a "drop something based on what you're carrying" option, and that wouldn't be too bad, although it wouldn't fit my design requirements so well.

I tend to treat animals, insects and fish in much the same way. None of them carry equipment, so they each drop a piece of craftable material - whether its wolfskin, bearskin, sharkskin, chitin, dragonbone, etc, would depend on the individual creature. I suppose these could also all be categorised as a single "drop a piece of craftable material based on your race" option.
[Go to top] top

Posted by Wjmurdick   (13 posts)  [Biography] bio
Date Reply #9 on Wed 09 Dec 2009 06:19 PM (UTC)
Message
Its a bit more complex, but here is how one MMORPG that I am rather familiar with did it:

You have two types of data:

1. Treasure Tables
2. Monster Treasure Lists

A Treasure Table is a pre-defined set that contains a list of items, each with a given weight and maximum drop quantity. Weights are relative to the total weight of all items in the table.

TreasureTable_Spider
- Spider Venom, weight=25, max=1
- Spider Webbing, weight=65, max=1
- Severed Spider Leg, weight=10, max=1

This would give the Spider Venom a 25% chance of dropping if this table were called (25 / 100).

Now, you also have Monster Treasure Lists. These are defined on the monster itself and refer to Treasure Tables using relative weights and max quantities. The monster also has a min/max of items it can drop (# of pulls from the tables).

Spider
- Min=1, Max=1
- TreasureTable_Spider, weight=45, max=1
- TreasureTable_RareLoot, weight=5, max=1
- EmptyTreasureTable, weight=50, max=1

So basically 50% of the time you would get no loot, 45% of the time you'd get something from TreasureTable_Spider and 5% of the time from TreasureTable_RareLoot.

What this does is allows you to manage what mobs drop without having to alter each and every mob. You want to add another item to the rare loot table, next load it will be there and available to players.

The downside to this system is it can be complex and it is harder to get an idea of the overall drop-rate of individual items. For example, if you were looking for Spider Webbing using the data above your effective % chance would be 29.25% (45% to call the Spider table, 65% to get Webbing inside that table).
[Go to top] top

Posted by Serenity   (18 posts)  [Biography] bio
Date Reply #10 on Thu 10 Dec 2009 06:03 AM (UTC)

Amended on Thu 10 Dec 2009 06:13 AM (UTC) by Serenity

Message
A very nice description, thanks!

2 questions though:
In the monster treasure list, there is a general min/max.
So a min=3, max=3 will make 3 passes of the list.
Does the max in
- TreasureTable_Spider, weight=45, max=1
mean that of the 3 passes, a max of 1 drop can come from
that treasure table?
or is it that if TreasureTable_Spider is chosen, it takes
the <max for that table> rolls on that table?

The 2nd question is how would you use that system take make
sure one specific item always drops? (but the rest is still random)


[Go to top] top

Posted by Wjmurdick   (13 posts)  [Biography] bio
Date Reply #11 on Thu 10 Dec 2009 01:53 PM (UTC)
Message
Serenity said:

A very nice description, thanks!

2 questions though:
In the monster treasure list, there is a general min/max.
So a min=3, max=3 will make 3 passes of the list.
Does the max in
- TreasureTable_Spider, weight=45, max=1
mean that of the 3 passes, a max of 1 drop can come from
that treasure table?


Yes, correct. Once a table reaches its maximum it is removed from the available list to choose from.

Quote:
The 2nd question is how would you use that system take make
sure one specific item always drops? (but the rest is still random)


You set the weight to something like 999999 and the max to 1. That way it will always be called first and then removed. There are other ways you could handle it that might be more elegant, however. You could have a flag (always drop) or something of that sort.
[Go to top] top

Posted by Serenity   (18 posts)  [Biography] bio
Date Reply #12 on Wed 23 Dec 2009 06:53 AM (UTC)
Message
I've implemented the loot system as described above and find it easy to use. great!

Now i want to extend it to containers (chests, etc)
The problem is now how to reset it? With creatures it's easy, you kill it, create a corpse and fill that. With chests, how would you do respawn?

My current system has a per-item/creature respawning system, so that when you kill a creature/pickup an item, after a certain time, it's respawned. With random loot (or multiple items), what would be the best way? I could set the respawn trigger on any item being removed, to avoid a container being slowly filled with continuous respawn.

Any ideas?
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


14,759 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]