greggman / hft-unity3d

Unity3D Libraries for HappyFunTimes
32 stars 11 forks source link

iPhone 7 no pads are responding #6

Open dpentecost opened 7 years ago

dpentecost commented 7 years ago

Great work, and useful. But I have tried all variations for the demo phone controller and only the buttons work, none of the pads. No touches showing in the controller example. Any idea what's going on?

iPhone 7, iOS 10.3.1

dpentecost commented 7 years ago

I should say also I am using Unity 5.6 - I will drop back to 5.3 and try.

greggman commented 7 years ago

I'm also on 10.3.1 and I'm on Unity 5.5, (not 5.6) but it's working. Are you running any adblockers on your phone? Just trying to find a way to repo

dpentecost commented 7 years ago

I run tracker blockers in Chrome on MacOS but it works fine on MacBook Pro. It's the iPhone control - anything on the left side of the phone is unresponsive (that's where the pads are). Will try again this week - maybe I'll try 5.5. Thanks for your help - this could be great for a multi-player game in our planetarium!

greggman commented 7 years ago

Yea I meant are you running ad blockers on your phone (since iOS Safari supports those). Just trying to figure out how to repo the issue. I tried both Safari and Chrome but I was not able to repo 😓

dpentecost commented 7 years ago

Nope, no ad blockers on the phone. Using Chrome. Will keep trying.

greggman commented 7 years ago

does the 2d platformer work?

dpentecost commented 7 years ago

Not on the phone. Touching red button makes the bird jump, touching arrows on pad does nothing. At the same time I tried it in Chrome on the laptop. Just hovering over the red button activates it, clicking on the pad arrows activates them, bird moves, arrows show pressed state. I am trying this at home on a different WiFi, but the results are the same as when I tried at work.

dpentecost commented 7 years ago

But while we are sorting this out, I have a request. I am digging through your code but I am not a coder (I know the stuff I need is in HFTGamepad and controller.js). The orient controller with one big button would be great for flying in the planetarium - button press instead of shake to go forward. Or x-y pad, perhaps. It would also be a useful VR controller. What do you think? Could you whip one up? Or give me some clues? We could do this through email or forum. Thanks!

dpentecost commented 7 years ago

Okay, I don't know what changed, but now the pad controls are working. On both the phone and the iPad. So you can clear this issue!

And I will tackle my request on my own. Thanks for a great system.

greggman commented 7 years ago

I wanted to mention if you dig through the samples there's the simple and clean samples (note the clean sample is only available in the latest version. It may or may not be useful for you. It's only point is to show the minimal example where you do everything on your own. It provides a controller.html that uses no external libraries so if you know a web page developer that's good with mobile webpages they can start from scratch. Have them make a web page for the phone, then later copy it into your unity project and add a few messages to send to the game.

Whether that's good for your needs I have no idea just thought I'd pass it on.

I think it says this in the notes but if you're really trying to make a planetarium size game you're probably going to run into several major issues

  1. Allowing everyone to connect to the wifi.

    Maybe your planetarium already handles that case. For me I've mostly used a portable Wifi that only handles 14 players and an Apple Airport Extreme that I think is limited to 100 players.

  2. Not sending too much data per user

    You mentioned using orientation, the biggest issue with orientation is it's constant data at all times for each user (where as d-pad plus 2 buttons is only data when the user presses or releases a button).

    If that' an issue the way to fix that is to put more smarts in the controller. (controller.js)

    For example instead of sending all orientation data only send it in quadrants or octants. A simple example, if the data is 0 to 360 then you could divide by 36 and floor

        const angle = Math.floor(zeroTo360orientationAngle / 36) * 36;

    This will make the angles only be 0, 10, 20, 30, 40, 50 ... 360, no 36.7523354562 type of numbers. Then only send it if it's different than the last angle sent

       if (angle !== lastAngleSent) {
           lastAngleSent = angle;
           client.sendCmd('orient', {angle: angle}});
       }

    I'm not sure if that makes any sense. If you have a dev there hopefully they'll understand.

    My only point is the more people you add the less data you want each person to be sending. I have no idea what the limit is and you might not have any issues. I'm just pointing out there are ways to send less data to help handle more people.

  3. All the normal issues of large games

    • having each user being able to find themselves (unless you put them on teams)

      On a huge screen like a planetarium that might be easier but if you allow names more than 2 letters you can expect people to put non-family friendly names.

      There's no easy way to know where a player is so you can't automatically start them near their seat. On the other hand you could show them a map of the planetarium on their phone and let them choose a starting point. Or show their starting point the game already chose for them. There are lots of creative solutions. Or simple menu "start by exit", "start by entrance", "start at top of planetarium" etc...

dpentecost commented 7 years ago

Wow. Super helpful. Here are a few comments:

We have a 30ft diameter planetarium. Big enough to be real but small enough (64 seats) to be manageable. I don't expect there will ever be more than 10 girls playing at one time but you never know.

Data per player is an issue with Orientation that I had not considered. Thanks. Also, capability of the Mac Pro that would run it. For a pre-warped fisheye projection coming out of Unity we use a camera rig by Paul Bourke ( http://paulbourke.net/dome/UnityiDome/ ) that actually uses 5 cameras, and we project it at mirrored 2560X1600. The Mac Pro can handle it but I've seen Unity bog it down. Your code is more efficient than what I hack, but there's a lot going on to do it in real-time. The 5 cameras also occasionally show seams if you use sprites or particles. But it's worth it to surround the audience with the Unity world.

Our WiFi is industrial strength Meraki. But location of AP and obstacles (thick walls) may make limits within the space..

Another issue you did not mention is limiting players' distance from the viewer. "Infinite" space. Do you make hemispheric limits (in 2D you would just keep a constant Z distance)? Simplest thing I could think of, being trig deficient, is an invisible sphere with a collider. Thunderdome.

Welcome to my curved world!