Bug in Pre-shipped On Screen Button behavior?

AdventureIslands

  • *
  • Posts: 728
So I downloaded Stencyl 2.0, originally my game used the On Screen Button behavior that came with the Platformer example iOS game from Stencyl 1.4. That behavior worked otherwise well, but the buttons got stuck if you pressed them in too rapid order.

After Stencyl 2.0, I tried the new pre-shipped On Screen Button, so far it seems to be working like intended and buttons are not getting stuck, but there is a new problem that when you release the button press, all the other button presses are released as well. This makes platforming games impossible play properly. Could someone check out those behaviors?

captaincomic

  • *
  • Posts: 6109
Are you using mutli-touch to press more than one button at once?

The behavior is currently releasing the button whenever the touch is released anywhere. If it would only release the button when the touch is released on Self, you could touch the button, then move the finger off the button and when you release, the button would still be down.

Maybe it could be solved by releasing the button when touch leaves Self or touch is released on Self...

AdventureIslands

  • *
  • Posts: 728
That worked, changing If Touch is Released to If released self made it possible to release other buttons while buttons that are being pressed stay down like intended, though now the old bug is back, pressing buttons too fast makes them stuck down and the character keeps running to one direction.

Is there something to keep the buttons from staying pressed even if you are not touching the screen?

« Last Edit: April 27, 2012, 05:50:40 am by AdventureIslands »

captaincomic

  • *
  • Posts: 6109
Hey there! Could you try the attached behavior? Is it any better?
(I can't test it on iOS at the moment.)

J1000

  • Posts: 24
I have the same problem. I tried making a behaviour where it releases the key when dragging outside the buttons x/y coordinates, and presses it again when dragged inside, but it lags.

captaincomic

  • *
  • Posts: 6109
@J1000
If you want, you can also try the attached behavior. It's maybe not exactly what you want: it releases the button when dragging outside, but doesn't press it again when dragged inside.

AdventureIslands

  • *
  • Posts: 728
Hey there! Could you try the attached behavior? Is it any better?
(I can't test it on iOS at the moment.)

Sorry, but it's still not working. I'm not entirely sure how the buttons get stuck, but I think it can happen when pressing right movement button, then letting go and quickly pressing left when the pressed animation of right button is still playing, but I'm not sure.

captaincomic

  • *
  • Posts: 6109
Dang, it's a pity I can only test in the simulator, and not an a device. It's only happening on the device, isn't it? At least I never noticed the button getting stuck in the simulator.

Here is a different approach you might want to try:
http://community.stencyl.com/index.php/topic,8008.msg50368.html#msg50368
although I don't know if it will work with multi-touch.

captaincomic

  • *
  • Posts: 6109
I made a new version, and I think this will work better with multitouch overall. I don't know if the keys will get stuck though, I could never see this happening.

Could you do me a favor and try this one? It has an attribute Allow Slide, set it to true to allow the button be pressed/released by sliding finger against it/off.

AdventureIslands

  • *
  • Posts: 728
This has worked the best so far, atleast I haven't been able to get the controls stuck yet, but there are other problems.

If you have the "allow slide" off, the buttons work fine, but if you press more than one button using the same behavior the same time (like move and jump), the framerate will suddenly take a huge hit.

if you have it on though, it works otherwise excellently, but for some reason the button presses randomly stop, for example, when making a long jump by holding down the jump button, it suddenly stops recognizing that you are pressing the button and your jump falls flat, even if you are still holding your finger on the button, the button just turns into unpressed state. I wonder what's causing that.

I just made a small test, I had this behavior with sliding on and kept two buttons down the same time, after a short silence of nothing happening, they suddenly start to randomly press and unpress themselves under your fingers and degrading framerate, weird! this stops the moment you let go of the buttons.

« Last Edit: May 17, 2012, 01:01:28 pm by AdventureIslands »

captaincomic

  • *
  • Posts: 6109
if you have it on though, it works otherwise excellently, but for some reason the button presses randomly stop, for example, when making a long jump by holding down the jump button, it suddenly stops recognizing that you are pressing the button and your jump falls flat, even if you are still holding your finger on the button, the button just turns into unpressed state. I wonder what's causing that.

I just made a small test, I had this behavior with sliding on and kept two buttons down the same time, after a short silence of nothing happening, they suddenly start to randomly press and unpress themselves under your fingers and degrading framerate, weird! this stops the moment you let go of the buttons.
I think I fixed this. (I was comparing the touch points to scene coordinates instead of screen coordinates.)
Please try once more with the pre-shipped behavior that comes with 2.1.

But I don't know why it would make the framerate suffer, or how to fix that.

AdventureIslands

  • *
  • Posts: 728
Downloaded 2.1 and tried the On Screen Button that came with it, but it has a problem that if you press multiple buttons the same time and let go of one, all the rest will turn into unpressed too.

I opened it in a design mode and noticed this is much simpler behavior than the the previous ones you made, it has just Created and Updated events. Did you make a simpler version or is this wrong behavior?

captaincomic

  • *
  • Posts: 6109
Hm, something went wrong, in 2.1 is not the right behavior.
I attached is the newest version, and will commit it again for 2.1.1.

Edit: Actually nothing went wrong. It's just that when you update Stencyl you don't get the new content. Only if you download the 2.1 installer you will get the new versions of the pre-shipped behaviors.

« Last Edit: May 31, 2012, 01:00:10 pm by captaincomic »

AdventureIslands

  • *
  • Posts: 728
Still not working unfortunately. If Allow Slide is turned off, when you move around with the character, if you jump, then either movement key you were pressing stays pressed and the character keeps walking, but the buttons graphic stays in unpressed state.

If the Sliding is turned on, sometimes when pressing two buttons the other buttons turn pressed down too. Curiously it only happens in my game if I'm moving left and jumping, the walking right button turns pressed down too and the jump falls flat. Not sure if the problem is in the behavior or in what.

captaincomic

  • *
  • Posts: 6109
Hm, I'm sorry, I'm running out of ideas how to fix/improve this. Maybe in 3.0 it will be easier to get it right.