Input Lag (Touches) on mobile, on certain low-mid end devices.

29 views
Skip to first unread message

Esteban Dal Monte Roquero

unread,
Mar 8, 2016, 11:55:00 PM3/8/16
to haxef...@googlegroups.com
Hi!, I've been working on a small game for android and always tested in my nexus 7 as well in flash and pc target. 

Since I realized that some devices had issues with rendering the game at 60 fps I put "FlxG.fixedTimestep = false;" so now the game works mostly at 50 on those lower end devices but it still runs fast.

The issue is that in those cases I have a big input lag time. My code is pretty simple. something like this. The issue is that there are some friends who tried the game on newer devices that ran the game at 60FPS and they still had an input lag. I suspect there may be something more...

#if !mobile
if (FlxG.mouse.justPressed)
{
this.Jump();
}
#else
for (touch in FlxG.touches.list)
{
if (touch.justPressed)
{
this.Jump();
break;
}
}
#end

I already tryed setting fixedTimestep true, played with some stuff but still. The issue till now is that given I'm using FlxExtendedSprite I can't just set ;

<!--haxedef name="FLX_NO_MOUSE" if="mobile" /-->

 and see what happens. I still need the mouse working for some draggable sprites. Anyways the code in mobile should be using FlxG.Touches for the jump so it shouldn't be an issue.

Is there anything I can do for the touch to be a priority over rendering or something?

Thanks!


PD:

I'm having lag each time I click with the mouse on the flash version (or touch in the mobile). In the mobile older devices it becomes more apparent (like 10 frames less). I ran a profiler clicking like mad and the letting the character just stay there animated. As you can see, the "waiting for GPU" appears while clicking.

Link to the scout

Reply all
Reply to author
Forward
0 new messages