CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.3k stars 4.13k forks source link

Carrion / vermin spawning, farms & reality bubbles #24254

Closed Tharn closed 6 years ago

Tharn commented 6 years ago

After the carrion / vermin changes, I'm observing some weird game behaviour around my farm. When I'm near the farm, nothing spawns. As soon as I go downstairs (evac shelter literally 2 feet away from farm) and come back up a second later, there seems to be a 50/50 chance of vermin eating my crops. As soon as I step away to the nearby forest and come back, there's several vermin eating my crops every single time.

Vermin spawning should not be a feature of the reality bubble, where 1) it never happens while you're there and 2) it always happens when you leave and come back. It should be a feature of time. I.e. a farm of size X will attract Y number of vermin over a period of Z. The current implementation forces me to either babysit my crops over a long period of time or to just leave and let them ripen off-screen. Not that great for immersion having to 'game' the bubble.

Lastly, since we have pests now, it would be nice if we could construct some vermin traps, such as beer traps, jar traps, duct tape traps etc.

acidia commented 6 years ago

Wait, it is kinda a function of time? Roaches get added to the spawn queue when an item rots away completely and locusts can get added any time a crop shifts from one stage to another. Items in the reality bubble can't rot away and crops don't grow which is why they get linked to the reality bubble. There are three different times (growth stages) that a plant could potentially generate a pest, if your crop is all the same type and planted at the exact same time you could literally make as many trips as you wanted to in and out between the growth stages without seeing a pest. That's pretty gamey though. If you planted a field and didn't come back till the end of fall during harvest time, the number of creatures spawned is roughly the same as the number of creatures you could expect if you showed up every day, combined.

Tharn commented 6 years ago

Afaik, crops do grow in the reality bubble?

Let me demonstrate why something in the current implementation is messed up.

The only thing I did was go downstairs and come back up about 2 dozen times. Almost every time, 2-3 crows, cockroaches or locusts would spawn. This all happened in the course of a single day. Just sitting there and letting time pass nets no spawns.

before after

This all happened over a couple of hours game-time. Next, I reloaded and went away for a week, then came back. There's a bunch of new plant stages, but only one cockroach.

week

acidia commented 6 years ago

Interesting, there's a total of roughly a 6% chance from seeds to harvest of a monster ever generating... Not sure how you are generating carrion without your plants changing (or it may just be your tileset).

Do you have experimental z on?

Tharn commented 6 years ago

No, I only have Filthy Clothing, Disable NPC Needs, Disable Religious Texts, Prevent Zombie Revivification and StatsThroughSkills enabled.

For the massacre screenshot, the plants did indeed not change. There wasn't enough time. I basically grabbed an A7 rifle and just went upstairs - downstairs on repeat, sniping any vermin I found.

ItsJustAlexC commented 6 years ago

@acidia I can confirm what @Tharn is experiencing is accurate. It happens with me as well. I'm growing a lot of buckwheat atm. It seems the moment you leave the reality bubble of the crops, there is a chance that locusts will spawn instead of when the plant changes.

screenshot 3 screenshot 4 screenshot 5

In the first one I just slept, and went out to check my crops, nothing there. In the second picture I went downstairs, then back up (leaving the planets bubble) In the Third picture, 3 locusts and a crow instantly spawn and eat my crops. Effectively making me have to babysit the crops

Tharn commented 6 years ago

Also note that you have way more farm plots, yet you're seeing the same 3 locusts that I do. Next up I'll probably try reproducing this with a single farm plot. I don't think this 6% per-plant rule is in effect for these Z-level / bubble changes, nor does it seem like the vermin ever stop spawning.

acidia commented 6 years ago

That should be enough to go on, sounds like the spawn check is outside of the plant growth check. I'll post update when I can take a look.

acidia commented 6 years ago

Isn't a super pretty fix but essentially, all crop plants were being recreated every time the player approached which was causing carrion to spawn since it was perceiving it as a life cycle change.

ItsJustAlexC commented 6 years ago

Cheers mate, I'll test this out when I play again.

FulcrumA commented 6 years ago

Related to it - as I believe hatching creatures falls under the carrion feature - I have my hatched birds since half a year (60 days per season). They're all still just chicks and they do not get updated, even when I spend in-game week or two away enough that the whole location falls out of reality bubble. I believe that the ticket introducing them mentioned them growing up faster than this though feel free to correct me.

acidia commented 6 years ago

Close enough, I'll double check on them to when I get back home. As a note though, if the chicks were hatched between the egg pr and the growth jsons pr then they won't have tracked growth ages so I don't think they'll evolve.

Tharn commented 6 years ago

Since the update, my fields are clear. The first time I changed Z-level, I got one locust in one of the newly made fields, and since then they've been clear.

acidia commented 6 years ago

Yup, that sounds about right for a small size field.

FulcrumA commented 6 years ago

@acidia In all honesty, I do not remember when I started filling my chicken coop. Hm, maybe let's do it this way - I'll kill current birds, next in-game year forage new eggs and wait for them to hatch and then, if nothing will improve, I'll start a new ticket - is that fine with you?

acidia commented 6 years ago

A quick test will give you a definitive answer if you don't mind. Using a recentish build:

Use the debug menu to spawn a few bird eggs and drop them outside the coop. Leave the area or go underground. Debug menu 'q' is set time, increase year by one. Did your old chickens grow? If not then they won't ever. You should have a new chick from the debug eggs. Leave area and increment year by one again. Return, and your bird should be an adult. If not then something has gone wrong. As an aside you do have evolutions on right? Exit the game with the x in the top right to prevent saving the changes.

FulcrumA commented 6 years ago

Yeah, I've considered using debug menu but I didn't know whether eggs spawned that way will be affected or not - I know that for example, spawned terrain features work a bit weird at times and I didn't want to make things even more broken. Either way, old birds didn't get older and I did kill them. I suspect that for now I indeed hatched them sometime between two merged features of having them hatched and having them grow. If there will be a further issues, I'll be sure to bother you.

Monster evolution is on, as we talked about it - it's something ridiculously low as you've suggested just to allow chicks to grow but it's there. I do hope you will split animal growth from evolution for the future, though.

ItsJustAlexC commented 6 years ago

It appears the fix did it's job. I tested going up and down the stairs a dozen times or so and my fields are still clear (unlike last time when it would spawn 3 or so locusts each bubble change to the point i got an error message and a monster count of over 60+ locusts, cockroaches, and crows in less than a minute). Thanks!

Tharn commented 6 years ago

Closing this as fixed, unless anyone has another suggestion.