Distinguishing between multiple touches
MaceOfTanis
Member Posts: 6
We are building a game that heavily relies on distinguishing between 3 different touches.
One actor, “Touch1” is being constrained to the first touch on the iPhone and another, “Touch2” is being constrained to the second touch on the iPhone. The problem is, sometimes when the 3rd touch is on screen, the 1st or 2nd touch seems to warp and become the third touch, because the Touch1 or Touch2 actors will warp to the new area even if my first and second fingers are perfectly still.
The glitch doesn’t happen all the time, in fact its extremely difficult to reproduce, but its consistent enough for me to be worried. The third touch point appears to be affecting the first two even if I’m just sliding around with a third finger nearby. It makes them jitter a little.
Does anyone have any idea how Game Salad is distinguishing between the touches? My guess is that the heat from the touches is bleeding over so that the iPhone is only registering one touch, or is centering the touch in a slightly different area, changing the center of the touch points.
But this is really all speculation, because I’m not entirely sure how touch distinction works on the iphone or how Game Salad handles it, can anyone give me any insight?
My next shot at fixing the problem is simply changing the position Touch1 and Touch2 actors to their respective touches ONLY when the touch value is less than 100 pixels away (or something like that) That way it couldn’t warp around if they tried.
Anyone have any ideas?
One actor, “Touch1” is being constrained to the first touch on the iPhone and another, “Touch2” is being constrained to the second touch on the iPhone. The problem is, sometimes when the 3rd touch is on screen, the 1st or 2nd touch seems to warp and become the third touch, because the Touch1 or Touch2 actors will warp to the new area even if my first and second fingers are perfectly still.
The glitch doesn’t happen all the time, in fact its extremely difficult to reproduce, but its consistent enough for me to be worried. The third touch point appears to be affecting the first two even if I’m just sliding around with a third finger nearby. It makes them jitter a little.
Does anyone have any idea how Game Salad is distinguishing between the touches? My guess is that the heat from the touches is bleeding over so that the iPhone is only registering one touch, or is centering the touch in a slightly different area, changing the center of the touch points.
But this is really all speculation, because I’m not entirely sure how touch distinction works on the iphone or how Game Salad handles it, can anyone give me any insight?
My next shot at fixing the problem is simply changing the position Touch1 and Touch2 actors to their respective touches ONLY when the touch value is less than 100 pixels away (or something like that) That way it couldn’t warp around if they tried.
Anyone have any ideas?
Comments
I did it for my game and I have 5 different touches that works without any glitch .
Roy.
I know they are moving the joystick based on which touch actor is colliding with the stick. The trouble, I can’t actually tell if it’s really being accurate. Based on the tests I’ve done on my game, it seems like there’s a way to make the sensors in game salad mix up if you are spamming more than 2 touches, such that one of the touches (like touch 2), will move towards the XY of touch 3 instantly but, I can’t see the actor’s so I can’t determine if this demo has that problem. It wouldn’t be easy to see because it will literally start treating what was your 3rd touch finger as your 1st or second so the joystick touch display number probably wouldn’t change in the demo. That’s why I wanted to display the touch actors, so I could really see if whether it breaks like mine does.
Another problem I found today is as follows: I set up a blank scene with 5 actors, each one appears based on the touch count of the scene and follows your respective finger. The actors will move offscreen when you don’t have enough touches. (Example: touch 3 moves away if you have less than 3 touches on screen.)
It all works fine…until you start releasing them. If I have touch 1, 2 and 3 activated and you release touch 1, touch 3 moves off screen because there are only 2 touches onscreen(which is good), but touch 1 remains(which is bad), not moving even though it has nothing follow, its coordinates remain the same as when you released them and when you ask what its coordinates are.
In our particular game this is a problem because a rectangle is being constrained and rotated to the area between 2 touches, when these touches get thrown off from spamming, or you release a 1st or 2nd touch while leaving a 3rd one onscreen it freezes one of the first touch actors that is guiding the rectangle, and it throws the whole game off. It’s basically saying that a touch is at a specific coordinate point when that touch isn’t even on the phone.
Heh gosh darnit this sounds like the most confusing thing ever, I need to find a better way of explaining this. This is such a bizarre problem, I can’t figure out if my logic messed up or if I’m just reaching a roadblock because I’m misunderstanding how Game Salad manages and defines multiple touches and their various coordinates.
just hesitated because it's difficult to test on my laptop mac.
no, I haven't got the GS viewer running yet, oh well
(it would be cool to have a way to simulate multitouch on GS laptops?
until Apple makes the OBVIOUS realization -
"our laptops should offer multitouch screens also! And run iOS apps" ;-)
I don't know, but I suspect that one of the touches is momentarily losing tracking on the screen?
long enough to lose it's numerical status in the hierarchy
which may well be a hardware issue.
Honestly, I've never seen a better touchscreen than on my iPad*, but nothing is "perfect".
(*it can track 11 touches at once! Honestly, that is an AMAZING technical achievement.)
To avoid momentary glitches (which this might be?) you might implement some sort of "delay system",
only making large adjustments in X-Y if the new coordinates are consistent?
good luck, I'm interested to see how it turns out.
@XyloFUN thanks! it turns out the actors in joystick demo weren't showing up because "Visible" wasn't checked.
After checking out the joystick demo it looks like it has the same potential problem. I blew up the joystick bases to a huge size, (which kinda represents how my game works) and they still had potential jumping/warping issues when I started tapping other areas while I had the joystick grabbed. It DOES seem like some kind of hardware problem.
I talked to Game Salad support and they also seemed to indicate that the heat detection for touch can sometimes confuse touches if they are close together.