Jump to content
  • Advertisement
Sign in to follow this  

Item drop chance in RPG games?

This topic is 4208 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hate to plagurize an idea, but I love this game to much. google "Phrozenkeep" for more info mation if this idea intrigues you.

but in the game Diablo 2, the have seperate list for monsters, with what they can drop and a list of droppable items. Every monster has a list of what he can drop and at what percentage he'll drop it. so for example.

[BAT monster]
[No Drop] - 10%
[Gold] - 50%
[Club] - 20%
[Knife] - 15%
[Shield] - 5%

real rudementary, but that's the basics of it, now what the game does, is when the monster is killed, it starts from the beginning of the list and checks eachone based of it's chance to drop, and if nothing rolls a successful chance, it just defaults to [No Drop].

But even more in-depth, the items that can drop are put into groupings. So you wouldn't actually see a huge list of 100+ items on the monsters list, you'd see;

[No Drop]
[Weapon Lvl23]
[Weapon Lvl24]
[Armor Lvl25]

each of wich would have multiple items in the grouping with they're own chance to drop, so once you get the group pick it goes through the list of items, or even more groups in that group.

hope that gave ya some ideas.

Share this post

Link to post
Share on other sites
I'm using an oddment table to handle any kind of statistically-adjusted random spawn (in my case, the probability of ships appearing in a system when you're there).

It would work for your system, but you'd have to make sure all the oddments add up to 100. [smile]

Share this post

Link to post
Share on other sites
This is my implementaion for random drops in my eternally-WIP RPG. I much prefer a controlled way of setting a list of things mobs can drop rather than just doing a search for all possible items at the right sort of level. It lets me skew the drops so melee type mobs drop swords and shields while casters drop robes and wands.

I have a LootTable class, its rather similar to the oddments idea described earlier. Its probably easiest to just show some XML that defines a LootTable.

My average level 7 undead mob would have a loot table like this:

<LootTable id="undead-7">
<!-- DATA -->
<items> <!-- The things that could drop -->
<item id="19" chance="2" /> <!-- The total chance is arbitary -->
<item id="22" chance="5" /> <!-- I add them all up and pick between 1 and n -->
<item id="23" chance="5" />
<item id="26" chance="5" />

<Loot chance="10" pick="0" /> <!-- Again, chance totals for the "Loot" entries is arbitary -->

<Loot chance="88" pick="1" > <!-- "pick" is the number of items to drop -->
<cash min="1" max="4" /> <!-- How much money to drop (random from range) -->

<Loot chance="2" pick="0" > <!-- I may add a random "pick" range at some point -->
<cash min="2" max="6" />
<FromTable id="world-epics-10" /> <!-- Trigger another LootTable, in this case an epic loot table -->

Linking to other loot tables lets me set up a "world drop" system, where any mob of a certain level might drop certain epics or exceptional quality items. This idea is stolen directly from many MMO's.

When I define a creature I specify which LootTable it should use

<npc race="undead-skeleton" class="warrior" min-level="6" max-level="8" />
<LootTable id="undead-7" />

I always calculate the chance to drop range at run time by adding up all the entries in that category and picking in that range. Originally I was forcing the number to add up to 100, but that was too much of a burden on data entry. I was making too many mistakes, for example the last entry would never be possible because it was 100-105, etc.


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!