CitizensDev / Citizens2

Citizens - the premier plugin and API for creating server-side NPCs in Minecraft.
https://citizensnpcs.co
Open Software License 3.0
600 stars 315 forks source link

NPC rotation issues #983

Closed Brokkonaut closed 7 years ago

Brokkonaut commented 7 years ago

In the latest version player npcs don't look at you if /npc lookclose is activated. They just look in the same direction all the time. Even with /npc tphere they don't change the direction they are looking at.

drekryan commented 7 years ago

As with every Citizens build something that was working fine has to be broken. I dont think the people actually submitting the code are actually testing it so here you go I will help. Here are two instances of how broken lookclose is now.

First: https://i.gyazo.com/a80af88a1b3fff5318c8ef4717f4d113.gif

Look Close works best when they actually look at you. Which every npc no longer does.

Second: https://i.gyazo.com/738f95bc71275be3295de355007340ce.gif

You gave a few too many drinks to my perfectly fine snowman. What is wrong with him?

mcmonkey4eva commented 7 years ago

Sorry @drekryan our lead developer is rather busy and doesn't always have time to test as thoroughly as possible. Thankfully, users like you two are here to point out what was missed and help us get it fixed :)

fullwall commented 7 years ago

Try latest build?

drekryan commented 7 years ago

@fullwall @mcmonkey4eva Please reopen this. I am still having both issues mentioned in my comment on this issue. There is literally no change between the previous build and the latest.

Brokkonaut commented 7 years ago

Now it is more bugged than before.. they just circle the head around (but don't look at the player) and the body does not rotate at all

fullwall commented 7 years ago

Try latest build @Brokkonaut.

@drekryan sorry, got thrown off by the issue title.

Brokkonaut commented 7 years ago

Still not working for all NPCs. Some NPCs with lookclose just rotate around very fast - But now also the body rotates.. I think it depends on the direction you approach them, if they will rotate or look at you.

Edit: Maybe it works now, after some minutes of rotating they stopped and now correctly look at me. I am currently no longer able to reproduce the rotating behaviour

ghost commented 7 years ago

I have the sam problem with lookclose command ... they just go crazy and dont look at you at all ... pls fix asap :)

mcmonkey4eva commented 7 years ago

Seems to affect 1.10 as well! (On latest Citizens build)

Sikatsu commented 7 years ago

977

Exactly my issue too.

MusicScore commented 7 years ago

Same issue, Player NPCs do not rotate properly. Mob-type NPCs do rotate correctly in respect to the yaw, but their pitch is broken. If I stand one block above it, it will look one block below me.

fullwall commented 7 years ago

The pitch bug should be fixed in build 1439. Working on spinning.

fullwall commented 7 years ago

Try build 1440 for a possible spinning fix.

MusicScore commented 7 years ago

Tested with a Villager NPC with latest build. It doesn't look at the player properly half the time, and its head movement in respect to the yaw is not fluid. Its head rotation in respect to the pitch is working fine, though.

UPDATE: Tested with a Skeleton NPC. Its head rotates strangely and does not fix on one spot at all. The pitch is okay.

fullwall commented 7 years ago

@MusicScore build 1441? works for me.

MusicScore commented 7 years ago

Villager NPCs still do not rotate properly. Rigorous testing on a Skeleton/Zombie NPC makes its head violently snap at random angles. Player NPCs apparently do not rotate their heads at all. Player NPC bodies rotate at a constant rate, and do not correlate to the position of the actual player. EDIT: Note that I'm using Spgiot 1.10.2

fullwall commented 7 years ago

Try 1442 for the villager bug, I am aware that player NPC bodies aren't ending up square to their target, just need to figure out where in the Minecraft code that is.

MusicScore commented 7 years ago

Villager rotation is okay. It's still jumpy/nonfluid in respect to the yaw, but its rotation is accurate. UPDATE: Tested with Zombie and Skeleton. They have the same rotation pattern/issue as the Villager, and they do not break after rigorous testing. UPDATE 2: Tested with Player NPC. The body rotates correctly. The head does not rotate at all. UPDATE 3: Expanding testing to other types of mobs. I will return with a list of mobs that do not have correct rotation patterns. UPDATE 3.1:

On an unrelated note, Squids have a tendency to start trying to slide away before it corrects its position. This is not a big issue, but I thought I'd mention it.

drekryan commented 7 years ago

Agreed that the title of this issue doesn't really fit what the issue has turned into. It doesn't just happen to player NPCs as the title states. It's a much bigger issue than just that. However I felt it was best to tack my findings under it instead of opening a new issue. The wording of the title couldn't hurt from being updated however

drekryan commented 7 years ago

What's the status on this issue?

fullwall commented 7 years ago

I have fixed some of your issues @MusicScore. Players are working for me currently so not sure on that one. Polar bears don't seem to be able to look around faster, could be a client thing.

Brokkonaut commented 7 years ago

At least one bug still exists: If no player is close to citizen with "lookclose", the citizen is always looking in south direction. in previous versions he stayed looking in the direction the player was before.

MusicScore commented 7 years ago

On Spigot 1.10, the problems appear to still persist.

On Spigot 1.11, Player NPCs work. The rotation delay with Horses, Magma Cubes, Slimes, and Ghasts persists, but I'm not too bothered by it. Polar Bears now have the same rotational delay as the above four mentioned mobs (meaning they don't take ten years to rotate). Ender Dragons, Guardians, Silverfishes, Endermites, and Bats appear to be fixed.

On both versions, the rotation can be a bit sticky with respect to the yaw (it jitters sometimes), but I'm not so concerned with that.

EDIT: Can confirm Brokkonaut's issue. Player NPCs will look to the south when the player exits the lookclose range. Other mobs do not share this problem, but they will turn their heads away if they are forced to rotate quickly immediately prior to the player exiting their lookclose range.

fullwall commented 7 years ago

Thanks, I will look into these issues tonight. It seems that Minecraft has added some local render yaw delay which may explain these rotation delay issues.

MusicScore commented 7 years ago

Can confirm that Player NPCs work on 1.11. All rotation issues on 1.10 still exist. EDIT: I have yet to test Vexes, Llamas, etc.

NASH0XX commented 7 years ago

Having this same issue in 1.10.2 spigot with latest build.

Please fix it, thx.

fullwall commented 7 years ago

@NASH0XX which build is that?

Nutty101 commented 7 years ago

using net.citizensnpcs.util.Util.faceLocation(npc.getEntity(), {location}) does not seem to change their direction at all anymore. 1.10 / 1.11 on build 1456. 1420 they work in 1.10.

1458 same issue. untitled

in older versions it would look where the line was cast.

fullwall commented 7 years ago

@Nutty101 check latest build.

Nutty101 commented 7 years ago

That fixed it! Close this one out :)