#Loot table/Item database

1 messages · Page 1 of 1 (latest)

topaz storm
#

Looking for a sanity check for my design for a loot table/item database

I'm thinking of having an autoloader have a very long enum of all the items in the game. I will then create a dictionary in the autoloader with these aforementioned enums as its keys. The values stored in this dictionary will be the data behind these items.

When it comes to enemies dropping items, I will add which items I want them to drop manually for each enemy by declaring a dict of enum -> drop chance. When they want to drop an item they'll just ask the autoloader for the data needed to load it. Does this make sense? I sort of instinctively feel that an enum that large will be very unwieldy but also I feel like other approaches will rely on using strings which can lead to problems with typos/autocompletion

tawny compass
#

This sounds like a solid and rather standard way of doing things. You can go a step further and make resources for the items if you want, and make the dictionary load the resource. Gives a nice built-in feel to editing the items (this is by no means required)