Jump to content

How is loot generation handled?


f3rret

Recommended Posts

I'm not sure if this has been covered before (forum search didn't turn up anything), but how is loot generation handled? I've got a couple of theories:

- Is it statically set by the mapper? For example, when a house is mapped out, does the mapper explicitly put that pack of bacon in the fridge?

- Or is it randomly generated when the cell loads based on the container type? Like, there is a fridge on the map, and fridges have a 1% chance of having bacon, 3% chance of bottle of remoulade, etc. . So when the fridge loads, it rolls to see what loot it has.

Link to comment
Share on other sites

Rooms in PZ have associated room definitions along the lines of kitchen, warehouse, garage, et cetera. Room definitions have definitions for different types of containers (table, crate, counter etc). For a container type there's a list of items with per-item spawn probability. A container's contents are randomly determined when the container is opened, based on what type of container it is, what type of room it is in, and whether the individual opening it is Lucky or not. If there's no definition for that type of room or container, fallback definitions are used.

Link to comment
Share on other sites

I'm not sure if this has been covered before (forum search didn't turn up anything), but how is loot generation handled? I've got a couple of theories:

- Is it statically set by the mapper? For example, when a house is mapped out, does the mapper explicitly put that pack of bacon in the fridge?

- Or is it randomly generated when the cell loads based on the container type? Like, there is a fridge on the map, and fridges have a 1% chance of having bacon, 3% chance of bottle of remoulade, etc. . So when the fridge loads, it rolls to see what loot it has.

 

The second one - randomly generated. As harakka notes - the list of possible items for any given container depends upon the map's room definition.  In a structure, each room can be defined differently so cabinet in a kitchen will spawn something different than a cabinet in a bathroom.

Link to comment
Share on other sites

Rooms in PZ have associated room definitions along the lines of kitchen, warehouse, garage, et cetera. Room definitions have definitions for different types of containers (table, crate, counter etc). For a container type there's a list of items with per-item spawn probability. A container's contents are randomly determined when the container is opened, based on what type of container it is, what type of room it is in, and whether the individual opening it is Lucky or not. If there's no definition for that type of room or container, fallback definitions are used.

 

Are the room definitions in the game files, or the map files? Meaning if I download a custom map, is it possible that I'm going to find a fridge full of shotgun ammo because the mapper wanted it that way? Or would a fridge in a kitchen on custom map 1 have the same loot tables as a fridge in a kitchen on custom map 2?

Link to comment
Share on other sites

 

Rooms in PZ have associated room definitions along the lines of kitchen, warehouse, garage, et cetera. Room definitions have definitions for different types of containers (table, crate, counter etc). For a container type there's a list of items with per-item spawn probability. A container's contents are randomly determined when the container is opened, based on what type of container it is, what type of room it is in, and whether the individual opening it is Lucky or not. If there's no definition for that type of room or container, fallback definitions are used.

 

Are the room definitions in the game files, or the map files? Meaning if I download a custom map, is it possible that I'm going to find a fridge full of shotgun ammo because the mapper wanted it that way? Or would a fridge in a kitchen on custom map 1 have the same loot tables as a fridge in a kitchen on custom map 2?

 

 

Room definitions are set in the map files and the mapmaker sets them.  The room definitions are in the game files but you can mod in new ones if you want.  So you can make a kitchen with the definition of "Hell's Kitchen" instead of "kitchen" and have all fridges inside spawn shotgun shells.

 

I think the vast majority of map makers are using normal room definitions with maybe some Easter Egg exceptions.  Map making is actually a lot of fun and easy to get into.  Mapmaking has two parts - buildings and maps.  You can make a building and set up the room definitions.  Then the buildings can be placed on a map.  As buildings can be made separately and shared by modders, I think most building makers are using "normal" room definitions rather than crazy, non-intuitive designs. I think most map makers want "normal" buildings that aren't overpowered or weird/improbable.

 

Another incentive for building makers to use the "normal" room definitions is that NPCs will reference these when released.  For example, you will be able to tell an NPC to stay in the kitchen.  I'm not sure you will be able to tell NPCs to stay in a uniquely defined room, like stay in the "Hell's Kitchen" as the NPCs will only understand the normal room definitions.  I could be wrong though.

 

So to answer your question, yes a custom map could be made to spawn shotgun shells in a fridge, however I don't think you need to worry about this scenario with most of the map mods available as modders are sticking with the essence of the base game with normal room definitions.

Link to comment
Share on other sites

 

 

Rooms in PZ have associated room definitions along the lines of kitchen, warehouse, garage, et cetera. Room definitions have definitions for different types of containers (table, crate, counter etc). For a container type there's a list of items with per-item spawn probability. A container's contents are randomly determined when the container is opened, based on what type of container it is, what type of room it is in, and whether the individual opening it is Lucky or not. If there's no definition for that type of room or container, fallback definitions are used.

 

Are the room definitions in the game files, or the map files? Meaning if I download a custom map, is it possible that I'm going to find a fridge full of shotgun ammo because the mapper wanted it that way? Or would a fridge in a kitchen on custom map 1 have the same loot tables as a fridge in a kitchen on custom map 2?

 

 

Room definitions are set in the map files and the mapmaker sets them.  The room definitions are in the game files but you can mod in new ones if you want.  So you can make a kitchen with the definition of "Hell's Kitchen" instead of "kitchen" and have all fridges inside spawn shotgun shells.

 

I think the vast majority of map makers are using normal room definitions with maybe some Easter Egg exceptions.  Map making is actually a lot of fun and easy to get into.  Mapmaking has two parts - buildings and maps.  You can make a building and set up the room definitions.  Then the buildings can be placed on a map.  As buildings can be made separately and shared by modders, I think most building makers are using "normal" room definitions rather than crazy, non-intuitive designs. I think most map makers want "normal" buildings that aren't overpowered or weird/improbable.

 

Another incentive for building makers to use the "normal" room definitions is that NPCs will reference these when released.  For example, you will be able to tell an NPC to stay in the kitchen.  I'm not sure you will be able to tell NPCs to stay in a uniquely defined room, like stay in the "Hell's Kitchen" as the NPCs will only understand the normal room definitions.  I could be wrong though.

 

So to answer your question, yes a custom map could be made to spawn shotgun shells in a fridge, however I don't think you need to worry about this scenario with most of the map mods available as modders are sticking with the essence of the base game with normal room definitions.

 

 

That answers my questions perfectly. I'm asking so much because I'm considering trying my hand at a few buildings or maps, AND I was going to try one of the custom maps but wasn't interested if the mapper was spoiling the mood by dropping overpowered weapons and supplies everywhere.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...