greggman / HappyFunTimes

A System for creating 10-100+ player local games
http://greggman.github.io/HappyFunTimes
BSD 3-Clause "New" or "Revised" License
381 stars 55 forks source link

default controllers seem laggy/broken in different ways on current mobile browsers #12

Open Cloven opened 8 years ago

Cloven commented 8 years ago

When I load the 'platform' test scene, on latest Chrome on an Android phone, the A/B buttons are sticky and do not get reset until another button elsewhere on the pad is pressed (e.g. the d-pad).

On an ipad, the jump buttons are not sticky (they return to an unpressed state), but ~15-30% of inputs seem to be lost.

Interestingly, when I load the 'touch' test scene, both devices show smooth, generally non-laggy, loss-free tracking of the finger moves.

The server in these cases is the most recent HFT, running on OSX, with latest HFT plugin running in Unity 5.1.1f. If there's any other debugging info I could provide, happy to help.

greggman commented 8 years ago

Try this.

sudo nano /Applications/HappyFunTimes.app/Contents/hft/public/css/controllers.css 

Look for

* {
    box-sizing: border-box;
    -moz-box-sizing: border-box;

    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: pointer;
}

delete the cursor: pointer; line. Go to the beginning of the line and press Ctrl-K

Then press Ctrl-X, Y, Enter to exit nano and save. Does that help?

That's the only thing I can think of so far. I noticed the screen is changing color when you press the buttons. It turns out that cursor: pointer setting was making that happen. Otherwise I don't see any lag or stickyness on my Nexus 5 nor my cheap crappy Huawei Prism II.

I'm on Chrome 45.0.2454.84 on my Android devices

If that fixes the problem I'll put up a new version

huika commented 8 years ago

I´ve noticed a behavior that might help handle this problem. The button only get stuck if it is pressed and released without a small amount of movement on the finger position. If you keep the button pressed and move the finger inside the button area, and only then remove the finger, it aways identify its removal and the button correctly gets released.

Update: As far I´ve discovered, removing the handleButtonEnter addPointerId function call (touch.js) avoid the buttons from getting stuck, but obviously it also removes the possibility of touching a button with a finger that moved inside it´s area.

greggman commented 8 years ago

Hey there. Sorry you're running into so much trouble. Are you seeing this on both iOS and Android or just one or something else?

I'll try again in Android

huika commented 8 years ago

Hi there! No problem at all, HFT is amazing :) I'm only getting this problem on android samsung s4 mini, it's not happening on my iPad retina display, I didn't tested on iPhone. I bet that somehow both buttonEnter and ButtonPressed/down are feeding the finger index at the same time, and the button end up considering it's being pressed by two different fingers, but I have no idea how this could happend, as I see you check if the finger index is already used. Thanks a LOT for this amazing project :)))

greggman commented 8 years ago

Can you try installing version 0.0.46?

http://superhappyfuntimes.net/install