Bot Has Choppy Movement

Hello Facepunch,

So, I’ve been experimenting around, trying to create fake clients that are controlled by nextbot entities.

My plan is to set the fake client’s position every frame/tick in a Move hook to that of the nextbot entity’s, which creates paths for the fake client.
However, with my code for it, the movement is VERY choppy. I am sure that this is not a problem with the nextbot entity.

Can someone help?

Here is the code: http://pastebin.com/zFz1p0pC

Thanks!

[editline]2nd August 2016[/editline]

Okay, so after some testing, I found out what the problem is. The NW2 var I’m setting for the bots isn’t being set clientside for some reason, so the code in Move doesn’t get run on the client, leading to the choppiness. How would I make the NW2 var get set on the client?

This choppy movements are due to the server sending the data to the client and the client just setting the nextbots pos when it receives its info.
So what you should do is also as well calculate the path/set the pos on the client, so its “predicted” and so it doesn’t seem that choppy.
This is for example what happens with weapons, because if prediction didn’t exist, you would see weapons take a lot longer to shoot.