GS's template for the joystick (glitches and problems with it).

jckmcgrawjckmcgraw Member Posts: 647
edited February 2012 in Working with GS (Mac)
Hello Everybody,

I have been having some problems with the joystick... At random times it will "glitch out", and go to the same spot every time when you press down and try to move. I haven't changed any of the logic either. I have tested it on many different generations of both iPhones and iPods, and the problems still persists ***occasionally***.

Does anybody have a more reliable joystick that they have made themselves? Is anybody running into a similar problem?

Thanks in advanced,
Jack McGraw
«1

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    I've used the joysticks and never had a problem but you must remember that preview is not reliable and can glitch up. Try restarting GS and try it.
  • jckmcgrawjckmcgraw Member Posts: 647
    @rks where can I find that?
  • jckmcgrawjckmcgraw Member Posts: 647
    @rks Ummmm... Ok.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
  • kkertzkkertz Member Posts: 12
    I've had this same issue.
  • allornothingallornothing Member, PRO Posts: 126
    I also have had this exact issue crop up during playtests. Occasionally the joystick will snap to a position and hold there regardless of you pressing it. What I have discovered is that if you tap the screen with 5+ fingers at once, it resets and functions normally again - this leads me to believe the issue is tied to the 'touch' actors not going back to their off screen position. I think thats the problem, but I don't know how to fix it.
  • jckmcgrawjckmcgraw Member Posts: 647
    @jonmulcahy Nothing came up.

    @allornothing Hmmm... At least we're getting somewhere.
  • 3xL3xL Member Posts: 676
    i used CodeMonkey's template for my game "My Zombie Date!" and i can assure you its glitchy as well. you can download it and see for your self. that game is FREE right now. the glitch happens randomly. its not that horrible but it is noticeable. maybe its gamesalad's algorithms with multitouch? perhaps this will get fixed once GS goes Xcode. cheers!
  • jckmcgrawjckmcgraw Member Posts: 647
    @3xL Yikes. That's kind of disappointing. I guess I'll have users deal with it.

    Thanks for everybody's input and such,
    Jack McGraw
  • simo103simo103 Member, PRO Posts: 1,331
    @jckmcgraw ... you're welcome to poke in Codemonkeys template in case you want to compare: http://www.funkymunkygames.com/Promo/joystick_controls.gameproj.zip
  • jckmcgrawjckmcgraw Member Posts: 647
    @simo103 Thanks I'll check it out!

    Jack McGraw
  • allornothingallornothing Member, PRO Posts: 126
    Hi folks - bumping this thread back to life as I have found the problem! It's a significant breakthrough as far as I can tell, so mods feel free to make it a new thread if that makes more sense.

    Now I just need help solving! I posted about this a few posts up a while back when I had a theory, but since then i've had a baby (!) and only just come back to this problem :)

    (Note: I used the joystick templates from the 'Official Cross-Platform Controller Template')

    Well, my old theory was correct. In this template, the reset touch actor rules simply don't work. To test for yourself (and you can do this on the actual template project to test too) simply make the touch actors all visible (in graphics-> visible) and give them a unique bright colour so you can see them on screen while you play. Now test the game on a device and you'll see that when you let go of a touch, the touch actor you were dragging around *stays where you left it*.

    So what is happening when the joystick bugs out? Well, by whatever fumbling the player does at times, sometimes two (or more) touch actors end up *within* the joystick area. When this happens, the thumb stick isn't sure which to snap to, and goes a bit mad and glitches, snapping to a different touch actor than the one you want it to. Theres probably a more specific reason it picks one over the other, but either way - thats what causes the glitches: the touch actors aren't being reset, and subsequently you can find yourself having a few of them within the joystick area, causing the glitch.

    To force and recreate the bug:
    Simply drag two touch actors on the screen into the same thumb stick area, then try and use the stick. It bugs out 100% of the time. To further prove the theory, tap the centre of the screen with 5 fingers. This will set the touch actors to a new position and the stick works correctly again, as all touch actors are now outside the joystick area. Again, set the actors to visible and give them bright colours and you can see the snapping in action.

    I'm 100% confident this is the problem, and its easily verifiable.

    Given that this is the official template, can we get an official response to this? The reset rules simply don't work, and to be frank, multi-touch actors need to be reset when the touch is *no longer applied to the screen*, rather than tied to the stickActive attributes. If you have buttons on screen + joystick(s), you can't be resetting touch actors when the stick isn't active, because those actors can be doing something else not related to the stick!

    phew :)

    So problem found, and verified - who can solve it? A new set of touch reset logic rules for our touch actors? Anyone? I think this will make a lot of users very, very happy!

    Cheers

    j



  • jckmcgrawjckmcgraw Member Posts: 647
    @allornothing

    Awesome break through!! Hopefully someone around here can fix it.

    I have found a temporary solution that eliminates bugs 98% of the time... I just use only 3 touch actors (since I only need 2 to be active at one given time), and the joystick has a 98% less chance of glitching :P

    Regards,
    Jack McGraw

  • toastyteetoastytee Member Posts: 53
    I too would like to know the answer to this question
  • jckmcgrawjckmcgraw Member Posts: 647
    @toastytee

    A full fix would be awesome, but I can't even get the joystick to glitch out using the temporary solution I found. Give that a go. I think you'll find it pretty nice. :)

    The only time it will glitch out is if I tap the joystick and the screen a billion times for 20 seconds straight.

    Regards,
    Jack McGraw
  • allornothingallornothing Member, PRO Posts: 126
    @toastytee - yeah a lot of people have brought this up in the past, so i'm hoping some experts can help form a new solution now that the problem is identified.

    @jckmcgraw - yeah reducing the touches will help, as there is simply less chance of the problem happening, but that of course limits your simultaneous touch options significantly. As helpful as it can be, its not really a solution so much as just avoiding the problem by changing the game requirements, which may not always be suitable. That will help on one game but not necessarily others where two or more fingers need to be tracked at the same time. You run the risks of touches being cancelled or not recognised, and that can be just as frustrating as the glitch. I tried that a while back on mine, and it made controls even more problematic in general. We need a proper solution to this that will allow us to use multitouch controls efficiently. I've since rebuilt a game protoytype where this was an issue in Unity and having no problems whatsoever, and its sadly making me think of jumping ship! I love gamesalads ease of use, but when something as straightforward and standard as multitouch tracking has fairly hacky support...
  • jckmcgrawjckmcgraw Member Posts: 647
    @allornothing

    What code does Unity use?
  • tutysestutyses Member Posts: 134
    is not gamesalad fault. The template has a rule where it shouldnt be, the solution is easy. Just Drag everything that is inside that rule,and put it outside of it and it will work perfectly.
    I dont remember which rule was making all the mess, but i will post it when i have time.
    Also you can just buy dba control template, he fixed the template (its the same template with a few minor changes). But i think fixing it will be faster and cheaper
  • jckmcgrawjckmcgraw Member Posts: 647
    @tutyses

    Don't worry I'm not even coming close to jumping ship! I was just curious what code unity uses.

    Please do let us know if you find it! I knew it wasn't a GS problem.

    Regards,
    Jack McGraw
  • allornothingallornothing Member, PRO Posts: 126
    @tutyses thanks for the info - if you can post what the offending rules are that would be most appreciated. I'm not saying its a gamesalad fault as such, just that its the official template and has a pretty bad bug in it, so I was hoping they would take a moment to rectify it. It's pretty bad form to have an official template that is broken, as it drives users down the wrong path. It's also pretty convoluted versus how other engines go about multitouch controls.

    As for Unity, it uses Javascript for its scripting (you can use a few different languages) and while thats heavier and harder to work with, it does allow a lot more. However its not so much the language that I was referring to, but some of the hooks it has into the engine/iOS - you can access the 'last touch pressed', so when doing joysticks, you don't need touch actors or collision detection. This makes problems like the one we're having here non-existant, because the joystick will detect the touch, and reference the most recent touch to know which one to follow and move with. Much simpler, and a correct way of using multitouch. Gamesalads multitouch feature set is far from complete in that regard. Allowing you to specify a specific touch doesn't really help, and I'm hoping GS can add some additional functionality to improve the way virtual controls can be handled.

    TL;DR - I believe GS should provide multitouch virtual control schemes as part of GS by default, hooking into the engine more directly.
  • jckmcgrawjckmcgraw Member Posts: 647
    @allornothing

    That would be great if GS did that.
  • 3xL3xL Member Posts: 676
    What's this about "3 touches"?
    I would love to fix my first game "my zombie date"'. It uses the dual stick scheme and it's a bit wonky.
  • jckmcgrawjckmcgraw Member Posts: 647
    @3xL

    I'm on a PC right now, so when I get home, I'll post some screenshots of my code.

    Regards,
    Jack McGraw
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    @jckmcgraw

    Go to there site and you can find out what languages they support in about 2 seconds.

    Just to clear things up, unity doesnt actually use javascript. It uses unityscript that just uses a javascript extension on there files. Its similar to Actionscript 3
  • jckmcgrawjckmcgraw Member Posts: 647
    @JohnPapiomitis

    Oh ok. Thanks for the info.
  • jckmcgrawjckmcgraw Member Posts: 647
    Hey @3xL

    Here are the screenshots of what I am talking about. I just turned touch: 4 and 5 off, and have extremely minimal bugs.

    image

    This bit of code is found in the...

    Thumbstick prototype > Rule: Use TOUCH controls if KEYBOARD not in use > Group: Touch Screen Controls > Rule: Controlling > Rule: Set Touch Number If it is not already set > Group: Set the touch number if it collides with the actor corresponding to that touch > Then the image.

    I hope this helps you out, as it has saved me from countless bugs.

    Regards,
    Jack McGraw
  • 3xL3xL Member Posts: 676
    Sounds good thanks. So what bugs did it clear up? The only bug I have issues with is that the joystick randomly gets stuck in a random position and I have to touch it again to reset. This fixes that?
  • jckmcgrawjckmcgraw Member Posts: 647
    @3xL

    This does not fix it, it just makes it happen less frequently. Hopefully we could get a true fix soon... :(

    Within the next couple of weeks I might try to fully debug it.

    Regards,
    Jack McGraw
  • allornothingallornothing Member, PRO Posts: 126
    @jckmcgraw
    Just to clear things up, unity doesnt actually use javascript. It uses unityscript that just uses a javascript extension on there files. Its similar to Actionscript 3
    I stand corrected :) When you create a new script in Unity it asks if its a 'Javascript', C# or Boo Script so I just assumed it was Javascript from that.

    Regardless, can we get some of the local experts/admins/GS to take a look at this issue? I've spent a lot of time trying to debug the template, and now that I've identified and verified the problem, I just need a bit of help with the solution.

    Anyone?

  • allornothingallornothing Member, PRO Posts: 126
    @3xL - the bug you describe is the exact one we're hoping to get a fix for. The template itself doesn't work properly (check my big post halfway up the thread for more info) and needs some expert-love :)
Sign In or Register to comment.