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. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    Version 1.6 just went live on the asset store. It contains some requests received this week.

    New Features
    • New Data Controls (for complex controllers where you want some AI data sent from controller)
    • New example AI scene
    • Documentation update

    Improvements
    • Switch Button now exposes an inspector variable for maximum press rate so you can customize this with no coding required.
    • Button and Switch Button custom server controls now expose in inspector a variable for if you want to call your notify function every frame or only when the value changes
    As always if you you have any questions/comments or would like to request something feel free to respond in this thread or contact our support email address.
     
  2. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    400
    I'm very interested.
    - What is the lowest Unity version you could support? (I'm using 4.5 Pro, will update to 4.6)
    - Is the controller skinable (change the graphics or remap controls to 3D objects)?
    - Is it possible to use more than one device? (for example have half of the input controls one one device and the other half on another)
    - and derived from the previous question: multiplayer?

    Thanks in advance!
     
  3. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    The current version requires Unity 5 or above.

    Yep you can swap out the controller sprites with your own without issues. Mapping controls to 3D objects is built in without coding needed but if you have custom code you can also call that no problem.

    That's an interesting question, I can't say I've tested splitting separate controls on the same player to separate devices. It should work though, I'll test it tonight and let you know.

    Multiplayer is supported. Generally speaking, each device has the same set of controls and it's built into our framework to designate easily which player you want to control which objects. I will certainly test on your variation where each controller doesn't have the same set of controls (or maybe you're using two devices and combined you want to player 1).
     
    Last edited: Sep 19, 2015
  4. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    I tested this tonight and it does work albeit in a kind of workaround way. Each distinct device is given a player number when they connect. So two different players are given two different player numbers. If you spread the controls over two separate controls (you must have a lot of controls!) you are currently in your game going to want to assign some of the controls to player 1 and some to player 2. My original design was built more around your typical game where every player is using their phone/tablet as a controller and obviously in that usecase it makes sense that each of the "controllers" be the same.

    I certainly have no problems adding an API to make this smoother, but I'd like to hear more about your usecase @nukeD so that it fits all of your needs. Is your game multi device but yet single player? If so I could add an entry similar to Unity's "Get Input from every Joystick" setting and then it would work just fine. If however you usecase is both multidevice and multiplayer then I'll have to think about how to best modify the current API to make that easy.
     
  5. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    400
    Thanks a lot for the reply, my questions were a little bit general, not tied to an existing game, but to a upcoming project. It is an educational kiosk for a planetarium/museum with a big screen and tablet for controls. The question about the split controller with multiple tablets was more of an idea than a real case... designing the kiosk like a cockpit and have the controls on both sides of the player. I think we'll be using 4.6 for that one.
    I'll get your wifi controller as soon as i can.
    Thanks again!
     
  6. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    400
    OK, one last question: is it possible to connect a tablet directly to the computer, or i do need to have a router and internet?

    Thanks again
     
  7. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    This asset requires both devices by on the same LAN (can be either wifi or wired). It doesn't communicate through USB if that's what your asking.
     
  8. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    400
    Thanks, yeah i was referring to some sort of adhoc wifi connection, the way cameras connect to android tablets without internet or router.
     
  9. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    I don't know of many new things (I know that there used to be some) that want a direct connection that still use adhoc wifi, most use wifi direct, bluetooth, or NFC. Since both ends of the asset need to be running unity, I definitely don't know of any Unity capable devices that use ad hoc wifi or wifi direct (I suppose you could root a device) but when it normally has full wifi I'm not sure what it gains you to not use regular wifi. Routers nowadays are dirt cheap if you wanted to setup a dedicated small network for a kiosk installation and set it to not broadcast the SSID or lockdown the allowable DHCP clients so no one else can join after setup. Also, the direct connections kind of go hand and hand with only two devices so your two tablet and a computer would kind of conflict with the direct connections anyways.

    Is there something I'm missing?
     
  10. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    400
    Thanks man, i'm just thinking out loud here (on how to setup the kiosk), i dont know much about networking, thats why i'm asking so many questions.
     
  11. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    No problem, if you have any other questions don't hesitate to ask.
     
  12. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    172
    I see now there is a Unity 5 version only. Do you still have a Unity 4.3 or below version you can email me (i will send po) if I purchase? A Unity 4.5 would likely work to, but if it's all Unity 4.6+ with the new Unity GUI and no OnGUI samples it is going to be a pain.
     
  13. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    @productofself Easy Wifi Controller (current version) currently requires Unity 5 or above.

    It has always been using the newer Unity GUI introduced in Unity 4.6 so older versions like Unity 4.3 that could only use onGUI were never supported. There isn't a technical barrier on Unity 4.6 but back in Unity 4 .NET sockets were a pro only feature which is why we decided to target Unity 5 and above only.

    If you have pro on Unity 4.6, the core of the product will work but many of the examples use the Unity 5 shader, materials, prefabs, etc. so you only have access to 4 out of the 16 examples (just the very basic ones not the roll a ball or any of the examples that used Unity 5 features.

    In the store we only support Unity 5 or above because of the above reasons (needing pro, limited examples, etc). If you are willing to deal with the limitations, a Unity 4.6 version can be obtained through the support email if you have already purchased the product and have an invoice number. The Unity 4.6 version will then be mailed.
     
    Last edited: Sep 23, 2015
  14. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    172
  15. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    For back in Unity 4.6, If you remove the expectation of studying the other 12 example scenes, the core of the product does still function in 4.6 (not Unity 4.5 or earlier though) either in pro or with good ol' sockets and free. The only thing you wouldn't be able to do is look at the 12 Unity 5 only example scenes which would be inconvenient to need to install 2 separate Unity versions one to study those extra examples (Unity 5 or greater) and one to incorporate in your Unity 4.6 game, but it is possible. You only get 4 example scenes (the simple examples) that work in Unity 4.6.

    From a product support perspective I definitely do still support users with 4.6 (provided you have either Unity pro or good ol' sockets and free), I do get the occasional request for support with their own games on 4.6, but most of the example scenes will only function on Unity 5 or greater both for the health and quickness of the project, and because very few users were adopting it on Unity 4.6.
     
    Last edited: Sep 24, 2015
  16. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    172
    so you didn't backup a 4.6 version? all i am wanting is to send you a po number after i purchase and be emailed a 4.6 version with working examples. of course 4.3 would be nice but NGUI and Unity UI are pretty similiar.

    is ui built using components or code? if code the port would be pretty straightforward.

    i see lots of devs now uploading seperate versions of their asset, anywhere from Unity 3, 4 and 5 for compatibility. You may want to consider this.

    at any rate what i would need is support, hopefully an example scene sent after purchase of 4.6 with a directional stick on left side, and 4 buttons on right. a bonus scene of touch would be nice too.
     
  17. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    Edit: For Unity 4.6 I provide the current code with 4 out of the 16 examples (the ones that don't require Unity 5) via email. On the store only Unity 5.0 or later is supported. If you wish to use EWC on Unity 4.6 Unity pro is required because EWC requires .Net socket support. If you are using Unity 4.6 free version you would also need good ol' sockets.

    Unity 5 has no limitations can be used in Personal or Pro and comes with 16 example scenes.
     
    Last edited: Sep 24, 2015
  18. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    I'm always happy to give specific support. All of the features of the product works just fine with 4.6 provided you have either pro or as you mentioned good ol' sockets (with good ol' sockets there is a namespace change that I'm sure you're aware of with the using statements). The only thing that won't work when using Unity 4.6 is the EWC example scenes that require Unity 5, everything at the core of the product works fine and when using in your own game there is nothing that is different in Unity 4.6.
     
    Last edited: Sep 23, 2015
  19. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    172
    Except I will have the 4.6 examples scenes because you will email me over your archived 4.6 project with the older 4 working examples scenes correct?

    This is what I am looking to hear from you from a presale perspective.
    I will email you my PO (purchase order) proof that I bought the Unity 5 version on the asset store.
    You then email me a complete working 4.6 unity package that works in 4.6 without me needing to do anything. I understand it will only have 4 scenes not 16.
    I understand this still uses the Unity UI and does not use the legacy 4.3 OnGUI(), but not the new Unity 5 shader plus whater other enhancements you made.

    At any rate with these 2 working projects I can easily manage my own version control and update to Unity 5 at my leisure.

    Does above sound agreeable to you?
     
  20. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    @productofself That is correct. I have merged the latest code with the legacy example scenes that will work on Unity 4.6 (4 out of the 16 as previously mentioned).

    If you decide to purchase just email me your invoice # and I'll be happy to mail you the above mentioned Unity 4.6 version of Easy Wifi Controller.
     
    Last edited: Sep 23, 2015
  21. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    Version 1.7 just went live on the asset store. Changes listed below.

    Updates
    • Joystick improvements
    • Documentation update
     
  22. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    As you may have noticed for October Easy WiFi Controller is being featured by Unity in the Level 11 sale! A big thanks to everyone that supported us so far and if you're on the fence don't miss the chance to get it for the lowest price it's been.
     
  23. tonic

    tonic

    Joined:
    Oct 31, 2012
    Posts:
    378
    @greggtwep16, I'd like to know what are your plans to expand platform support to Windows Store apps? (Win8 & WP8, Win10 universal apps)
     
  24. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    @tonic my current tentative plans is to when UNET is ready (which also uses UDP under the hood) was to rewrite the networking code using UNET LLAPI and taking out the .NET UDP networking code which would allow the asset to work on many more platforms (Win8, WP8, UWP, consoles, WebGL, etc). However every time even currently I run a simple test the latency shoots up from something that is acceptable as a controller (<20ms) to something that is not. I still plan on doing this at some point but its hard to say when. It's looking currently like this may not happen in 2015 and will come later.
     
  25. bitbutter

    bitbutter

    Joined:
    Jul 19, 2012
    Posts:
    60
    Thanks for this asset, it's looking very promising so far.
    I'd like to test multiple instances of my 'client' controller with my 'server' game locally on my development machine (mac) but I'm only managing to get one instance of my client app to connect. I think I'm doing something wrong.

    Here's what I'm doing:
    • I export the client scene as a standalone player.
    • I make a copy of that player file (so that i can open a second instance of it later)
    • I run the game (server) in the Unity editor.
    • I open the first instance of the client player, i can use it to control the game as expected.
    • I open the second instance of the client player, but it doesn't seem to be recognised by the server. Controls don't affect the game as expected and the verbose server log doesn't look as though the second client is connecting.
    Any pointers would be appreciated!
     
    Last edited: Oct 10, 2015
  26. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    Did you have the same issue with the multiplayer example scene included? In that example you should be able to control the first sphere with the first controller and the second sphere with the second controller. What happens when you try that example?

    I'm also a little bit unclear on your setup, are all 3 instances running on the Mac or do you have two phones and then just the game on the Mac? Just trying to get a clearer picture of what you are trying to accomplish.
     
  27. bitbutter

    bitbutter

    Joined:
    Jul 19, 2012
    Posts:
    60
    I'm also having the same problem. I export the multiplayer client scene, duplicate that player file. Then run the multipayer server scene in the Unity editor. I launch both multiplayer client players. I can press 'connect' on the first one and it controls the leftmost ball as expected. If i press 'connect' on the second one the 'wifi waves' image on the client starts to flash and it doesn't seem to connect.

    Yes, all 3 instances are running on the same mac. The server is running in the Unity editor and the two clients are both running as standalone unity players.
     
  28. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    Ah, this makes sense now. Easy WiFi Controller handles the connections for you automatically but it is IP based since that is the most logical for the majority of usecases (using each phone as a seperate controller). Since all 3 of your instances are on you mac they have the same LAN NAT address and are essentially 1 player (player 1 if this is a single player game). Can you explain your usecase a little bit on why you'd want the same controls on seperate instances on the same machine? Currently, we support both of the usecases below but I want to hear a little more about your goal before I make an addition to the project.

    1. The normal most common use case is that the same controller is deployed to many phones. This works just fine because each device has a different NAT IP. The first one is player 1 the second player 2, etc.

    2. A secondary request I had awhile back that is supported in the project is a game where a user wanted a pretty fancy setup on PC with multi monitor support (basically he wanted some controls on monitor 1 some on monitor 2, etc but they were all on the same machine. This is fine because while they are all mapped to player 1 because of the IP the control names are different the first controller app on the machine had 10 controls and the second had 10 different controls.

    However, trying out the example but yet not actually running them on different devices but yet sharing all the control names will get them all registered on the first player. Can you explain your desired usecase a bit more? I can't envision why you'd want the same exact controller in multiple apps on the same machine in production.
     
  29. bitbutter

    bitbutter

    Joined:
    Jul 19, 2012
    Posts:
    60
    Ah i see why that's not working.
    Sure: What I hoped I would be able to do is run a host and multiple clients all on my development machine just to facilitate testing while developing. I don't have easy access to multiple mobile devices myself, and hoped i could already test how my game would work (including the interactions between multiple clients, and their backchannel activity) by 'faking' those devices on my development machine.
     
  30. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    Perhaps I'm still missing something here but aren't all the clients identical? Generally, you don't have unique events or controls per controller (you don't want to give player 1 an advantage over player 2). Usually, each controller has the same set of controls (dpads, joysticks, etc.) and the same set of backchannels (ie. like animating the spedometer in my example). Usually you can test all the plumbing with one device since they are the same the only thing that changes is the player number.

    Since you mention you don't have any other mobile devices (which I assume means you have one) do you by any chance have any other PC/Max/Linux machines? At a minimum if you have only 1 phone/1 computer you can have the server/client both running on one machine and still connect the 1 phone as player 2 (or vice versa). However, in general, I've found that you don't want to fake the network stuff in testing, localhost can mask a lot of things (not to mention you see a massive speed increase since what used to take ~20ms now takes less than 1ms).

    That being said if I'm missing something obvious (if you expand a bit more on your usecase) I'll certainly consider adding something.
     
  31. bitbutter

    bitbutter

    Joined:
    Jul 19, 2012
    Posts:
    60
    They are. I'll give more context about the project that hopefully makes it a bit clearer what I'm after.

    The project is a local multiplayer racing game. It's already set up to allow up to eight players using hardware joypads. We're using the Rewired asset to facilitate some of this, and piping EasyWifi controller input into 'custom controllers' (really 'virtual controllers') exposed by Rewired. So we want to allow smartphone control too. We also want it to be possible to have matches where some players use joypads, and other use smartphones. We also want to create logic to preserve player colour between races (if you start again using the same smartphone as last time, you'll usually be assigned the same color).

    To test this stuff is working properly it'd be great if i could have multiple wifi clients running on my local machine.
     
  32. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    Edit: Originally, I thought this was going to be possible to assist your Dev enviroment but it's not. Explanation below.

    The underlying technology that Easy WiFi Controller uses (UDP sockets) does not allow multiple applications on the same machine with the same controls to bind to the same port and keep unexpected behaviours from happening. In your final game this sharing is not desired anyways since each player has their own phone. Even if multiple apps bind to the same port it would have unfavorable results because the apps would be in a race to get to the messages on that same port first and it would never be guaranteed which one would see it. While certainly projects can be designed from the ground up to accommodate this (each client using its own port, listener, thread), it unfortunately cannot both accommodate this and have auto discovery in a fast and efficient manner.

    Auto discovery is a core pillar of the application (it helps everyone not need to worry about the networking and each piece will find each other automatically on the same WiFi).The auto discovery in the project works because known ports are used for the traffic (these are what you set in Easy Wifi Manager in the inspector). This is also why you see two entries in the Easy wifi manager so that you can have the client and server on the same machine in a development environment but not multiple clients (because they'd be fighting over the same traffic). While in general you can extrapolate this out and have client 1 port, client 2 port, client 3 port, etc. you lose the Auto Discovery when you do this with the current design and it would require a complete rewrite of the projects core networking code to do this. Even if I was to rewrite the core code, I don't think I would choose to do so because the underlying foundation would increase with every client connected. I suspect that this foundation (especially the number of threads required) would make the 16 players not achievable. Given the choice between supporting up to 16 players and having a development mode not require more than 1 phone/laptop for multiplayer testing, I would again choose the 16 players.

    Sorry to get your hopes up at first I thought this was going to be doable.
     
    Last edited: Oct 12, 2015
  33. bitbutter

    bitbutter

    Joined:
    Jul 19, 2012
    Posts:
    60
    That would be perfect! Thanks so much.
     
  34. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    I have had a few inquiries so far so I figured I would mention it here. Easy WiFi Controller does work with the new Apple TV. I was able to test it fully recently on a dev kit and it works without issue.
     
  35. bitbutter

    bitbutter

    Joined:
    Jul 19, 2012
    Posts:
    60
    Ah I understand. Thanks for the update. Perhaps it might be worth adding a brief note to the documentation somewhere clarifying that one wifi client will work on the same machine acting as host, but not multiple instances.
     
  36. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    Certainly will update the documentation, thanks for understanding.

    I certainly do plan to still implement the other items in the next update (and a few other things). These include:

    1. A new example scene showing a typical controller select menu scene that launches a simple game scene. This will include example code on how to change the player number at runtime

    2. An "any player" option in addition to the current player 1 - 16 (this is useful for menus).

    3. A much improved connection system. You will no longer in development need to restart the controller app on server only build changes.

    4. Other miscellaneous improvements

    This is currently in testing and I hope to have it live on the store in a 1-2 weeks.
     
  37. bitbutter

    bitbutter

    Joined:
    Jul 19, 2012
    Posts:
    60
    Thanks. A separate thing: I'm trying to use a backchannel to set the background color of the wifi client scene (just once, when a player 'joins' a race) and things aren't going as i expected. Before I explain more i have a quick question:

    In the client, the method i've designated as 'Notify Method' seems to be being called every frame, even when I strip away all code in my project (host or client) that I thought would result in in being called. Is this expected behaviour?
     
  38. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    It is expected behavior currently most of our controls are setup to be pumped out every frame kind of like telemetry. I can certainly add a enum to the inspector so you can easily switch the common modes you might want (call every frame or only when changed). These modes don't make sense for a joystick, touchpad, etc. because generally you want to move your player every frame, but they do for buttons, switches, etc. It never hurts to have options though so I'll add these to all the backchannels in the next update. If you don't want to wait you can employ the same pattern now that you see in CustomButtonServerController.cs into the client backchannel you're using currently. I'll certainly include this in the next update.
     
    Last edited: Oct 12, 2015
  39. bitbutter

    bitbutter

    Joined:
    Jul 19, 2012
    Posts:
    60
    Ah i see. I tried modifying StringServerBackchannel.cs in the way you suggested, but it looks like I also need to modify at least StringClientBackchannel.cs too (?). I've gotten stuck so I guess I'll wait for the update. Thanks!
     
  40. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    That pattern should be on the receiving end, not the sending end. For buttons or any other forward channel it should be on the server, but on a backchannel going the other way it should be on the client. If you add the follwing to StringClientBackchannel.cs it should work (you don't need to change StringServerBackchannel).

    at the top after the other declarations
    Code (CSharp):
    1. [Tooltip("Determines when your Notify Method gets called")]
    2. public EasyWiFiConstants.CALL_TYPE callType = EasyWiFiConstants.CALL_TYPE.Every_Frame;
    3. string lastValue = "";
    and change the following method like below:
    Code (CSharp):
    1.      
    2.   public void mapDataStructureToMethod()
    3.   {
    4.           if (callType == EasyWiFiConstants.CALL_TYPE.Every_Frame)
    5.               SendMessage(notifyMethod, stringBackchannel, SendMessageOptions.DontRequireReceiver);
    6.           else
    7.           {
    8.              if (!lastValue.Equals(stringBackchannel.STRING_VALUE))
    9.              {
    10.                  SendMessage(notifyMethod, stringBackchannel, SendMessageOptions.DontRequireReceiver);
    11.              }
    12.              lastValue = stringBackchannel.STRING_VALUE;
    13.           }
    14.   }
    15.  
    Then just flip the inspector on the object in question to "only when changed" from "every frame" and it should behave like you expect. I'll certainly add this to the string backchannel in the next update.
     
    Last edited: Oct 15, 2015
  41. bitbutter

    bitbutter

    Joined:
    Jul 19, 2012
    Posts:
    60
    [EDIT]
    I've managed to get this working as expected in a much simpler test scene. So this is very probably a mistake I'm making elsewhere in my code. Please disregard the following!
    ---
    Thanks for this. I've made the change you explained. I've set up a simple test to try to get it working.
    In the script attempting to send backchannel data changes to the wifi client i have the following:

    Code (CSharp):
    1. public EasyWiFi.ServerBackchannels.StringServerBackchannel stringBackchannel;
    2. // And later...
    3. string s = "TEST"+Random.value;
    4. Debug.Log("About to send: "+s);
    5. this.stringBackchannel.setValue(s);
    6.  
    And on my client the notify method looks like this:
    Code (CSharp):
    1. public void ChangeBackgroundColor (StringBackchannelType s) {
    2. cam.backgroundColor = new Color(Random.value,Random.value,Random.value);
    3. }
    The notify method appears to be running as soon as the client initialises (i get a different random coloured background each time i open it), but does not change when I set the value of this.stringBackchannel from the host. I do get the expected Debug trace at that moment, so that code is getting executed.

    I've double checked that the control name and notify method are set correctly. And I have the StringClientBackchannel monobehaviour on my client set to Only_When_Changed.

    I realise this might be difficult to troubleshoot from your end, but perhaps you see some obvious mistake I'm making. Thanks in any case for your help so far!
     
    Last edited: Oct 15, 2015
  42. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    Glad you got it working. If you have any other questions don't hesitate to ask.
     
  43. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,157
    Hi greggtwep16.

    I bought your asset today but didn't had much time to play with it.
    I hope to do so in the next days.

    Do you believe that it would be possible to send screenshots of the game to the mobile device?
     
  44. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    In general the product is mainly geared towards using your phone as a controller. To facilitate this messages are sent out every frame and should be less that 512 bytes (half of 1 kb) since they are being pumped out once a frame. So in general, no the product is not setup for this.

    That being said in some instances it could be done but would require modification of the product. In addition Easy WiFi Controller is setup to handle up to 16 devices as a controller (hence the small data requirement) but if your game is single player a normal wifi should be able to handle image data sizes but certainly wouldn't scale to 16 (I'd be shocked with data that large if it would even get to 4 if you made this modification).

    Are you thinking static images once in awhile or more like a second screen?
     
  45. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,157
    Well I am thinking something like a stream of the game with highly compressed images. For one player.
    They don't have to be ent every frame.

    I am developing a native jpg plugin that could make a lossy compression of a scaled down frame every 0.1 seconds.

    I am not asking you to implement this. Some directions on how to do this with your plugin would be enough.

    Edit: Perhaps it could be done via sockets. This guy did it this way:
     
    Last edited: Oct 15, 2015
  46. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    Regardless of the data being sent in Easy WiFi Controller you would use a backchannel control to send information back from the game to controller. You would simply create a ImageBackhannel type and you could model it off the other ones that are already present.

    Although stepping back from my product and just talking about your usecase in general in just Unity terms, I don't think you are going to be able to do what you want fast enough. I originally wanted to make a product pretty similar to what you describe and it just didn't cut it. The problem is going to be in making the images fast enough to not tank your framerate. Even on a powerful PC and even scaling the images down to low resolution it simply is fighting the natural flow of CPU -> GPU and you are wanting to send data back from GPU -> CPU. There are several ways to accomplish this (render textures, OS level screenshots, Graphics API specific calls, etc) but in many tests several months ago each effectively even in simple scenes lowered the FPS to about 10. This essentially isn't good enough for a stream.

    Things may have changed or maybe I overlooked something, so as always I encourage you to try maybe you'll have success, but I certainly wasn't able to find a effective solution. If you do succeed don't hesitate to let me know how you accomplished that to because I'm interested in the topic as well.

    Are you having luck with your native .jpg plugin and able to keep a high FPS when outputting the screen to it every frame, every other frame, etc?
     
    Last edited: Oct 15, 2015
    elias_t likes this.
  47. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,157
    Ok. Thanks for the detailed info and directions!

    Of course if I have something I will post it here.
     
  48. Francsois114

    Francsois114

    Joined:
    Mar 21, 2014
    Posts:
    5
    I try to use the Custom Touchpad Server Controller, to call a script that I made. But even if my phone is connected and the console receive the position of the touch input of my phone, the touchpad variable stay null. So I can't call my function. Any idea ?
     
  49. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,505
    The Drawing example scene has an example of the Custom Touchpad Server Controller but the obvious things to check are the following.

    1. The touchpad client control and the server control have the same control name
    2. The function you want it to call is on the same gameobject

    If both of these are set I'll certainly need more information. The fact that it's in the console though means the data is getting there it's just not getting hooked up to your object. Most likely it's one of the above.
     
  50. Francsois114

    Francsois114

    Joined:
    Mar 21, 2014
    Posts:
    5
    Thanks, my control and my function were on the same object. I got confused because in the painting demo scene the touchpad controller and the paint function ar on the same game object.