Cataclysm-dda: Bunkers, helicopter crashes spawning single/no items.

Created on 13 Mar 2018  路  7Comments  路  Source: CleverRaven/Cataclysm-DDA

Game version: 7190-7200

Operating system: Windows 10

Tiles or curses: Tiles

Mods active: Any, multiple combinations tested and does not seem to affect this

Expected behavior

Military bunkers and helicopter crashes should spawn multiple pieces of loot with a possibility of no items, as they have in the past.

Actual behavior

Both helicopter crashes and military bunkers spawn either a single item(per room, in the bunker) or no items at all with no exception.

Steps to reproduce the behavior

Inspect military bunkers or helicopter wreckages/crashes on recent experimental builds. More locations _may_ be affected, possibly military outposts.

(S1 - Need confirmation) <Bug> Map / Mapgen

Most helpful comment

I'm comparing build 4564(because its the only old version I have installed) against 7190, 7193, and 7200.

I haven't followed development much for around a year, and don't have a precise time or build that this started happening. However, build 4564 does not exhibit this behavior in either situation. I think that build was after the helicopter changes but before the bunker changes. I recall that item spawning worked properly well beyond that, but I don't have any builds between 4564 and 7190 to test anymore.

Correct me if i'm wrong, but I think that changes were made to the loot spawning system more recently-could explain why largely unrelated things are being equally affected. Maybe that could be connected.

I honestly know very little about the project at the code level, and I have no real programming or debugging skill, I'm sorry if I can't be of much help here.

Examples:

Bunkers:

Build 4564, expected behavior:
intended 4564

Build 7200, unexpected behavior:
unexpected 7200

Heli crashes:

Build 4564, expected behavior:
heli intended 4564

Build 7200, unexpected behavior:
heli unexpected 7200

All 7 comments

Which game versions do you compare?

These (military bunkers and helicopter wreckages) are two different entities - overmap terrain and map extra. Both were not changed recently:

  • bunker was moved to json more than a year ago in #20308;
  • mx_helicopter is still harcoded, but was changed only slightly for more than 3 years.

mapgen.cpp in 2018:

https://github.com/CleverRaven/Cataclysm-DDA/blob/004e9e6b06a00856c53463e7fdde077c6eb0a499/src/mapgen.cpp#L8029-L8066

mapgen.cpp in 2015:

https://github.com/CleverRaven/Cataclysm-DDA/blob/409fd31b37d95c4753273c5885cfe8b40fc46f94/src/mapgen.cpp#L12961-L12998

Both use place_items() with similar parameters. Maybe the problem lies there.

20773 could be related then

I'm comparing build 4564(because its the only old version I have installed) against 7190, 7193, and 7200.

I haven't followed development much for around a year, and don't have a precise time or build that this started happening. However, build 4564 does not exhibit this behavior in either situation. I think that build was after the helicopter changes but before the bunker changes. I recall that item spawning worked properly well beyond that, but I don't have any builds between 4564 and 7190 to test anymore.

Correct me if i'm wrong, but I think that changes were made to the loot spawning system more recently-could explain why largely unrelated things are being equally affected. Maybe that could be connected.

I honestly know very little about the project at the code level, and I have no real programming or debugging skill, I'm sorry if I can't be of much help here.

Examples:

Bunkers:

Build 4564, expected behavior:
intended 4564

Build 7200, unexpected behavior:
unexpected 7200

Heli crashes:

Build 4564, expected behavior:
heli intended 4564

Build 7200, unexpected behavior:
heli unexpected 7200

I went through the mx_helicopter function with a debugger and I do not see anything technically wrong with it. Each call to m.place_items puts approximately chance * itemSpawnRate / 100.0f items in the crash area so with the default item spawn rate of 1.0 you get 1 or 0 items.

Gameplay-wise I would expect to find more in a helicopter crash site. Assuming up to about 4 passengers, each one should leave at least one item of gear and maybe one rare item depending on the type of the helicopter (which BTW seem to be the spirit of the extra_items portion of the code).

To make this more plausible we could increase the amount of m.place_items OR maybe even add them (with a low chance) to the double loop that makes rubble.

For bunkers, I think the problem is here:
https://github.com/CleverRaven/Cataclysm-DDA/blob/39600bc352d4a229a6bcf561bf2a5c13ca0a8998/data/json/mapgen/bunker.json#L101-L128

In each room, there is an 80% chance that an item will be placed but each item has a very low probability e.g. grenades have prob: 1 (out of a 100%, i.e. 1% !!).

How about we multiply each probability by 10?

EDIT: Doh, just noticed that probabilities get normalised when creating items from an item_group. This still means that ONE item gets generated in each of those bunker basement rooms.

Fixed by #23264 and #23266.

Was this page helpful?
0 / 5 - 0 ratings