Exposed, unsealed or rotten food causes rats to spawn within a certain number of tiles. the more food, the more rats. they will attack you, steal your food and create morale penelties.
that said, you could also use this method to ‘Farm’ rats away from your base. always drop any rotten food in the same spot and whenever you need food, hunt the rats.
Sounds a bit to much like spontaneous generation for my liking. Does this mean that even in a sterile enclosed room in a lab I can breed an infinite supply of rat meat ?
“check if there’s a route to the outside” is an immensely expensive thing to do. Potentially we could just have rats roam all over and let them multiply if they find food.
When it doesn’t load submaps, it’s not that expensive. I tested the new pathfinding with ~20 NPCs pathing to the other end of the bubble and it was manageable (much less expensive than the drawing call was on my computer).
Plus, checking a route to the outside wouldn’t even need to be pathfinding - the actual distance would not be relevant, so a flood fill could be used. It could be easily cached too. Wouldn’t work in submaps far from upstairs, but that could be considered a feature.
Though the entire feature wouldn’t be complete without the “monsters stealing items” thing. Otherwise rats would spawn on food and then just roam around it.
And monsters stealing items is a much harder issue to implement, because it requires caching to avoid 10+ squirrels parsing all piles of corpses in sight just to find some acorns.
When it doesn’t load submaps, it’s not that expensive. I tested the new pathfinding with ~20 NPCs pathing to the other end of the bubble and it was manageable (much less expensive than the drawing call was on my computer).[/quote]
It has to load submaps, it would be pointless if it were happening only in the reality bubble (then you get the fun ‘feature’ of events that only happen if you’re nearby). The only way to do it I can think of is to mark submaps as having eligible vermin attractors on unload, which means checking a bunch of nearby submaps (some of which would otherwise be unloaded, this implies pinning submaps in memory just for this feature). The good news is subsequent processing is cheap to free, you can just defer it until the next time the submap is loaded.
A flood fill would to be kind of reasonable, except that half or more of the operations are going to have to hit the underlying submaps instead of caches since it’s going to happen on map areas outside the reality bubble.
[quote=“Coolthulhu, post:7, topic:9125”]Though the entire feature wouldn’t be complete without the “monsters stealing items” thing. Otherwise rats would spawn on food and then just roam around it.
And monsters stealing items is a much harder issue to implement, because it requires caching to avoid 10+ squirrels parsing all piles of corpses in sight just to find some acorns.[/quote]
I don’t see that as a problem, we can just dial down the frequency at which vermin check for nearby items until it doesn’t matter, and limit the area they search.