-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Palletized(/nested?) item placement without defined "chance" defaults to 0 (will never be placed) #72326
Comments
I believe the behavior of omitting a spawn chance should be to always spawn. This differs from 100% in that it would not be affected by spawn reduction rates. However, this might be too subtle a difference to be usable in practice (i.e. a significant risk of intending 100% rather than mandatory). An alternative would be to make the chance entry mandatory and have checks reject entries without it. |
Here is a list of all the affected vanilla groups:
|
And with all the mods loaded at once:
|
This was used to report all the errors at once: master...RenechCDDA:Cataclysm-DDA:check_mapgen_failures |
Some other notes related to this problem: -Both
-Chance seems to override prob. -Based on the above, I am strongly considering taking up alcoholism, as this will be a mess to clean up. |
The "chance" should be defaulting to 1/100 as per the docs https://docs.cataclysmdda.org/MAPGEN.html#place-items-from-an-item-group-with-items though I've never understood why that is the default Taking that into account Prob should definately throw an error tho ye |
Spawn rate should already be covered by this: Line 6483 in 9c3b7d1
There is some merit to allowing mapgen to force spawns, ignoring spawn rate. But mostly I am concerned about the huge difference in expectation from someone writing |
I forgot just how stoopid this is, |
There is also the alternative to eat this elephant one bite at a time, i.e. Changing the default and decide on which syntax to keep (for application later), and then change 100 or so entries at a time to the canonical syntax over 20+ PRs (probably changing a number of files over in each PR, so the PRs are independent, apart from the first and last one.) and then finally remove support of the undesirable syntax. |
Describe the bug
We have a palette (
lodge_items
)with a definition"L": { "item": "cannibal_food", "repeat": [ 1, 4 ] },
.Cataclysm-DDA/data/json/mapgen_palettes/lodge_palette.json
Lines 159 to 162 in ef537eb
Natural understanding from repeating that is that it will spawn 1-4 of those items. Instead, it always spawns 0.
Note that
"D": { "item": "hunting_lodge_weapons" },
and"h": { "item": "cannibal_weapons", "repeat": [ 1, 4 ] },
will never be placed either, lacking a definedchance
Here is an image of a nested mapgen spawn from the debug menu:
And for comparison, the mapgen entry:
Cataclysm-DDA/data/json/mapgen/nested/lodge_nested.json
Lines 20 to 22 in ef537eb
Notice that every square with L and D defined is empty. They are always empty. They will never spawn, because their chance defaults to 0.
Attach save file
N/A requires modification to prove without a doubt. Use this branch: master...RenechCDDA:Cataclysm-DDA:nested_mapgen_fail
Debug spawn lodge, teleport to lodge. Notice that the pantry is empty despite having many definitions for items to be put into it. Notice that the only change to files has been to remove explicit
chance
definitions.Steps to reproduce
Visit cannibal lodge, notice that there is nothing from the
cannibal_food
entry despite it being defined.Use this branch to verify: master...RenechCDDA:Cataclysm-DDA:nested_mapgen_fail
Expected behavior
If I define an item to spawn in mapgen without specifying a chance, it should default to 100, definitely not 0! I defined it to spawn, didn't I?
Screenshots
No response
Versions and configuration
c5225cf
Windows 10
Additional context
No response
The text was updated successfully, but these errors were encountered: