If you are making a game for both Android and iOS, then chances are that you've noticed a difference in usability.
This can be even more drastic in the Android market, as the number of devices and specs can range wildly from very good to paper weighty.
However, in terms of iOS devices, there is a known problem with touch controls in a Unity3D game.
I discovered this problem while working on Jumpy Blocks, a free mobile game that is now and available on Android and iOS.
I built the game for Android first, because it made testing each build easier due to not having to use Xcode, and then I ported the game to iOS.
On the Android side, the controls were perfect and there were no usability issues.
When I played the game on my iOS devices however, I got laggy and error prone responses from the touch controls.
This completely baffled me at first.
How is it that the game works perfectly on Android, but then when I built the game for iOS without changing a single line of code it all of a sudden doesn't work with the touch controls?
After doing some research, I discovered what the issue was.
It turns out that iOS runs with a few milliseconds of delay on the touch inputs from Unity3D.
I have seen comments from people saying that they had never had this particular issue with previous versions of Unity3D such as the 3.0 and earlier, which leads me to believe this is a Unity3D problem.
Unfortunately, Unity3D has not as of yet made note about a fix for this particular issue.
However, there are some ways to improve upon the lag, but first let's understand what is actually happening when you are getting the lag.
If you have a swiping game and you make a long swipe, the lag is essentially causing the game to lose a frame. This means that the game will lose track of the start of a swipe, thus not registering the end of a swipe.
If you have both swipe and tap controls, this could lead your game to believing that you only tapped the screen, when in fact you made a swipe.
Ways to improve upon this is to allow the player to make smaller swipes.
If you can reduce any swipe resistance from your code down to the bare minimum, or make a swipe bar on the screen smaller, you will improve the chances of the swipe being recognized and completed within the game before a frame is lost to lag.
Unfortunately, there isn't a whole lot you can do as a developer to fix this problem. You can change your controls from being swipe based, you can try to reconfigure how your game identifies if a swipe was made in order to take loss of frames into account, or you can try to utilize buttons and taps.
Just know that the touch lag issues are not a problem with your game, but with how Unity is being run and handled by the iOS devices.
I hope this article can help alleviate some of your frustrations and lead you in the right direction for finding a potential workaround.
No comments:
Post a Comment