Jump to content
  • Advertisement
Sign in to follow this  
Naash

Reducing Latency for a Real time peer to peer android game on WifiDirect

This topic is 503 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
1000 ms for local WiFi sounds off.
Are you wire WiFi Peer to Peer is actually the right solution?
How about using regular IP networking with a connected WiFi access point, or even internet play?
If you're on WiFi, a UDP broadcast should let peers find each other and be ready to play.
The latency of two peers connected to the same access point should be much lower than what you're seeing on WiFi Peer to Peer.

Share this post


Link to post
Share on other sites

Most real time peer to peer games on play store do not support WiFi Direct. They either use bluetooth ,Local Wifi or internet . The games that do work on Wifi Direct are mostly turn based. So should I infer that its not possible or extremely difficult to get a real time multiplayer game working on Wifi Direct ?

https://sites.google.com/site/androidmultiplayergames/home

 

I did realize that the wifi p2p api does some extra processing on the group owner due to which it increases latency.

Share this post


Link to post
Share on other sites

So should I infer that its not possible or extremely difficult to get a real time multiplayer game working on Wifi Direct ?


That seems prudent, yes.

I don't think the extra latency is because of processing, but because of something else, such as hardware limitations.
1000ms is a LOT of processing, even on an old Android phone.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!