What is the best way to sync object positions over a network with the LLAPI?
First of all I'm trying to do this with the LLAPI not the HLAPI so please don't suggest the Network Transform :)
Having said that, I have a scenario with say 20-30 objects that the server is generating movement on, a representation of a player (connected to a client) is in the middle of the objects and needs to get the position updates for each object. The client side prefab doesn't have a rigid body or motion of any kind, it is getting all of the position information from the server.
There is a script on each server object that is sending it's position information (if it is moving and in range) to the player's client at a specified tick rate (10 times a second for testing), each message that is sent is about 80 bytes, which I hope to get down to around 40 bytes. So far I can't get a tick rate above about 8-10 before serious lag and slowdown issues happen and this is on a LAN. I've read that networked games get 30 to even 120 tick rate with messages about 40-80 bytes. What am I missing? I'm generating a string and converting it to bytes using Encoding.ASCII.GetBytes() which may not be the most efficient method but I don't think that would be were the slow down is?? Should I have the script on the server player object get all object positions each tick and send it to the client? That would generate lots of data at once that would have to be broken up and queued I would think, I'm just not sure what the right approach to this problem is.
I would rather not have to switch to the HLAPI since I like the low level approach and it must be possible or else it wouldn't be achievable using the HLAPI I just don't know how to do it. Even a book recommendation or article explaining the best approaches would be helpful.
Thanks for any help!