GS's template for the joystick (glitches and problems with it).
jckmcgraw
Member Posts: 647
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
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
Comments
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
@allornothing Hmmm... At least we're getting somewhere.
Thanks for everybody's input and such,
Jack McGraw
Jack McGraw
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
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
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
@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...
What code does Unity use?
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
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
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.
That would be great if GS did that.
I would love to fix my first game "my zombie date"'. It uses the dual stick scheme and it's a bit wonky.
I'm on a PC right now, so when I get home, I'll post some screenshots of my code.
Regards,
Jack McGraw
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
Oh ok. Thanks for the info.
Here are the screenshots of what I am talking about. I just turned touch: 4 and 5 off, and have extremely minimal bugs.
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
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
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?