After three weeks of hard work I finally fixed the multiplayer lag. There were several bugs that tripped me up and took a long time to find/fix. The worst of which was caused by my Xbox One controller. There was a consistent lag of about 0.5 seconds that would occur every second or so. I spent a few days stripping everything down to find out what the problem was. The worst part was when I verified the lag and spent some time going down one avenue then tested it again and the lag was gone. This happened because sometimes I had my controller on and sometimes it was off. When the controller is on it interferes with the Wi-Fi somehow, causing it to lag. The current solution is not to use the controller at all. It doesn't affect the send rate so only the person using the controller sees the lag, they still appear normally on everybody else's screen. I want to put together a test project to see if it's caused by the networking library or if it still happens when using Unity's built-in networking. I emailed Photon about the problem but they are not confident they can do anything about it. I'm using my SteelSeries Stratus XL controller for now because it doesn't cause any lag. Sometimes the triggers get "sticky" causing problems in the game but I find a fresh pair of batteries makes it work better.
0 Comments
|