Search Unity

Easy WiFi Controller- Turn your mobile phone into a controller!

Discussion in 'Assets and Asset Store' started by greggtwep16, Mar 9, 2015.

  1. ahmidou

    ahmidou

    Joined:
    Sep 17, 2012
    Posts:
    87
    Hi,
    The images are not overlapping, and I have that behavior even if the button are far.
    imagine a grid 4x8 on the whole screen space if I touch the upper left and the lower right at the same time,
    I get a third touch in one of the middle buttons.I'm going to do some tests, but maybe, if there are more then one touch,
    it should loop over all the touches minus one.
     
  2. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Actually, today I pulled out one of my really old phones to see if I could find one that recreate this and I was able to (it's also a Samsung). Apparently, on the device when multi-touch is triggered a mouse-button down event is also fired. What is worse is that the x/y coordinates of the mouse position of the mouse position is reported as the average of all the touches (the middle). This would definitely cause the behavior you are seeing. I'll have to do quite a bit of testing to see if different devices give different variations to get a proper fix into EWC but in the meantime to not hold you up change the following in any of the client controls you are using and it should be resolved.

    From:
    Code (CSharp):
    1.             //mouse
    2.             if (Input.GetKey(KeyCode.Mouse0))
    3.             {
    4.                 if (Input.mousePosition.x >= screenPixelsRect.x &&
    5.                         Input.mousePosition.x <= (screenPixelsRect.x + screenPixelsRect.width) &&
    6.                         Input.mousePosition.y >= screenPixelsRect.y &&
    7.                         Input.mousePosition.y <= (screenPixelsRect.y + screenPixelsRect.height))
    8.                 {
    9.                     pressed = true;
    10.                 }
    11.  
    12.             }
    To:
    Code (CSharp):
    1. #if UNITY_EDITOR || UNITY_STANDALONE
    2.             //mouse
    3.             if (Input.GetKey(KeyCode.Mouse0))
    4.             {
    5.                 if (Input.mousePosition.x >= screenPixelsRect.x &&
    6.                         Input.mousePosition.x <= (screenPixelsRect.x + screenPixelsRect.width) &&
    7.                         Input.mousePosition.y >= screenPixelsRect.y &&
    8.                         Input.mousePosition.y <= (screenPixelsRect.y + screenPixelsRect.height))
    9.                 {
    10.                     pressed = true;
    11.                 }
    12.  
    13.             }
    14. #endif
    This will allow the mouse on destop but yet not allow this behavior to happen on the phone. Give it a try and let me know if it works for you as well. If you also see this on other controls (dpads, joysticks, etc.) throw the same if around the client controls mouse section as well.

    I hope to find out which devices do this and perhaps find a better solution in the next week or so.
     
    Last edited: Mar 23, 2016
  3. mcmonk

    mcmonk

    Joined:
    Sep 22, 2014
    Posts:
    14
    Hey

    I'm trying to use this on my university network. I have been in contact with them, and they say that there should not be any problems with open ports over wifi, and that other people have been able to use Unity to do multiplayer before. But when i try with the Easy Wifi controller, the devices (mac, ipad, android) do not seem to be able to connect.
    Do you have any idea what the problem might be? (i'm not a big networks expert ;) )
     
  4. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Playing a game (especially nowadays where authoritative servers is the norm) is not the same as a P2P solution. In Universities what normally gets blocked is the discovery of the other devices via broadcast. In general on page 3 (with johnchoi313) of this thread was also someone in your same situation and reading through those troubleshooting steps would be helpful

    If you wish you can certainly post the logs from both ends to start investigating, but in general the fastest way to know for sure would be if you or one of your friends has a wifi router lying around. You don't need internet access to the router but simply connect your devices to that router and see if it works. If it does and your Universities network does not then obviously there is something going on.
     
  5. superjayman

    superjayman

    Joined:
    May 31, 2013
    Posts:
    185
    Can I use Easy Wifi Controller from android device to PC standalone app? The only thing i need to pass is some string data like text chat from Android To PC. ?
     
  6. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Yes any mix of the supported platforms listed on the Asset store page will work.

    That being said, Easy Wifi Controller is best used for continuous streams of data like a real controller is. While you could probably bend the tool to do what you want with a forward string channel, I would probably recommend trying a different tool. I'm sure the store probably has some better fits for a chat server (haven't checked though).
     
  7. Unititi

    Unititi

    Joined:
    Mar 6, 2013
    Posts:
    20
    very intereting asset. I have question. Can one controller device control X10 devices in Easy Wifi Controller??
     
    Last edited: Jun 16, 2016
  8. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    You can but you'd have to use it in reverse and by doing so you would lose some of the built in UI widgets. You would essentially have the "controller" in your picture be the server, and the devices be the clients. You could then use any of the built in backchannels to send data to your devices, and any of the forward channels to communicate back to the server.

    Overall, I would say that using it in reverse like that will work but would be a bit hacky since you'd lose the ability to use any of the UI controls and would have to use just the data controls. But if it's something simply like just pressing play like you picture that would work no problem.
     
  9. dmoroni

    dmoroni

    Joined:
    Mar 10, 2015
    Posts:
    23
    Hi, I'm very interested in your plugin for a project I'm working on, so I would ask you some questions.
    Let me first briefly explain about the project:

    There's a classroom of people wearing VR goggles and sharing the same virtual tour (a sequence of 3D rooms) and there's another person controlling the overall experience through a tablet. Let's call them students and teacher.

    The teacher can switch the VR rooms - seen by all students - and do some actions, like activating pop-up messages or point of interests in every room. Plus, he can select a single student to see what he's looking at (that is, the teacher receives back the student's camera orientation and sees the current 3D room through it).

    My questions are:

    - Does your plugin allows a one-to-many relationship? I guess it should manage several server applications (the students) and one client controlling all of them (the teacher).

    - Is it possibile to receive data from the servers? I read about "back channel data" in your plugin's description.

    - In this case, could the client (teacher's tablet) identify every single server, so it could filter the camera data coming back from a single student, and possibly do some actions just for that student?

    Of course, if you've some other suggestions about using your plugin in my project, it would be very useful to me.

    Thanks,

    Riccardo
     
  10. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    EWC is primarily designed for the other way around, a lot of phone controllers (clients) but only one game (server). This was the primary use case so what you describe isn't ideal but it can work in reverse but you have to give up some of the built in functionality. Essentially it's designed for many to one so if you are going to use EWC for your use case you'd actually have to use it in reverse which is possible and others have done this. A little bit unintuitively you would use the backchannels to send your data from the teacher to all the VR headsets and then if you had any info that needed to go the other way you would use any of the forward channels.

    A couple additional things to note based on your description.

    - Each "device" (in your case VR goggles) needs to be able to run Unity. If we're talking about gear VR which is android no problem or PC based or IOS based headsets. However, if your headsets run something else, EWC won't work.

    -Screen mirroring is a lot more data intensive than people realize. When you are talking about a whole classroom of clients it definitely won't be able to share the whole picture every frame. All the students though would have Unity running so there is no need to do this. Simply send the data that says start animation x or move student position to Y. In this way things are mirrored but it's not this massive amount of data being sent to every student (which would overload your network and lag).

    -All of our prebuilt controls (joysticks, dpad, etc.) are built like they are going client -> server and you are going server -> client. Because of this most of those won't be that useful to you but it sounds like you had something custom in mind anyways so it shouldn't impact you much.

    -EWC is built on data streams and not RPCs, acknowlegments, etc. Doing things this way is a trade off which is better for things like updating position, controller data, etc. but is worse for things like guaranteeing a function is called. It's good to be aware of that before you begin.

    -You mentioned per student actions. You can certainly send any type of data from the clients (students) to the server (teacher). Things like where they are can certainly be different and the teacher can certainly look into their data distinctively and have actions that do different things based on that data. In that respect that part of it is most like the original intent. You'll still have to build the infrastructure around what to do based on that data that makes sense for your walkthrough, but you can certainly get at the distinct data.

    If the above still sounds like its a good fit then it should work for your usecase. There have been some architects that did something similar in the past so EWC can certainly be bent to this usecase, but it's good to know that there will be some work involved to do so. Whether or not it's the best tool for the job, I can't say, generally when you have to bend something it isn't ideal, but I'm unaware of all the options on the market to know if something else is better.

    Hope that helps.
     
    Last edited: Jul 26, 2016
  11. dmoroni

    dmoroni

    Joined:
    Mar 10, 2015
    Posts:
    23
    Thank you for your answers.

    Yes, it's a GearVR project.

    I guess that way I wouldn't be able to send standard/custom input - that is buttons, joystick, etc. - to the students devices. That would be a problem.

    Maybe I was a bit unclear on this point. In this project, the teacher from time to time selects a VR environment for all the students and they can just watch around with their VR goggles inside that room. The teacher can also do some actions (let's say pressing a button) and all the students will see the effect (for instance, a popup window with some text).

    Sometimes the teacher would check what a single student is looking at, in that case the student's device could send the teacher's device just his current camera orientation, so the teacher could look at the same VR environment (that is, the same Unity scene on his tablet) through that camera. So, it's not screen mirroring indeed, it's just a matter of synchronize two cameras over a network. I already made a test for this using the standard NetworkTransform class so I would count to do the same with your plugin.

    As I said before that could be the real problem, because I was counting on your custom controls to send a sort of command to all the VR devices (let's say a button pressed on the tablet) then do some custom action on those devices. If I've to follow the "teacher-is-server" "students-are-clients" architecture, I guess that's impossibile to do.

    That's good, it's what I need to perform possibile per-student actions.

    Anyway, thanks again for your answers, I've a much clearer picture now. I guess I've to further study the problem to find out if it's possibile to use EWC for my project or if I've to think up some other custom solution.

    Riccardo
     
  12. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Responses to your queries below.

    1. Gear VR is no problem that would work fine.

    2. The standard controls (buttons, joysticks, etc.) are setup for the phone or any client, to be able to control the server. In your case you'd perhaps want the teacher (server) to be able to move the students with a joystick? If so, you are correct that this isn't created out of the box for backchannels. The underlying data types are provided but not any of the high level gui controls. Mainly because when you have one computer possibly control X number of devices just a joystick doesn't help. At a minumum you would have to have a combo control that says ok right now I want to control player 1, then maybe player 2, etc. and then the joystick would control the appropriate player. It would be a combination and not as straghtforward as the other way so it would require custom coding on your end. That being said all the plumbing is there for you to do so, but it isn't something provided out of the box.

    3. Yes sending any underlying data (in your example Camera orientation) so that they sync is possible. That amount of data is very small and is what many games do, like Worldy cup, when using EWC. I just wanted to make sure that you were planning on using this method, there are others who have mistakenly expected that they could send an entire render texture every frame of something at 1080p and even on a local network that's too much data to keep the framerate up.

    4. It's certainly possible there is no issue going server -> client it's just that pre-coded high level controls are not provided so it takes some work on your part (this usecase is not common for games and in that regard is somewhat unique for your project). This is because when going one to many the controls have to have more information like which client you wish to effect (or all of them). In this regard, the only thing pre coded going that direction is simple data types (string, bool, float, etc) because in games this is typically all you need (maybe let the user know their score, change the controller layout, etc.). Your usecase is a bit more involved so it's not precoded but you could essentally reuse all the source for the joystick going the other way, but you'd have to combine it with lets say a dropdown with a list of the currently connected clients so that the joystick effects only the player you want it to. Basically, the plumbing is there but you'd have to code the behavior that makes sense for your project.

    Hope those responses help. In general, based on your comments, EWC can probably get you 40-50% there but there would still be a decent amount for you to write custom. Whether that's worth it or not I can't say (or if there is another product that suits your usecase better).
     
  13. Beta64

    Beta64

    Joined:
    Sep 2, 2016
    Posts:
    4
    I just purchased this asset, and it's working great except for one issue.
    I'm trying to have 4 buttons in the phone screen with each taking up a corner or the screen. However, when tapping anywhere on the screen, all the buttons fire. When the buttons are smaller or farther apart, I don't have this issue.

    Any idea as to why this happens?
    Thank you!

    EDIT: From the looks of it, the box for the clickable area of the button is way bigger than the button itself.
    I attached a video of the problem to this post as a .zip file.
     

    Attached Files:

    Last edited: Sep 2, 2016
  14. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Can you post a picture of it in the scene view not the game view? The buttons are just normal Unity UI elements so you can always see faint outlines in the scene view for how big the button actually is and not just the graphical part. My guess so far would be the same as yours that all your buttons are overlapping. I have not experienced this with any of the example scenes.
     
  15. Beta64

    Beta64

    Joined:
    Sep 2, 2016
    Posts:
    4
    Here you go. I attached both what I want and the test with the buttons smaller.
     

    Attached Files:

  16. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    The outlines look ok but inside of EWC there is a lot of internal logic for all the UI controls (buttons, joysticks, etc.) for automatic behaviour and a lot of math with pivots, relative anchors, etc. One thing I see that isn't too common and is different from the example scenes provided (which I assume are working ok for you locally) is that you have the scale on the buttons not set to 1 for x and y. When you add the buttons from the dropdowns they are normally 1 and you should be able to achieve the same thing you are going for in each example picture by changing the scale back to 1 in x and y but reducing the height and width in half. Let me know if that clears up the issue for you and if so I'll try to think about how to adjust the math in some of the core functions to make that not be a requirement any longer.
     
  17. Beta64

    Beta64

    Joined:
    Sep 2, 2016
    Posts:
    4
    Well, that was the solution! Thanks!

    One last thing, is there a way to have the button not trigger when releasing it? Right now, it triggers on every state change, not just turning it on.

    I super appreciate it, man! You've been super helpful.
     
  18. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    The two modes built into the product currently are either "every frame" or "only when changed". I believe what you are asking for is the rough equivalent of onButtonDown. It isn't currently in the product but I'll certainly consider adding it to the next update. In the meantime you can change the current below method in the custom button server controller to the following to accomplish that (this will ignore the call type in the inspector for now if you change it). Likewise, if you don't want to change the function you can simply check the value in the method that is being notified which is the normal way to do this.

    From:
    Code (CSharp):
    1.         public void mapDataStructureToAction(int index)
    2.         {
    3.             if (callType == EasyWiFiConstants.CALL_TYPE.Every_Frame)
    4.                 SendMessage(notifyMethod, button[index],SendMessageOptions.DontRequireReceiver);
    5.             else
    6.             {
    7.                 if (lastValue != button[index].BUTTON_STATE_IS_PRESSED)
    8.                 {
    9.                     SendMessage(notifyMethod, button[index], SendMessageOptions.DontRequireReceiver);
    10.                 }
    11.                 lastValue = button[index].BUTTON_STATE_IS_PRESSED;
    12.             }
    13.         }
    To:
    Code (CSharp):
    1.         public void mapDataStructureToAction(int index)
    2.         {      
    3.             if (lastValue != button[index].BUTTON_STATE_IS_PRESSED && button[index].BUTTON_STATE_IS_PRESSED == true)
    4.             {
    5.                 SendMessage(notifyMethod, button[index], SendMessageOptions.DontRequireReceiver);
    6.             }
    7.             lastValue = button[index].BUTTON_STATE_IS_PRESSED;
    8.            
    9.         }
     
  19. EclipseGamesLLC

    EclipseGamesLLC

    Joined:
    Jun 18, 2011
    Posts:
    27
    Hey im using EWC and i love it, easy to use and modify. I am working on a project and what Im trying to figure out but cant wrap around my head is, using the ewc controller, is sending a gui text to the tablet for options such as accept or cancel buttons activate or even change when a player enters a trigger via network. Would anyone be able to help me with this kind give me a base idea on what i should do? thanks
     
  20. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Generally speaking, out of the games that have used EWC I generally like the auto join controller select screens best. Basically have a prefab appear when it joins, and disappear if they quit or timeout before the actual game is started.

    However, if you do want the server or the client to have to approve on joining, I don't think sending strings, guitexts, etc. makes much sense. To me it makes most sense to just have the buttons premade and show them when first connected. Then when the button is accepted you can hide them again. Basically all you would need to do is keep track of the current state, something like not connected -> pending approval -> connected .

    If I'm misunderstanding your question let me know.
     
  21. Beta64

    Beta64

    Joined:
    Sep 2, 2016
    Posts:
    4
    Thank you very much!
    It seems to have broken my buttons, but perhaps I just need to recreate the sever side ones. I'll try that, and get back to you.
    By the way, am I just replacing the code in the CustomButtonServerController.cs?

    Thanks again! You've been amazingly helpful.

    EDIT: Works great. Everything is working as expect. Thank you so much!
     
    Last edited: Sep 5, 2016
  22. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Glad it helped!
     
  23. EclipseGamesLLC

    EclipseGamesLLC

    Joined:
    Jun 18, 2011
    Posts:
    27
    Hey so have another question, I am trying to setup a thirdperson controller with just as of right now basic movement with a follow cam set, but I am trying to implement it with the joystick client controller how do i go about doing that. I cant seem to wrap my head around it
     
  24. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Assuming you are using the Unity provided third person script you would just change the lines of code that reference Input.GetAxis("Mouse X"); and Input.GetAxis("Mouse Y"); with instead of checking the mouse check the value of the joystick like in the provided EWC standard joystick controller.

    Other than the actual call to the input api none of the other logic needs to change. If you are using a different 3rd person script the same premise would occur. At some point in the logic it will be checking the actual mouse or keyboard input and thats where you'd plugin the corresponding EWC calls.
     
  25. EclipseGamesLLC

    EclipseGamesLLC

    Joined:
    Jun 18, 2011
    Posts:
    27
    Hey i know i have alot of questions with this, i love this tool very useful. So i am trying to also figure out how to fix the duelsticks on the controller, the nubs. How can i increase or fix the joystick nubs or the controller to where when you move it it wont reset its self if it goes out its bounderies, instead of it resetting itll just stay in that direction when touched?
     
  26. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    The code responsible for what you describe is the following in the Joystick Client Controller.
    Code (CSharp):
    1.                  
    2. //touch somewhere on control
    3. if (touch.position.x >= screenPixelsRect.x &&
    4.     touch.position.x <= (screenPixelsRect.x + screenPixelsRect.width) &&
    5.     touch.position.y >= screenPixelsRect.y &&
    6.     touch.position.y <= (screenPixelsRect.y + screenPixelsRect.height))
    7. {
    8.     //moving the nub
    9.     nubMovement.x = touch.position.x - screenPixelsRect.center.x;
    10.     nubMovement.y = touch.position.y - screenPixelsRect.center.y;
    11.     if (Mathf.Sqrt(Mathf.Pow(nubMovement.x, 2) + Mathf.Pow(nubMovement.y, 2)) > normalizeFactorX)
    12.     {
    13.         //a joystick is a circular control and a sprite is a square graphic
    14.         //we have touched in the sprite but we need to make sure we actually touched in the circle
    15.         //if not reset so no touch
    16.         nubMovement.x = 0;
    17.         nubMovement.y = 0;
    18.     }
    19.     break;
    20. }
    Essentially it first checks if the touch is within the square boundaries of the image. Then it calculates the x and y by subtracting from the center of the image. Finally, it resets that x and y to 0 only if it's outside the max circular shape inside the image (because square shaped joysticks don't feel good at all).

    Normally, if all you want is a larger area just scale the image no coding necessary. However, from what you describe you want it to be infinite so you'd have to modify this code. In general it sounds like you'd want to keep the above logic for dictating the start of the touch, but then probably keep track of the touch and only stop reporting when the actual finger was lifted off the screen. The actual implementation is up to you but, basically just modify the above logic to do the flavor of virtual joystick that fits your game best.
     
  27. EclipseGamesLLC

    EclipseGamesLLC

    Joined:
    Jun 18, 2011
    Posts:
    27
    hey so im trying to figure out something. I am using the button on the table to make a light turn on and off in the game. So im trying to figure out how and whats the best way to get that done using the button on the tablet and sending that info to the server (the game) for the light to toggle on and off?
     
  28. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    The easiest way would to use the provided custombutton scripts and change the inspector on the server side from "update every frame" to "only when changed". Then the method you specify in the inspector is only going to get called when the button value changes and you can set your code in the method to simply check the state and turn it on or off.
     
  29. ianjgrant

    ianjgrant

    Joined:
    Mar 11, 2013
    Posts:
    28
    Hi, yet to fully test the asset, but is there a straightforward way to send multitouch data from client to server - like the TouchOSC multitouch widget?

    I'm using EasyTouch and a way to pack and send their data types / classes would be fabulous. Is it possible?

    Kind regards, Ian
     
  30. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Multitouch is already built in. You can certainly have multiple joysticks, buttons, touchpads, etc. and have them all be pressed at the same time and work. In addition some of the controls are already multitouch individually, like the pinch zoom touchpad which as the name implies supports pinch zoom within the control which is multitouch.
     
  31. theletter7

    theletter7

    Joined:
    Jun 24, 2011
    Posts:
    14
    Hey really like you asset, just trying to figure out the channel callback stuff, what I'm trying to do is send the number that the controller connected to assign a color to it.

    https://gyazo.com/b3f5f4fd22e4d1627ef7a117b91dba3f

    I have this under Controller Connected - SpawnBadge as i just want to set the colors on spawn.
    Thanks for you help and a great tool :D
     

    Attached Files:

  32. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    I'm not fully clear on what you are trying to accomplish. If you are just trying to change the color of the badge that pops up you can certainly do so within spawnbadge based on the number.

    If I'm not mistaken you are trying to send back to the phone (client) what player he currently is. You can do this within any server controller component (backchannel, string, etc.) doesn't have to be within spawnbadge and simply send back the logicalPlayerNumber (this is inherited from BaseControllerType). In that example at first the controllers are in the order they connect, but then you select what player you want to be and right before the game scene is loaded it switches the player you are so that you are the player number you selected. In any case though that member will always have what player number you are on the server and you can certainly send that back to the client if you wish to show that on the phone GUI.

    Certainly let me know if I'm misunderstanding what you are trying to do.
     
  33. theletter7

    theletter7

    Joined:
    Jun 24, 2011
    Posts:
    14
    Hey thanks for the response, I have it working so it is Assigning a color based on which order it connected then sending the same number to the controller and assigning it to the same color there. Is there anyway I can stop the back channel from constantly sending the number? Like send the number once then stop?
     
  34. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    EWC is primarily built for telemetry (joysticks, buttons, etc.) that need to be sent fast and every frame. All the various controls or backchannels get combined and sent into a single message. Because there really isn't separate messages there is no way to not send, but setting the value to empty string or if using another datatype some value that you know is equivalent of "null" would be the best way to accomplish this.
     
  35. HenkeBenkes

    HenkeBenkes

    Joined:
    Sep 15, 2015
    Posts:
    11
    I have some trouble with stretched and nested controllers. See movie:
    https://drive.google.com/file/d/0BxiFa1S-V3aAczJaQlVmYWdPTTQ/view?usp=sharing

    My guess is that it's because of the "GetScreenRect" method in the class "EasyWiFiUtilities" but I am not sure:

    *****
    //this function will get the minimum point and the width and height and return it in a rect
    //NOTE: this is only a function for special case rectTransform (assumes anchormin = anchormax (point anchor))
    public static Rect GetScreenRect(RectTransform rectTransform)
    **************

    Any suggestions?
     
  36. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    I was unable to get your .avi file to play despite trying both windows and other OSes (and I do have a codec installed for .avi). There are many ways to achieve the same thing in the Unity Gui though (moving anchor points, moving the offset, changing the scale of the UI item, changing the mode of the canvas, etc.). The controls that were provided for you to use all use point anchors so if you are using another way of doing things it is quite possible the function above doesn't support it (but I wouldn't know for sure without seeing what you are trying to achieve). If you look at the examples of say the joystick what are the differences that you see from the custom UI you are trying to create and how it used the Unity UI system?
     
  37. HenkeBenkes

    HenkeBenkes

    Joined:
    Sep 15, 2015
    Posts:
    11
  38. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    If I had to bet money it's the layout groups. That's the biggest difference between the examples and your video. Looking at the other settings it's probably not even the fact that anything particular is wrong in the function but rather that the layout elements probably haven't messed with the children settings yet. I will have to take some time to look at how they achieve things, but in the meantime you can achieve your resolution independent scheme in a different way as follows which should play nice with EWC.

    1. Make sure there is a Canvas scaler on the canvas and it's set to scale with screen size.
    2. Make your buttons have anchors that will scale nicely. If the buttons are all the same size you either have them all anchored at the center, or have them have different pivot points from the corners.

    I'll let you know when I've fixed EWC to play nice with the group scripts.
     
  39. Brotality

    Brotality

    Joined:
    Mar 13, 2016
    Posts:
    1
    Hey this asset looks awesome. Although I have one question. Is it possible to use these WiFi controllers and physical controllers at the same time? Or are all players forced to use WiFi controllers? I'd love to allow users to pick and choose the type of controller they want, especially if their phone is low on battery or they hate touch joysticks.

    Thanks
     
  40. HenkeBenkes

    HenkeBenkes

    Joined:
    Sep 15, 2015
    Posts:
    11
    Is it possible to change wich player to control in runtime?
    https://drive.google.com/file/d/0BxiFa1S-V3aAMmd0VVNVc1JTQkU/view?usp=sharing

    I want to create new players dynamically as players join.
    I tried to create a controller and then change:
    public EasyWiFiConstants.PLAYER_NUMBER player = EasyWiFiConstants.PLAYER_NUMBER.Player1;
    to no prevail :)

    If I get right you now have to create all players at the start of the game as in "MultiplayerControllerSelectServerScenePart2".

    Ideas?
     
  41. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    You can use an Android device to send commands to another device Android whit this plugin?
     
  42. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    You certainly can mix and match. Out of the box is everything you'd need on the wireless side, but if you also are using physical controllers you can certainly use both. You'd definitely have to create a player select scene though that listened for both types of controllers until everyone picked which player they were going to be though.
     
  43. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    The default "player numbers" are the order in which they connect. Player 1, 2, 3, etc. The controller select example (both scenes) show you how to create a player select scene so that if that isn't the order you want you can update at runtime. So for example if you run the example and connect 3 devices (player 1 ,2, 3) but the 3rd device connected wants to be player 1 you simply select that you want to be player 1 and start the game. When the game scene is ran every one is who they have chosen to be, that way the game scene can just operate like normal without needing to know any info. It's when you ready up at the end of the controller select scene where it switches the player numbers at runtime from the default connection order, to what ever has chosen that they want to be. If your looking to tweak that scene, you certainly can, I'd recommend looking at what is done currently to understand how it works.
     
  44. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Can you explain further what you mean by "commands"? EWC can certainly do android to android or ios or any of the supported platforms listed, but it's best suited for real time telemetry. If by your commands you mean something that is more like RPCs then it is probably not the best fit, but could be done with some tweaking.
     
  45. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    This is awesomely a super shabang momentum starter. I was working on the network controller programming when I ran across this. I saw. I bought. I installed. I ran! All in 5 minutes. This saved me a multitude of weeks. After the easy wifi funtime, I attached it to a current project and wham. I was working the deal. Great price too of $35. Are ya kiddin' me? This saved my company time cost of 1000s. And the Coup de degra was 'Its open source'. Inconceivable.
    Thanks for a great product.
     
  46. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Thanks for the kind words!
     
  47. Dazzaz

    Dazzaz

    Joined:
    Dec 3, 2016
    Posts:
    3
    I'm looking to purchase this, but wanted a little clarification as I'm new to unity and development in the first place.

    I'm looking to create a poker game for personal/home use. I want to have the poker table be digital, so the play surface would be a 42" or so screen built into a 10 person poker table. I'm looking at buying 10-12 cheap tablets and build them into the table or have the users use their own tablet/phone to see their hands/bet/fold/etc.

    I'm guessing that using the Easy Wifi Controller would allow me to easily allow this? Allow the players phone/tablet to connect to the primary game server running with the playfield.
     
  48. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    I have a question:
    Before I create my own rabbit hole of research I would like to know if I can use EWC to run on one device only. And possibly without wifi turned on? I was thinking of using the gyro of the client to control a collider in a demo on the client, therefore no wifi needed because I am in one demo on one device.
    Plus I am using two cameras as side by side viewports for VR applications
     
  49. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Yes as long as all the devices are connected to the same Wifi network it will work. Most likely you wouldn't use many of the UI controls provided except maybe the button for the cards but you would probably just use the string forward and backchannels to communicate the hand that they player has at the current time. The UI is up to you but yes EWC could handle this. Most TV screens don't have android or one of the supported platforms in them but you could certainly hook up a fire tv, android tv, apple tv, or PC to that part and cheap tablets are easily available.
     
  50. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    On devices that allow 2 applications to actually be in the foreground at the same time this could work (for example you can have 2 apps on a PC one be the client and the other be the server. It may or may not work without a network connection seemed to work on my flavor of Windows when I tried it. It depends on whether or not the OS in question would recognize it's own IP address and shorthand it to localhost so it doesn't go to the router just to come back to itself. Some OS's do some don't I would expect on most mobile OSes for this not to work and need to be connected to a router. The router doesn't necessarily need to have internet but rather just be a node on a LAN.

    I'm very confused by your use-case though, why not be a single app and just use Unity directly and not EWC?