Jump to content

Recommended Posts

Posted

I was wandering through the woods once and ended up between four bears and a wolf... after changing my pants I decided to head towards the wolf... only to find that the wolf was gone... and the 4 bears were gone too...

Another time I spent an entire game day not finding a single animal (not even a rabbit or a fox) - that's really annoying when hunting...

Another time I found 4 pigs, chased one (it jumped into a hole lol), then came back and saw no pigs (just one wolf)...

So I think the game deletes any animal that I can't see and is more than X blocks away from me... can anyone confirm my theory?

Posted (edited)
22 hours ago, CzBuCHi said:

So I think the game deletes any animal that I can't see and is more than X blocks away from me... can anyone confirm my theory?

Animals in VS are generally persistent, so coming back to the same area where you've previously found animals will lead you to find the same animals in the general vicinity. There is no code which can make them despawn under normal circumstances - that's also why domesticated animals don't despawn even if you're absent for a long time.

If you do come to an area and find that animals which were previously there are no longer there, the most likely cause is that (1) you've chased them off, which is especially likely for your boars, or (2) they've just wandered off and are a few chunks away.

 

22 hours ago, CzBuCHi said:

Another time I spent an entire game day not finding a single animal (not even a rabbit or a fox) - that's really annoying when hunting...

This may be caused by the area's conditions not matching the animals' spawn conditions. Hares and foxes, for example, tend to be most common on the edges between bushy or forested and plain areas, with soil and not gravel/sand as the top layer.

 

Also, regarding the question in the title, the game iterates over a 3-chunk taxicab range - for each chunk:

  • chooses a random location within the chunk,
  • iterates over all entity types - for each type:
    • generates a herd associated with the entity type and assigns a each entity a spawn location within 5 blocks taxicab of the original position,
    • attempts to spawn each entity if the spawn conditions match and no other errors or issues are encountered along the way.
Edited by MKMoose
Posted (edited)

I think I have a small correction. Animals despawn in low light areas, as wiki says after 5 minutes, and with a minimum distance. Never saw them straight disappear, but if you ever look at an animal that fell down a dark hole it will have a "dying" status, also with a timer if I remember correctly. That's why I always left a light source if I trapped an animal that I wanted to take alive later. Now what is the exact light level for that to happen, and what levels are in open areas, I'm not sure. I can't remember if domesticated animals also needed a light source, but I always left it just in case. The wiki should have the correct spawn and despawn conditions for most entities.

Edited by Hanril
  • Like 1
Posted (edited)
1 hour ago, Hanril said:

I think I have a small correction. Animals despawn in low light areas, as wiki says after 5 minutes, and with a minimum distance. Never saw them straight disappear, but if you ever look at an animal that fell down a dark hole it will have a "dying" status, also with a timer if I remember correctly. That's why I always left a light source if I trapped an animal that I wanted to take alive later. Now what is the exact light level for that to happen, and what levels are in open areas, I'm not sure. I can't remember if domesticated animals also needed a light source, but I always left it just in case. The wiki should have the correct spawn and despawn conditions for most entities.

This is correct with a few caveats, and that's also why I said "generally" and "in normal circumstances".

  • Most animals despawn after 300 s at light levels of 7 or less, as long as the player isn't close-by.
  • Deer and grubs don't seem like they despawn at all, though I'd need to verify that in-game to be sure.
  • Wolves and bears seem a bit confused, but they still only despawn in darkness.
  • Fish and worms seem to be are the only animals which can despawn when far away from the player with no light level restrictions.

The big caveat is that the despawn code doesn't care about time of day as far as light level goes - as long as it is exposed sufficiently to the sky, there is no need for artificial lights to prevent despawning, even at night. Your animals will never despawn unless they are is some deep cave or a completely enclosed, dark room.

Edited by MKMoose
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.