mojira.dev
MC-3151

New Mob AI doesn't take world limit/Void into account for pathing

The previous mob AI prevented mobs from pathing across the bottom most plane of the map, the Void. The new mob AI does not take this into account and appears to treat the boundary between the bottom of the world and the Void as a solid plane which can be pathed across. It appears this is caused by the way which pathing is done. As there is nothing to detect below the point separating the world from the Void, the pathing checks to this point and assumes a solid surface exists, thus instructing mobs to attempt crossing and deleting themselves upon contact.

While normally this situation may not occur, maps which utilize the Void as a deterrent of the player must prevent mob access to areas low over the Void. Even at a height above the Void, mobs will conduct the normal calculations for dropping onto solid surfaces and attempt dropping onto the Void. Especially in this case, map makers attach large amounts of custom data to mobs, so the possibility of the mobs essentially deleting themselves is a frustrating thought.

Simplest way to test this: Create a superflat map and dig a 3x3 hole to the Void, leaving the center Bedrock block above it. Spawn a sheep or other mob on the Bedrock, then utilize anything which would normally cause the mob to move. It will walk off and be deleted upon contact with the Void, despite that there is no surface for it to walk on other than the non-collidable boundary..

Original Report: Before Jon's new AI, mobs would avoid wandering into the Void. The new AI does not take into account if the path they are taking is over open Void. It appears that currently Mob AI only takes into account the number of air blocks to fall, and since this can not be counted below the world limit, the AI essentially treats the Void as a solid floor. This means that if the Void is only a few blocks lower than the surface a mob is walking on, the mob will freely wander into the Void and die.

This can be tested by placing a block over open void and spawning a mob on it. The mob will normally simply walk off. This can also be tested by exploiting Villager's more predictable AI mechanics. First, create a classic Superflat world. Make a simple home underground with a door. Then place villagers inside. Break the bedrock directly in front of the door, and you will witness villagers freely wandering into the Void through the hole.

This should be easy enough to resolve - it has just gone widely unnoticed for quite some time.

Edit: Considering Jeb's declaration that all mobs will now use the new AI (https://twitter.com/jeb_/status/428840815549747200), I wish this issue reconsidered. Read comment below (Jan 30, 2014).

Related issues

Comments

kumasasa

Do not set affected version to future versions, you couldn't have played it!

kumasasa

This site is for bug reports only. For feature suggestions/changes please use the MineCraft Forums: Suggestions.

Aden McKinley

@Kumasasa - why does it let you select future versions?

megascience

I noticed several resolved issues under 1.5, which was what confused me. I won't put these in 1.5's entry again, sorry.

In terms of this ticket, this is definitely an oversight with the new AI code. The previous AI code prevented mobs from wandering into the Void. When the new AI code was introduced, I tested and compared how mobs acted when on a single block above the Void. In the previous AI code they would stand still, even when presented wheat. When I loaded the same world in the new version, before my world even finished loading, the mob would simply walk off the platform. Before making this ticket, I tested this in 1.4.4 and found it to be even worse. Since they added the mechanic of mobs calculating risk in falling, I noticed villagers jumping in from greater height. Falling in from a greater height isn't a constant, but mobs will still freely wander into the Void.

Torabi

This is either a bug, or Working as Intended, but certainly not a feature request. It is inconsistent and unexpected behavior. It previously did not occur, but now does as a result of a code change.

megascience

Would this still be believed as a feature request? Because as far as I know, it was intended that mobs would calculate and avoid wandering into the Void, since the previous AI code did take this into account. However, the new Mob AI was done without that consideration. Not his fault, but it is something to be fixed.

Edit: I just tested in Snapshot 13w04a with a sheep on a block three units above open Void. After standing for a moment, it freely walked off the block and out of the world. This behavior does not correlate with previous behavior, and I believe it is something to be fixed and not added.

megascience

Walter, what this report points out is that the previous mob AI did not allow mobs to walk into the Void. The new mob AI does. What I've come to believe after discussing it with others is that the new mob AI simply counts air blocks to determine if it should walk off a ledge. As such, since there can't be air blocks beyond the world limit, the AI tells the mob the world limit itself is a solid floor and lets mobs walk onto it, falling out of the world. Now, while in normal worlds, this would not be possible, this does not take into account custom zuperflat and overall custom maps.

Basically, mobs should be able to recognize the world limit as an infinite drop and not a solid floor.

megascience

Considering Jeb's announcement via Twitter an hour ago (https://twitter.com/jeb_/status/428840815549747200), I think this issue should be revisited.

The old AI system avoids pathing into the Void. The new AI system does not. Mobs treat the the plane between the normal area and the Void as a solid surface, and will freely path into it. This creates issues with areas placed low in empty worlds, such as custom maps, as mobs will freely wander off and despawn in the Void, making many low-level applications involving mobs impractical without obstructive precautions.

Essentially, I wish this issue reopened so it may be recognized and corrected: Mobs should not treat the Void as a solid surface to walk on, AKA not path into it.

megascience

Still exists in 14w05a. This is not a feature request, it is a bug which causes low-level areas over the Void to be impractical.

megascience

Requesting moderator to reopen this issue as I just witnessed a slime jumping into the Void first hand without even setting up an environment other than having a pre-existing hole into the Void.

Torabi

You're probably best off asking a developer directly (via twitter) whether or not this is intended behavior.

megascience

Well, I've always doubted they intended for mobs to walk into the Void. I mean maybe there's a reason, but I think it was just a forgotten part of the code which ends up causing mobs full of mapmaker NBT to commit suicide and be a frustration to recreate. At least that's how I see it'd be an issue in modern Minecraft: All the mapmaker ability on entities, and mobs can just walk off and be deleted on contact.

Torabi

It doesn't matter if you doubt it. You need to either bring the issue up directly with the developers, or prove to the moderators that it's not intended. The easiest way to accomplish the second would be the first. They're not going to reopen the issue just because you ask.

kumasasa

Reopened.
Unclear if oversight or intended or working by design.

megascience

Thank you. Of course if it becomes agreed to be intended, I'll accept it being closed again. I am only concerned, as said, 1: Because all mobs now utilize the new AI to varying extents. 2: With all the data attached to mobs, mostly with custom maps, I'd consider mobs deleting themselves an issue. 3: They can't walk on the Void, so I find it odd they'd path over it.

kumasasa

Fix by @unknown of MC-5397:

Possible fix
Using MCP naming.

PathFinder.getSafePoint()

...
        if (var9++ >= entity.func_82143_as()) {
            return null;
        }

        --y;

        if (y > 0) {
            var7 = this.openPoint(x, y, z); // Accept a point in mid air, eh?
        } else {         // FIX: lets cancel that possible mid air point if reached void.
            return null; // FIX
        }                // FIX
    ...

Tested on 1.4.7 and at least creepers learned to look down.

megascience

Nathan Adams

Community Consensus

AI, fall, mob, void

Minecraft 1.4.4, Snapshot 13w04a, Minecraft 14w04b, Minecraft 14w05a, Minecraft 14w05b, Minecraft 14w06b, Minecraft 14w07a, Minecraft 14w08a, Minecraft 14w10b

Minecraft 14w10c

Retrieved