Reworked Item Groups

Reworked Item Groups:

I wanted to make things easier for myself by creating some generic item groups for new maptiles. That way I wouldn’t have to make huge lists of items for every maptile. But I ended up reworking the item_groups.json and making way way more work for myself, and spending more time, than I’ll ever save in the future. So that sucked. But hopefully it will at least help other people.

>First, the weights have been (kinda) regularized:

Distributions are now in a 1-100 range. 1= very rare. 50=average item. 100=very common. Some really common items/groups are set above 100 to make them show up with the right frequency; I generally put those at the top of the lists for visibility.

That should help modders, because when you add new items to existing item groups, you will know more or less what to expect. You should still look at the item groups, however, and keep in mind that the size of the group affects frequency. Like if you set an item to 10 hoping it won’t show often, but it’s on a list with only two other items set at 50, then it won’t be as rare as you might expect. A 1-100 range should also help rare items stay rare. Before items set to 1 were often on lists with a ranges of like 1-5 or 1-7, making them show up fairly often.

>Second, item_groups.json is split into three files.

The first and second files are for categories of items, the third for is specific locations. The specific lists can/should pull from the categorical lists. There are two benefits to this. First, if you add a new item, you can just add it to the primary lists and not worry about the secondary ones. If you add new type of submachine gun, just add it to ‘smg’ and that’s it. You won’t have to scour the dozens of groups and add it in every possible place you want your new gun to show up. Conversely, if you add a new location, any items people make later on will automatically show up there without the need to update those item groups.

The second benefit is that it lets you tailor item groups for locations without making a huge ass, mostly redundant, list. For example, this is the item group for ‘kitchen’:

{ "type" : "item_group", "id" : "kitchen", "subtype": "distribution", "entries" : [ { "group": "kitchen_tools", "prob": 200 }, { "group": "lighting_tools", "prob": 20 }, { "group": "dining_tools", "prob": 100 }, { "group": "fire_tools", "prob": 20 }, { "group": "alcohol_wine", "prob": 25 }, { "group": "alcohol_beer", "prob": 25 }, { "group": "cleaning", "prob": 50 }, { "group": "fruit", "prob": 40 }, { "group": "vegetables", "prob": 60 }, { "group": "irradiated_fruit", "prob": 5 }, { "group": "irradiated_vegetables", "prob": 5 }, { "group": "perishable_food", "prob": 30 }, { "group": "imperishable_food", "prob": 100 }, { "group": "canned_food", "prob": 100 }, { "group": "condiments_spices", "prob": 50 }, { "group": "cookbooks", "prob": 50 }, { "item": "dogfood", "prob": 5 }, { "item": "catfood", "prob": 5 } ] }
If you wanted to make an alternate kitchen for trailer parks, you could modify it like this:

{ "type" : "item_group", "id" : "kitchen_lowclass", "subtype": "distribution", "entries" : [ { "group": "kitchen_tools", "prob": 200 }, { "group": "lighting_tools", "prob": 20 }, { "group": "dining_tools", "prob": 100 }, { "group": "fire_tools", "prob": 20 }, { "group": "alcohol_hobo", "prob": 45 }, { "group": "cleaning", "prob": 30 }, { "group": "local_fruit", "prob": 20 }, { "group": "junkfood", "prob": 80 }, { "group": "candy", "prob": 30 }, { "group": "vegetables", "prob": 20 }, { "group": "perishable_food", "prob": 30 }, { "group": "imperishable_food", "prob": 80 }, { "group": "canned_food", "prob": 80 }, { "group": "condiments_spices", "prob": 50 }, { "group": "legal_drugs", "prob": 45 }, { "item": "dogfood", "prob": 5 }, { "item": "catfood", "prob": 5 } ] }
And for mansion kitchens:

{ "type" : "item_group", "id" : "kitchen_highclass", "subtype": "distribution", "entries" : [ { "group": "kitchen_tools", "prob": 200 }, { "group": "lighting_tools", "prob": 35 }, { "group": "dining_tools", "prob": 100 }, { "group": "fire_tools", "prob": 20 }, { "group": "alcohol_wine", "prob": 85 }, { "group": "alcohol_hard", "prob": 45 }, { "group": "cleaning", "prob": 50 }, { "group": "fruit", "prob": 60 }, { "group": "vegetables", "prob": 70 }, { "group": "irradiated_fruit", "prob": 5 }, { "group": "irradiated_vegetables", "prob": 5 }, { "group": "perishable_food", "prob": 80 }, { "group": "imperishable_food", "prob": 70 }, { "group": "canned_food", "prob": 50 }, { "group": "pasta", "prob": 60 }, { "group": "condiments_spices", "prob": 70 }, { "group": "cookbooks", "prob": 80 }, { "item": "atomic_lamp", "prob": 10 }, { "item": "atomic_coffeepot", "prob": 10 }, { "item": "multicooker", "prob": 2 }, { "item": "hat_chef", "prob": 10 }, { "item": "jacket_chef", "prob": 10 }, { "item": "veggy_salad", "prob": 35 }, { "item": "brioche", "prob": 15 }, { "item": "lutefisk", "prob": 5 } ] }
That’s a lot easier than making a whole new list with literally hundreds of items on it.

>Third, used some of the new functionality.
Some cool new functionality has been added to the game, but a lot of the older item groups don’t reflect that. So I made a few changes, like applying damage to motors you find on the side of the road. You’ll still find V-6’s lying around, but now they’ll be old and rusty. Not a big deal, but kinda fun.


(This isn’t a normal mod, and it doesn’t go in the mod folder. Instead you have to remove item_groups.json , monster_drops.json , and map_extra_items.json from your json folder and replace them with these files. Inconvenient, but that was the simplest way to do it.)

https://mega.co.nz/#F!OYFwhZSS!dngSzgxAXfimGA5v3YeZpg

My main concern is that, since scavenging stuff is one of the core elements of the game, changing the loot tables will have far more of an affect on the game than intended. I really just sort of eyeballed the lists and made rough estimates, so if people want to adjust the distribution weights or probabilities later on, that would be fine by me.

lemme know what you think. I’ll clean it up and PR it later if people think it’s worth it.

Do it. It’s awesome.

Normalizing weights doesn’t do anything if the entire table isn’t normalized, if an item should be “average” in two different tables, and one table is 2x the size of the other, they should not have the same weights in both tables.
I’m not saying your changes are wrong, but unless we figure out a different way to do things, you are always going to need to look at the whole table in order to figure out the relative weight your new item should have. On the other hand, making use of the sub-lists feature like you’e done will help out with this.

This looks great. I don’t know much about the item weights, but the we really need some simplified jsons.

[quote=“Kevin Granade, post:3, topic:10106”]Normalizing weights doesn’t do anything if the entire table isn’t normalized, if an item should be “average” in two different tables, and one table is 2x the size of the other, they should not have the same weights in both tables.
I’m not saying your changes are wrong, but unless we figure out a different way to do things, you are always going to need to look at the whole table in order to figure out the relative weight your new item should have. On the other hand, making use of the sub-lists feature like you’e done will help out with this.[/quote]

Yeah, I know. I just did it because I think some people add stuff without really looking at the lists, especially when added from a maptile or a mod file. So this way if a modder adds a new item to groups and just sets it to 50 things should work out OK at least. On one list the item might be generated up 1% of the time and on another it might show up 25% of the time, but it will still show up as often as any other common item from that list.

But the main reason I changed it was for groups like this:

"type" : "item_group", "id" : "shotguns", "items":[ ["shotgun_s", 1], ["shotgun_d", 2], ["rm228", 2], ["rm120c", 1], ["l_def_12", 6], ["remington_870", 8], ["mossberg_500", 4]
where you have a 1/8 chance of generating a Rivtech shotgun. If it’s intended, that’s fine, but I thought they were supposed to be much more rare than that, end-game items you only find once in a blue moon. More like:

"type" : "item_group", "id" : "shotguns", "items":[ ["shotgun_s", 10], ["shotgun_d", 20], ["rm228", 2], ["rm120c", 1], ["l_def_12", 60] ["remington_870", 80], ["mossberg_500", 40]
Of course, if that’s too rare people can set the numbers however they like, but there’s more room to fine tune things.

It’s not exactly simplifying things because it adds a lot of new groups and an extra step. But it should make it easier/faster for people making maptiles. Hopefully. Maybe.