Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Multi Touch Problem — Gideros Forum

Multi Touch Problem

MillerszoneMillerszone Member
edited October 2011 in General questions
I finished converting my pong game to Gideros, but having one problem. The pong
game is Single and Multi Player. I used MOUSE_MOVE which worked
great for single player, but forgot that MOUSE_MOVE is for single touch. So now
I'm using TOUCHES_MOVE, but having problems with multi touch.
Sometimes it works, if I touch the left paddle before the right paddle, the left paddle
moves o.k, but if I touch the right paddle first, the left paddle won't move when
Touched. Then sometimes the paddles might jump.
I looked at the "Touch Explorer" example, but I'm still having trouble.

Do you have a small multi touch example with objects?

These are the names of my paddle objects, paddleMoveLeft and paddleMoveRight.

Thanks

P.S.
I noticed that Touches are almost instant with Gideros compared to GLBasic and the other Lua SDK
where there is a slight lag.

Likes: Yan

Tagged:
+1 -1 (+1 / -0 )Share on Facebook

Comments

  • atilimatilim Maintainer
    Hi Miller,

    If possible, can you send me some code that produces this problem? (maybe you can send me some part of your code) my email is atilim@giderosmobile.com

    Thanks

  • MillerszoneMillerszone Member
    edited October 2011
    I believe part of the Multi-Touch problem has to do with Gideros.

    My touch code would work very smooth one time and sometimes it would lag.

    So I tested Gideros "Touch Explorer" example again and it does the same thing.
    It works smoothly most of the time, but if you exit Touch Explorer and run again,
    it sometimes lags. It might lag after the first exit or it could take up to 10 times
    before it lags.

    The mouse events singe touch works ok.

    I tested on a iPhone3GS(iOS5), with the player and Xcode exported, with the same results.
    Using latest beta 2011.9 beta2, which is working great!


  • atilimatilim Maintainer
    @Millerszone
    this is interesting. Can you please run "Touch Explorer" with print statement at line 29 commented out? Printing all the touches to the console may slow the player. Also I will investigate this further.

  • MillerszoneMillerszone Member
    edited October 2011
    O.k I retested "Touch Explorer" with line 29 commented out and got the same results.
    I also tested on an iPad 2(iOS5) and it lagged even more. Actually on the iPad 2 I could
    never get the touches to move smooth.

    I used Export to Xcode for the test using latest version of Xcode.

    Ill be glad to do more test.
  • atilimatilim Maintainer
    After your message, we've also met the same problem and started to investigate it.

    Thank you.
  • SinisterSoftSinisterSoft Maintainer
    Was this problem solved?
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • I would like to know how in Giderous/Lua I enable multitouch and also from initial tests (i.e. a drum pad/machine I wrote this afternoon) why touch events are so slow on Android as compared to iPhone/iPad.
  • MikeHartMikeHart Guru
    edited June 2012
    Multitouch is always enabled. Just look at the "Touch Explorer" example of Gideros and there you see how you can retrieve the informations.

    Slow on Android? I can't confirm that. With me it is fine. Am running an HTC Desire with 2.33 on it.
  • phongttphongtt Guru
    edited June 2012
    zero experience with Android. But I used to hear something like that or something like the touch event affects the framerate of any app (Android system issue). Anyone confirms?

    Likes: MobAmuse

    +1 -1 (+1 / -0 )Share on Facebook
  • MobAmuseMobAmuse Member
    edited June 2012
    I've been testing on Samsung galaxy tab s 5inch and used the sound 1 2 3 audio demo as a basis to build on. On this device when actually built for it as an apk it is a little faster but still too slow to be useful for drums and also it does not register mutlitouch, not even when running on iOS. I will check out Touch Explorer to see what is going on tho cheers. Currently I'm just evaluating the engine and was all good until I hit this brick wall on Android at least.

    [update] I tried some random music apps on the same android device... they were just as bad pretty much. It must be a poor device to be honest. Jeez.
  • avoavo Member
    Not sure about the performance issue you are having but make sure you are using touch events and not mouse events if you are trying to do multi touch.

    Likes: MobAmuse

    +1 -1 (+1 / -0 )Share on Facebook
  • Also it could be that the sound playing lags and not the touch detection.

    Likes: avo, MobAmuse

    +1 -1 (+2 / -0 )Share on Facebook
  • Thanks I will try that and yes I think it's actually sound latency on android that is the biggest problem with hindsight and not the touch so much.
  • For short sounds you need to use WAV files as it takes time to decode the MP3 files.

    Likes: MobAmuse

    +1 -1 (+1 / -0 )Share on Facebook
  • MobAmuseMobAmuse Member
    edited June 2012
    I got multitouch working now using the better Touch Explorer example but latency on triggering samples is still an issue of course so far. I am using 44Khz wavs but will try reducing sample rate etc. shortly.

    [update] All working great now on iOS but feels like around 100ms sound latency/lag on Android galaxy tab s 5 wifi device, multi-touches are instant tho because I light up the drum pads when I trigger the samples. I conclude therefore a great cross platform engine but the android sound layer must be crud (as well documented elsewhere) for music apps and that's probably why with most the performance is poor that are on Google Play rather than the fault of the developers or engine. Now my testing is over I might write a game with it at least that does not require rock solid sound triggering. I therefore give Gideros 9/10 as it's pretty damn good indeed at what it actually does and can do :) Not bad progress for 2 days work either.

    Further reading on Android sound latency problem...
    http://www.rossbencina.com/code/dave-sparks-on-android-audio-latency-at-google-io-2011
  • Sorry I derailed this thread somewhat from the initial subject about Multitouch, rather that's how things unfolded for me as I progressed with my test app. Multitouch works great on all target devices via Gideros that was my fault for basing my app on the wrong example code - Gideros rocks! :)

    Likes: phongtt

    +1 -1 (+1 / -0 )Share on Facebook
  • MobAmuseMobAmuse Member
    edited June 2012
Sign In or Register to comment.