Hi everyone,
I will explain my current scenario and the issues that I am facing. I have been assigned to add multiplayer in a single player game which exists on android platform. For connectivity I used android's Wifi Peer to Peer API which allows devices to get connected via WIFI Direct.
Logic is pretty much implemented and data does get transferred using UDP, however I am facing latency issues which is making game unplayable. I should mention 2 things that I observed
1. Latency is more apparent on low end devices, meanwhile on high end devices movements seems to be in sync.
2. Latency keeps on increasing gradually.
I am referring to Gaffer on Games blog for networking aspects. As per that blog I did implement logic to find out round times for packets.
Strangely RTT values oscillate between 300 to 1000 ms when tried using one high end and one low end device. When tried with one high end and a device with moderate specs, RTT values don't climb above 700ms. Surprisingly, I am not facing much packet loss or out of order packets. Packets are sent at the rate of 30 per second. I tried reducing the packet size and it didn't give any different result.
What all can I do to mitigate this latency ?
I was looking into client side prediction to counter this latency, but not sure how it will be implemented considering the extent to which this latency climbs.
Thanks.
Nishant