I am making NPCs that have a position on the server but are also rendered (and actions calculated) on the client side before it receives information from the server on what it should do. Im wondering how would I sync the client side to have the npc in the proper positions when it strays from the server, without it looking like the npcs are teleporting? I’m not sure where to start, would I just teleport the NPCs to where the server says?
The reason I am having the client calculate what the npcs should do before the server tells it is that my game can be very fast paced when there are enemies and I want to make sure it runs smoothly, without latency issues.
NOTE: The npcs on the server are just position and coordinate data inside of an array.
Even though the client calculates what the npc should do, depending on how close other players are, the npcs actions could completely differ from what the client calculated, and if so it would cause a big difference between the server calculations and the client calculations.
I don’t need any specific code, Im just looking for an idea of where to start and what to look into. Currently I made an npc movement calculation script as well as a procedural animation script, but as of currently this only runs on the server side.
I havent seen much on the forum for syncing in this type of structure, Thanks in advance if someone can help!