Skip to content
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

Monster groups in monster groups are not evaluated correctly #59276

Closed
NetSysFire opened this issue Jul 15, 2022 · 2 comments · Fixed by #59281
Closed

Monster groups in monster groups are not evaluated correctly #59276

NetSysFire opened this issue Jul 15, 2022 · 2 comments · Fixed by #59281
Labels
<Bug> This needs to be fixed [C++] Changes (can be) made in C++. Previously named `Code` Spawn Creatures, items, vehicles, locations appearing on map

Comments

@NetSysFire
Copy link
Member

Describe the bug

See #59215. Copying my comment in here:

I am understanding it currently works like this:

{ "monster": "mon_cat", "weight": 5 },
{ "monster": "mon_something else", "weight": 5 },

The above works as expected but however this does not:

{ "group": "GROUP_STRAY_CATS", "weight": 5 },
{ "monster": "mon_something_else", "weight": 5 },

Because it basically turns into:

{ "monster": "mon_cat", "weight": 50 },
{ "monster": "mon_cat_kitten", "weight": 5 },
{ "monster": "mon_cat_calico", "weight": 50 },
{ "monster": "mon_cat_calico_kitten", "weight": 5 },
...
{ "monster": "mon_something else", "weight": 5 },

This is my guess at least, seeing at how the spawns reacted to me fiddling with the GROUP_FOREST spawn locally to resolve the feline world domination problem. Currently it looks like it includes the group as is, inserting all the entries of the group with their original weights intact instead of considering the group as a whole. So in our example, there is a 50/50 chance of the monster being a cat (like intended), but with the group being used, the chance of a monster being any cat is nigh 99% since all the entries are inserted into the array.

The intended behavior is that the chance the monster is any cat is still 50/50 and the chance of said cat being e.g a calico kitten is a different, irrelevant chance which is internal to said monstergroup. The monstergroups weights should affect only itself.

I hope I explained that right since I am a total noob.

Steps to reproduce

See above.

Expected behavior

The weights inside of a monster group stay inside of it and entries do not get inserted into the parent group.

Screenshots

No response

Versions and configuration

git

Additional context

No response

@NetSysFire NetSysFire added <Bug> This needs to be fixed Spawn Creatures, items, vehicles, locations appearing on map [C++] Changes (can be) made in C++. Previously named `Code` labels Jul 15, 2022
@Venera3
Copy link
Member

Venera3 commented Jul 15, 2022

See #59174 for a related problem. Another slight problem with nested mongroups is that default monsters are ignored (so a monstergroup needs at least one proper entry to spawn anything).

I'm sorry about pointing you at something I didn't try myself causing a slight catocalypse, by the way.

@NetSysFire
Copy link
Member Author

I'm sorry about pointing you at something I didn't try myself causing a slight catocalypse, by the way.

No worries. It turned out to be a quite amusing dwarffortress-style bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed [C++] Changes (can be) made in C++. Previously named `Code` Spawn Creatures, items, vehicles, locations appearing on map
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants