Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Walking Around Corners #1730

Open
Morphan1 opened this Issue Apr 1, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@Morphan1
Copy link
Contributor

Morphan1 commented Apr 1, 2019

When player NPCs reach a barrier that they are meant to walk around, they sometimes get too close to the walls and prevent themselves from properly walking around. This has effects ranging anywhere from sliding sideways along a wall until they forcibly pass it to the more extreme cases of slamming into a corner and never continuing, as shown in the screenshot below.

(The full path taken is in black, the remaining desired path is in red.)
image

You can use /npc move further along in the desired path to force it to continue until it hits the next corner, so it does seem to be trying its best, but it will not move again on its own.

Non-player NPCs seem relatively unaffected by this, and can navigate the maze without issue.

A likely irrelevant side note: this issue exists both with use-new-finder enabled and disabled. In the case of it being disabled, I was unable to generate a path through the miniature maze in the screenshot altogether.

@mcmonkey4eva

This comment has been minimized.

Copy link
Member

mcmonkey4eva commented Apr 15, 2019

This is a fairly problematic issue.
In the process of testing #1740 I had to give the NPC an extra door because it kept slamming into the wall next to the door instead of walking through the open door.


EDIT: Example of how basic a setup the NPC gets lost with:
doorsarehard

The NPC was able to open the door and walk through (traveling straight east), but then when asked to turn around and go back through (traveling west with a bit of angle) it just slams into the wall


EDIT2: my general guess while looking at how it moves is that the NPC misunderstands its own precise position and is going for integer block coords instead.

As demonstration of that guess: here is the NPC being asked to walk due west (negative X) to the stone block (specifically: the centerpoint of the airblock above the stone):
westward
and here an NPC is asked to walk due east (positive X) to the stone block (same centering):
eastward
You can see that the NPC is significant farther off in this case.
In both cases the path margin is 1.
I think it's aiming for the lower edge of a block, rather than the decimal precise point.


I notice when walking towards the door from the wrong side going straight through, it will for a moment turn towards the corner then reorient itself straight, quick enough that it actually manages to get through (when it doesn't actually need to rotate to get through). When there's even the slightest bit of angle (I'm testing with a roughly 30 degree angle here) it will get stuck on the wall, as it fails to achieve rotating at the correct time.
Actually, when approaching from south (positive Z) it's able to achieve the rotation and get through.
When approaching from north (negative Z) it fails to rotate.
This lends more likelihood to it being a reaction based on the corner of the block rather than the center.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.