CitizensDev/Citizens — Issue #357: Pathfinding - Signs, fences, and a lot of bugs. (also: Jack-O-Lantarn helmets)
Author: Laloeka
Created: 2011-10-31 15:40:52+00:00
State: open

I am using Citizens plugin 1.1.2 for CraftBukkit Build #1337 (i think, not sure actually. But I doubt it has anything to do with the issue)

1. I was testing a bit with the NPC's pathfinding algorithm so I set a waypoint at one side of the wall, and a second waypoint on the other side. On one side I put a sign down in front of it. This should not make a difference, but it did.

The NPC used the signblock to create a route over the wall, but the signblock is actually nonsolid, so the NPC could not jump over the wall and instead he just kept jumping in front of it. The wall was 2x3x1 (height x length x depth) and was centered between the two waypoints I set with /npc waypoints

The max distance for pathfinding was set to 1024, but I also dont think that's important to know.

2. Then I tried to block one waypoint with fences, as I expected the NPC just jumped over the fences, because they are in fact one block high, only with players and mobs the fences are seen as 3/2 block high. This should also be fixed.

Then I made a lava pool, the NPC walked around it. So that works :)
3.a Then I made a water pool, depth: 1 block. Also worked fine, except that the NPC was jumping ON the water, and not IN as players and mobs do.
3.b Then I made a water pool, depth: 2 blocks. Here the NPC tries to jump out, but cant because he does not swim up, just walks over the floor of it.

3.c Then I made a water pool with a depth of 1 block, but surrounding it by one layer of dirt, so that it looked like this:

[#] [#]
[#][#][~][~][~][#][#]
[#][#][#][#][#][#][#]

Here, a player would get stuck, the NPC however, made a path over the dirt wall, but was not able to jump it, because it is a 2-block-high wall from the floor of the water. So here the NPC got trapped again.

4. What I also noticed is that NPCs, whenever they leave a waypoint, never check if their route isn't blocked in the meantime they are walking. Possibly you can add the option to let NPCs check every other second if their route is still valid. or make even the delay customizable.

5. Then I got my NPC to fall in a lava pool, after that, the NPC refused to jump until I reloaded all the plugins via /reload. This generates some errors on Citizens though.

6. NPCs occasionally route through (closed) (wooden?) doors and they do not trigger any pressure plates, which makes it very difficult to navigate them through a city.

7. Pushing them off a mountain will not trigger them to recalculate their path.

8. Oh, and about the Jack-O-Lantarn helmets, the pumpkins work just fine, but the Jack-O-Lantarns make the NPC either invisible or teleport them to somewhere where I couldn't find them.

Note that all of the above was experienced with a NPC that has not been toggled to any special NPC type.

Besides those bugs it is a GREAT plugin and I will definitly be using it in my private server :)
Thanks for your time to read this and even more thanks for making this awesome product!