animals seem to be really interested in water #555

Open
opened 2019-08-20 16:01:03 +02:00 by Ghost · 20 comments

animals like to hang out in water sources which will make them drown and make the oceans full of drops that lag out the game

animals like to hang out in water sources which will make them drown and make the oceans full of drops that lag out the game
Wuzzy added the
bug
code quality
#P2: HIGH
mobs
labels 2019-08-27 22:05:48 +02:00

Can confirm, this is from a few hours playthrough, these mapblocks were only briefly loaded (but as soon as they load horses start spawning in batches in water)

Can confirm, this is from a few hours playthrough, these mapblocks were only briefly loaded (but as soon as they load horses start spawning in batches in water)
Member

Lol, yeah I've seen this too. I had to build a giant lava fountain underneath my cliff house to incinerate all the floating animals. I called it the Barnyard Eliminator.

Lol, yeah I've seen this too. I had to build a giant lava fountain underneath my cliff house to incinerate all the floating animals. I called it the Barnyard Eliminator.

Also they don't seem to spawn just in water, I have "circles" of mobs around my house, just a bit beyond active block range. There's probably hundreds of them in total around my house.

Also they don't seem to spawn just in water, I have "circles" of mobs around my house, just a bit beyond active block range. There's probably hundreds of them in total around my house.

Can anyone confirm that it's always horses in excess? From your screenshots it seems to be something with horses specifically. But do other animals have this issue?

Can anyone confirm that it's always horses in excess? From your screenshots it seems to be something with horses specifically. But do other animals have this issue?
Member

Horses have a lot of hitpoints so stuff that kills the average animal like floating too long basically takes forever with horses and you get horse pileup.

Horses have a lot of hitpoints so stuff that kills the average animal like floating too long basically takes forever with horses and you get horse pileup.
Member

The problem is the “walk” state. Mobs aren't very smart when roaming randomly around.
The mobs were especially confused near shorelines. When they actually managed to escape the water, they just turn around 180° …

Today, I have taught mobs how to escape to the nearest shoreline … kinda. It's an improvement, but not perfect.

I still need to teach them how to actively avoid dangers.

The problem is the “walk” state. Mobs aren't very smart when roaming randomly around. The mobs were especially confused near shorelines. When they actually managed to escape the water, they just turn around 180° … Today, I have taught mobs how to escape to the nearest shoreline … kinda. It's an improvement, but not perfect. I still need to teach them how to actively avoid dangers.

It's a funny bug though. I don't have huge amount of horses, but I still get plenty of mobs in the water. Here's a laggy example. There were 3 times more than in the screenshot. Currently I've just reduced the amount of mobs spawning.

It's a funny bug though. I don't have huge amount of horses, but I still get plenty of mobs in the water. Here's a laggy [example](https://streamable.com/yba83). There were 3 times more than in the screenshot. Currently I've just reduced the amount of mobs spawning.
Member

This is a follow up to #679 where I unstuck mobs in the water, and fixed their cliff avoidance check.

With this new patch; land mobs will now almost entirely avoid entering the water.
adf4767c8f

For pathfinding out of water; I ended up looking to upstream for help. And, there they use 'find_nodes_in_area_under_air' to find land.
This works better than the previous checks.
And, to mostly avoid water in the first place. I copied, and reworked the cliff avoidance check into one for water avoidance.

Attacking mobs, like creepers, will still follow you into the water. And, any mobs following an item you're holding will follow you into the water without issue.
But otherwise, they'll stop & turn away from the water; or they'll 'swim' for a short distance before the pathfinding back to land kicks in.

Is this acceptable, gameplay wise?
Giving them a chance to cross small waterways and such; feels like a good compromise. But, if not we can stop them from entering the water completely.

This is a follow up to #679 where I unstuck mobs in the water, and fixed their cliff avoidance check. With this new patch; land mobs will now almost entirely avoid entering the water. https://github.com/MysticTempest/MineClone2_fork/commit/adf4767c8fa5c7faf697c233cf2389ce7d6e6ed4 For pathfinding out of water; I ended up looking to upstream for help. And, there they use 'find_nodes_in_area_under_air' to find land. This works better than the previous checks. And, to mostly avoid water in the first place. I copied, and reworked the cliff avoidance check into one for water avoidance. Attacking mobs, like creepers, will still follow you into the water. And, any mobs following an item you're holding will follow you into the water without issue. But otherwise, they'll stop & turn away from the water; or they'll 'swim' for a short distance before the pathfinding back to land kicks in. Is this acceptable, gameplay wise? Giving them a chance to cross small waterways and such; feels like a good compromise. But, if not we can stop them from entering the water completely.
Member

This sounds acceptable, if it reliably prevents mob spawns collectin at large bodies of water.

Note you have direct commit access, so if you're certain, go for it! But if you still have questions, feel free to ask!

This sounds acceptable, if it reliably prevents mob spawns collectin at large bodies of water. Note you have direct commit access, so if you're certain, go for it! But if you still have questions, feel free to ask!
Member

This sounds acceptable, if it reliably prevents mob spawns collectin at large bodies of water.

Note you have direct commit access, so if you're certain, go for it! But if you still have questions, feel free to ask!

Alrighty, thanks; just merged!

Yea, I was mainly just curious if it seemed pretty acceptable for us to have them swim small distances. It looks like minecraft's swimming just has them float in the water; which we found buggy. But, they would also avoid entering the water in the first place.

My previous patch fixed the cliff diving issues, and let mobs swim back to land instead of just staying stuck bobbing in the water.
While this one optimizes the path to shore, and makes mobs much less interested in going swimming in the first place.

So yea, everything should be good now.
Closing.

> This sounds acceptable, if it reliably prevents mob spawns collectin at large bodies of water. > > Note you have direct commit access, so if you're certain, go for it! But if you still have questions, feel free to ask! Alrighty, thanks; just merged! Yea, I was mainly just curious if it seemed pretty acceptable for us to have them swim small distances. It looks like minecraft's swimming just has them float in the water; which we found buggy. But, they would also avoid entering the water in the first place. My previous patch fixed the cliff diving issues, and let mobs swim back to land instead of just staying stuck bobbing in the water. While this one optimizes the path to shore, and makes mobs much less interested in going swimming in the first place. So yea, everything should be good now. Closing.

uhm... not trying to be a downer but mobs still seem to gravitate toward water.

screenshot_20240306_151756.png

uhm... not trying to be a downer but mobs still seem to gravitate toward water. ![screenshot_20240306_151756.png](/attachments/33f4efd3-0b67-4b17-8de9-866d4e396a71)

Not sure if it is the same issue, but I do realize we still have a similar problem (even though not that extreme). This needs the AI rework that would fix swimming and flying too. Tbh for flying we could look at what I did to the wither and port some of that to the general mobs API, also for swimming some switch that would toggle to a different movement mode when out of water...

Not sure if it is the same issue, but I do realize we still have a similar problem (even though not that extreme). This needs the AI rework that would fix swimming and flying too. Tbh for flying we could look at what I did to the wither and port some of that to the general mobs API, also for swimming some switch that would toggle to a different movement mode when out of water...
Member

I've had several instances where mobs collect in a depression in the land, mostly skeletal horses but other passive mobs will also collect. I don't have a screenshot I can share of this as I went threw an killed them all to clear them out. I suspect this may be a related or possibly have the same root cause.

I've had several instances where mobs collect in a depression in the land, mostly skeletal horses but other passive mobs will also collect. I don't have a screenshot I can share of this as I went threw an killed them all to clear them out. I suspect this may be a related or possibly have the same root cause.

I've had several instances where mobs collect in a depression in the land, mostly skeletal horses but other passive mobs will also collect. I don't have a screenshot I can share of this as I went threw an killed them all to clear them out. I suspect this may be a related or possibly have the same root cause.

It is indeed related, mobs fail to go up often.

> I've had several instances where mobs collect in a depression in the land, mostly skeletal horses but other passive mobs will also collect. I don't have a screenshot I can share of this as I went threw an killed them all to clear them out. I suspect this may be a related or possibly have the same root cause. It is indeed related, mobs fail to go up often.

I've had several instances where mobs collect in a depression in the land, mostly skeletal horses but other passive mobs will also collect. I don't have a screenshot I can share of this as I went threw an killed them all to clear them out. I suspect this may be a related or possibly have the same root cause.

It is indeed related, mobs fail to go up often.

I dont know if this helps at all but I'm a sucker for Minecraft mechanics so these oddities stand out to me. Minecraft has a bias in all mobs to walk uphill, which is often (ab)used in farms. Also, it has these random "50 Mobs collect in this random gap in a mountain, no idea why" so I conclude that it's not an uncommon thing.

Would it help to make mobs seek higher up places every now and then? Also Cows seem very erratic (and glitch through fences A LOT, especially small ones and they even glitch into walls.

> > I've had several instances where mobs collect in a depression in the land, mostly skeletal horses but other passive mobs will also collect. I don't have a screenshot I can share of this as I went threw an killed them all to clear them out. I suspect this may be a related or possibly have the same root cause. > > It is indeed related, mobs fail to go up often. I dont know if this helps at all but I'm a sucker for Minecraft mechanics so these oddities stand out to me. Minecraft has a bias in all mobs to walk uphill, which is often (ab)used in farms. Also, it has these random "50 Mobs collect in this random gap in a mountain, no idea why" so I conclude that it's not an uncommon thing. Would it help to make mobs seek higher up places every now and then? Also Cows seem very erratic (and glitch through fences A LOT, especially small ones and they even glitch into walls.
Member

The easiest simple solution is to use the servers clear all entities command. But it also breaks certain entities like minecarts and causes temporary graphical glitches like banners not displaying properly until you punch them. It’s a terrible workaround but it’ll save a server if it’s lagging down from this bug.

It also kinda breaks any ranching/homesteading with animals experience.

The easiest simple solution is to use the servers clear all entities command. But it also breaks certain entities like minecarts and causes temporary graphical glitches like banners not displaying properly until you punch them. It’s a terrible workaround but it’ll save a server if it’s lagging down from this bug. It also kinda breaks any ranching/homesteading with animals experience.

The easiest simple solution is to use the servers clear all entities command. But it also breaks certain entities like minecarts and causes temporary graphical glitches like banners not displaying properly until you punch them. It’s a terrible workaround but it’ll save a server if it’s lagging down from this bug.

It also kinda breaks any ranching/homesteading with animals experience.

We have a clear mobs custom command, no need to use the engine's built-in clear that breaks everything.

> The easiest simple solution is to use the servers clear all entities command. But it also breaks certain entities like minecarts and causes temporary graphical glitches like banners not displaying properly until you punch them. It’s a terrible workaround but it’ll save a server if it’s lagging down from this bug. > > It also kinda breaks any ranching/homesteading with animals experience. We have a clear mobs custom command, no need to use the engine's built-in clear that breaks everything.

The easiest simple solution is to use the servers clear all entities command. But it also breaks certain entities like minecarts and causes temporary graphical glitches like banners not displaying properly until you punch them. It’s a terrible workaround but it’ll save a server if it’s lagging down from this bug.

It also kinda breaks any ranching/homesteading with animals experience.

Thanks, I'm not looking to clear the mobs at this point as I dont experience any lag. I was rather asking if a slight bias towards uphill was achievable somehow. Also if the cows glitching through fences and suffocating in walls could somehow be solved.

> The easiest simple solution is to use the servers clear all entities command. But it also breaks certain entities like minecarts and causes temporary graphical glitches like banners not displaying properly until you punch them. It’s a terrible workaround but it’ll save a server if it’s lagging down from this bug. > > It also kinda breaks any ranching/homesteading with animals experience. Thanks, I'm not looking to clear the mobs at this point as I dont experience any lag. I was rather asking if a slight bias towards uphill was achievable somehow. Also if the cows glitching through fences and suffocating in walls could somehow be solved.

The easiest simple solution is to use the servers clear all entities command. But it also breaks certain entities like minecarts and causes temporary graphical glitches like banners not displaying properly until you punch them. It’s a terrible workaround but it’ll save a server if it’s lagging down from this bug.

It also kinda breaks any ranching/homesteading with animals experience.

Thanks, I'm not looking to clear the mobs at this point as I dont experience any lag. I was rather asking if a slight bias towards uphill was achievable somehow. Also if the cows glitching through fences and suffocating in walls could somehow be solved.

It could be fixed, but it is non-trivial, and basically would take rewriting of a lot of code.

> > The easiest simple solution is to use the servers clear all entities command. But it also breaks certain entities like minecarts and causes temporary graphical glitches like banners not displaying properly until you punch them. It’s a terrible workaround but it’ll save a server if it’s lagging down from this bug. > > > > It also kinda breaks any ranching/homesteading with animals experience. > > Thanks, I'm not looking to clear the mobs at this point as I dont experience any lag. I was rather asking if a slight bias towards uphill was achievable somehow. Also if the cows glitching through fences and suffocating in walls could somehow be solved. It could be fixed, but it is non-trivial, and basically would take rewriting of a lot of code.
Member

Should be resolved by #4479, please test.

Should be resolved by #4479, please test.
teknomunk added the
possible close
label 2025-02-08 13:01:08 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
11 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#555
No description provided.