The mystery of the lost touch events, 1.7 edition

JonJarnJonJarn SEMember

Hi,
With 1.7 being out of pre-release I thought this would be a good time to convert my ongoing game.
It took a bit more time that I thought (there were some things changed that I didn't expect, like for example CCTextureCache not having a public constructor anymore), but when I got down to the Layer code level, it was mostly search replace Application with GameView.

Anyhuuuw,
My game is based on tracking touch-moves to do stuff with the game environment (sorry, don't want to spoil too much of the game idea). Getting the touch events with accurate data is key to the game play. For the sake of discussion, pretend I'm drawing a line to show the finger movement.
When using v1.6.2, I got accurate touch-move-events with each CCTouch pointing to the previous location (PreviousLocation property of the CCTouch class). Logging the data I got in the touch move event could look something like this:

touchbegan: location 100,100 previouslocation 100,100
touchmove: location 110,80 previouslocation 100,100
touchmove: location 120,60 previouslocation 110,80
touchmove: location 130,40 previouslocation 120,60

With my game converted to 1.7.1, it seems some touch events are gone missing. Logging the events looks like this:
touchbegan: location 100,100 previouslocation 100,100
touchmove: location 110,80 previouslocation 100,100
touchmove: location 130,40 previouslocation 120,60

...with CCTouch.PreviousLocation pointing to locations that where not received.
I also occasionally see a drop in framerate which might be connected.

I tried removing parts of my game, and the more I remove from the game, the less touch events are dropped. If I do a very simple layer (like the showcase project template) no events are dropped. But please note that I do not have a very graphic intense game, nor a lot of things happening. It has physics and a few things moving around, but pretty vanilla IMO.

I can of course try to compensate for the missing events, but I wanted to highlight this anyway since it seems to be something weird going on in 1.7.

Is anyone else seeing similar things?

(I'm using iOS and the simulator.)

Posts

  • filipdusekfilipdusek USMember

    I'm looking at the code right now trying to get my UI framework running under 1.7.1 and hit similar issues with Touch. I think that CocosSharp is not using MonoGame touch support anymore, but platform specific custom implementations.

Sign In or Register to comment.