-
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
Mongroup: subgroup spawning fixes #59281
Mongroup: subgroup spawning fixes #59281
Conversation
Took it for a test ride - start/end and conditions definitely work, weights seemed to as well (but those are a bit harder to check). One thing I ran into is that the top-level pack size definition doesn't seem to do anything, with the group-level pack size carrying over. |
Ah, I see what's wrong with pack size. I'll add a test case for that as well. Thanks for checking! |
d23bbc1
to
fa006d0
Compare
fa006d0
to
5c86e98
Compare
Pack size works, however do you think it would be possible to instead of multiplying the rolled mob with the top-level pack size you'd get
As it stands, this spawns either 1-5 zombies/fat zeds/zed kids or 1-10 dogs (but only one type at a time). However, if the top-level pack size would instead count as the number of entries to roll you potentially could place a whole family with one spawn - and one spawn is all you'll get for overmap_terrain level spawns (like random monsters). For the mapgen-level it's less of a problem since you can just |
5c86e98
to
b715708
Compare
Done, just needed a bit of refactoring to make it work. |
b715708
to
3679297
Compare
Summary
None
Purpose of change
Describe the solution
When spawning from a monster group, evaluate subgroups at the top level for validating spawn conditions (start/end dates, weight, season, etc.)
(Note: pack_size)
Pack size is a bit of a special case. The pack sizes in monster groups are deliberately weighted:
Cataclysm-DDA/data/json/monstergroups/triffid.json
Lines 31 to 41 in 554df77
So a parent group defining a pack size for this subgroup would select that many sub-entries.
In this case, 10-12 entries from
GROUP_TRIFFID_HEARTGUARDS
will spawn hereDescribe alternatives you've considered
Testing
Added a unit test to check the spawn probabilities of monster groups at different levels of nesting:
Additional context
This was an implementation bug from #52323 (yes, it's been broken for that long)