Announcement

Collapse
No announcement yet.

Android multiplayer wlan: Android as host device problem

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Android multiplayer wlan: Android as host device problem

    I'm having big troubles getting android as the host working.

    I'm testing with the Multiplayer Shootout to ensure it's easy to reproduce with 4.10. The only thing I changed in that project was changing the OnlineSubSystem in the DefaultEngine.ini like so:

    Code:
    [OnlineSubsystem]
    DefaultPlatformService=Null
    What works:
    • Windows as host android as client


    What doesn't work:
    • Android as host windows as client
    • Android as host different android device as client


    Log on android device as I start it as the host ("Create Session"):
    Code:
    11-30 19:59:30.256: D/UE4(24913): [2015.11.30-18.59.30:263][64000]LogInit: BSD: I am localhost (127.0.0.1:0)
    11-30 19:59:30.391: D/UE4(24913): [2015.11.30-18.59.30:398][64000]LogPackageName: SearchForPackageOnDisk took   0.129s to resolve Level_01.umap.
    11-30 19:59:30.491: D/UE4(24913): [2015.11.30-18.59.30:498][64000]LogPackageName: SearchForPackageOnDisk took   0.087s to resolve Level_01.umap.
    11-30 19:59:30.491: D/UE4(24913): [2015.11.30-18.59.30:499][64000]LogNet: Browse: /Game/Maps/Level_01?listen
    11-30 19:59:30.496: D/UE4(24913): [2015.11.30-18.59.30:499][64000]LogLoad: LoadMap: /Game/Maps/Level_01?listen
    11-30 19:59:30.541: D/UE4(24913): [2015.11.30-18.59.30:546][64000]LogParticles: Destroying 0 GPU particle simulations for FXSystem 0x0x96a62390
    11-30 19:59:31.041: D/UE4(24913): [2015.11.30-18.59.31:047][64000]LogAIModule: Creating AISystem for world Level_01
    11-30 19:59:31.046: D/UE4(24913): [2015.11.30-18.59.31:050][64000]LogWorld: Game class is 'MyGameMode_C'
    11-30 19:59:31.051: D/UE4(24913): [2015.11.30-18.59.31:056][64000]LogInit: BSD: Socket queue 262144 / 262144
    11-30 19:59:31.051: D/UE4(24913): [2015.11.30-18.59.31:058][64000]LogNet: GameNetDriver IpNetDriver_0 IpNetDriver listening on port 7777
    11-30 19:59:31.086: D/UE4(24913): [2015.11.30-18.59.31:092][64000]LogWorld: Bringing World /Game/Maps/Level_01.Level_01 up for play (max tick rate 0) at 2015.11.30-19.59.31
    11-30 19:59:31.091: D/UE4(24913): [2015.11.30-18.59.31:095][64000]LogWorld: Bringing up level for play took: 0.019772
    11-30 19:59:31.126: D/UE4(24913): [2015.11.30-18.59.31:132][64000]LogScript:Warning: Accessed None 'CallFunc_K2_GetPawn_ReturnValue'
    11-30 19:59:31.126: D/UE4(24913): 	MyGameMode_C /Game/Maps/Level_01.Level_01:PersistentLevel.MyGameMode_C_0
    11-30 19:59:31.126: D/UE4(24913): 	Function /Game/Blueprints/MyGameMode.MyGameMode_C:ExecuteUbergraph_MyGameMode:045F
    11-30 19:59:31.151: D/UE4(24913): [2015.11.30-18.59.31:158][64000]LogOnline:Warning: NULL: Can't start an online session (Game) in state InProgress
    11-30 19:59:31.161: D/UE4(24913): [2015.11.30-18.59.31:167][64000]LogScript:Warning: Accessed None 'Widget'
    11-30 19:59:31.161: D/UE4(24913): 	MyGameInstance_C /Engine/Transient.GameEngine_0:MyGameInstance_C_0
    11-30 19:59:31.161: D/UE4(24913): 	Function /Game/Blueprints/MyGameInstance.MyGameInstance_C:Hide Widget:000A
    Similar to the problem mentioned here without resolve: https://forums.unrealengine.com/show...ng-Google-Play
    and here also without resolve: https://answers.unrealengine.com/que...roid-host.html

    I have not been able to find anywhere how to get android as the host working. The end result I'm trying to achieve is android to android connection for a mutliplayer game over a local wifi both devices are connected to.

    Also created an Answerhub ticket: https://answers.unrealengine.com/que...t-working.html

    Any help appreciated!
    Headgear - VR/AR solutions

    Mobile VR Game: We Come In Peace... Oculus GearVR | Google Play Daydream | Pico Goblin

    #2
    Ok I managed to get it working! By connecting via console commands with "open ipaddressOfMyAndroidDevice" instead of the blueprint node "Join Session"

    So this appears to be a bug with the "Blueprint Session Result" variable not giving/getting the correct IP of the android host?

    Is there anyway to get the server IP address in the client? Currently it seems like it only supports Server Name
    Headgear - VR/AR solutions

    Mobile VR Game: We Come In Peace... Oculus GearVR | Google Play Daydream | Pico Goblin

    Comment


      #3
      @ unreal team , any help or tips guys ?

      Comment


        #4
        The last few entries in the log explain some of what's going on.

        Code:
        11-30 19:59:31.126: D/UE4(24913): [2015.11.30-18.59.31:132][64000]LogScript:Warning: Accessed None 'CallFunc_K2_GetPawn_ReturnValue'
        11-30 19:59:31.151: D/UE4(24913): [2015.11.30-18.59.31:158][64000]LogOnline:Warning: NULL: Can't start an online session (Game) in state InProgress
        11-30 19:59:31.161: D/UE4(24913): [2015.11.30-18.59.31:167][64000]LogScript:Warning: Accessed None 'Widget'
        11-30 19:59:31.161: D/UE4(24913): 	MyGameInstance_C /Engine/Transient.GameEngine_0:MyGameInstance_C_0
        11-30 19:59:31.161: D/UE4(24913): 	Function /Game/Blueprints/MyGameInstance.MyGameInstance_C:Hide Widget:000A
        First line indicates that it can't find the pawn for something. I suggest testing Multiplayer in PIE and making sure that 'Break Blueprints On Exceptions' is turned on in editor/project settings so you can fix it.

        Second line indicates that you're trying to start a Game Session while the GameModes Match State is 'InProgress' - which it says you can't do. It seems as though Gameplay has already started before you start the Online Session, or you already have an online session in progress.

        Third/Fourth/Fifth line indicates that the game can't find a 'Widget' to remove in the Game Instance.

        I would suggest fixing these errors and trying again after that. I've found that Android doesn't seem to handle errors as gracefully as Windows does, especially when it comes to Multiplayer. The slightest misdemeanor seems to cause problems. We never tried an Android host for PC client, but all other configurations worked for us without a hitch when we did Cross-Platform multiplayer - so it definitely works. Always check both the Client and the Server logs too.

        Comment


          #5
          FYI: I managed to get it working using the pull request from psychogony as mentioned here: https://answers.unrealengine.com/que...t-working.html

          It can be found here: https://github.com/EpicGames/UnrealEngine/pull/1820
          he shouldn't mind me posting it here, but be aware it was tricky (for me at least) to cherry pick this one - but once I got it all compiled the join session blueprint node works flawlessly for me on both normal android app and two gearvr devices

          So yeah it's definitely a bug in the engine with android and multiplayer that is not working by default unless you enter the IP directly but at least I have a workaround for now - it's just annoying there are so many gearvr workarounds needed to be manually compiled every time a new UE4 version comes out...
          Headgear - VR/AR solutions

          Mobile VR Game: We Come In Peace... Oculus GearVR | Google Play Daydream | Pico Goblin

          Comment


            #6
            Thanks TheJamsh

            Thank aussieburger
            But to be honest i couldn't figure out how did you fix your problem from that Github page did you copy past the files to your project ? iam not a programmed and if you have tips what change you made in your game in detail i will be very thankful as i'm noob here and my knowledge only restricted in blueprint .
            Last edited by mhnoni; 12-27-2015, 01:16 PM. Reason: change

            Comment


              #7
              Here's a brief step-by-step for how I got it working. PS: I'm not a C++ programmer either and while the end result of these steps is it all works via blueprints, you do need to mess around with visual studio unfortunately:
              1. link your unreal and github account as per: https://www.unrealengine.com/ue4-on-github
              2. download the zip source code of the engine: https://github.com/EpicGames/UnrealEngine/tree/4.10
              3. have Visual Studio express installed
              4. exact zip and run setup (will take ages)
              5. run GenerateProjectFiles.bat as admin
              6. open UE4.sln which will open UE4 source in Visual Studio
              7. Build windows 64 | Development Editor (will take ages)
              8. replace the two whole files from the pull request: https://github.com/EpicGames/UnrealE...ull/1820/files
              9. Build Android | Development (will take ages)
              10. Build Android | Shipping (will take ages)
              11. Now you can open your freshly built engine with the fix in place. Located: \Engine\Binaries\Win64\UE4Editor.exe (it will take absolutely ages the first time you open and do anything)


              For all that building stuff you can find documentation from Epic games on how to do it on this link: https://github.com/EpicGames/UnrealEngine/tree/4.10

              I actually used branch 4.9 however all branches should work in theory

              Annoying we need to do this - hope Epic can give feedback on putting the fix in for all!
              Last edited by aussieburger; 01-08-2016, 03:51 AM.
              Headgear - VR/AR solutions

              Mobile VR Game: We Come In Peace... Oculus GearVR | Google Play Daydream | Pico Goblin

              Comment


                #8
                @ aussieburger thanks a lot man really appreciated , i will try to do your steps and hopefully unreal team can fix the issue .thanks to you i will get back to my lan android game project i was working on it that i left it due to this issue .

                Comment


                  #9
                  Hi

                  i just downloaded both the file required to be replaced but anyone can tell me pls why do i need to download the source code of the engine to do that ? as i already found and i can replace the 2 files in the engine itself that i download it from the epic launcher.

                  I'm in 4.8 Btw does this issue still in 4.10 ?

                  Comment


                    #10
                    OK to close this thread thanks to aussieburger and psychogony fix . android now can act as server and the other phone can find the session when 2 phone connected to a local wifi router but just to be informed that the join fail when you make portable hotspot one of the phone or direct wifi to make a wifi network between the 2 phone so hope Epic can fix this issue .

                    Comment


                      #11
                      Originally posted by aussieburger View Post
                      Here's a brief step-by-step for how I got it working. PS: I'm not a C++ programmer either and while the end result of these steps is it all works via blueprints, you do need to mess around with visual studio unfortunately:
                      1. link your unreal and github account as per: https://www.unrealengine.com/ue4-on-github
                      2. download the zip source code of the engine: https://github.com/EpicGames/UnrealEngine/tree/4.10
                      3. have Visual Studio express installed
                      4. exact zip and run setup (will take ages)
                      5. run GenerateProjectFiles.bat as admin
                      6. open UE4.sln which will open UE4 source in Visual Studio
                      7. Build windows 64 | Development Editor (will take ages)
                      8. replace the two whole files from the pull request: https://github.com/EpicGames/UnrealE...ull/1820/files
                      9. Build Android | Development (will take ages)
                      10. Build Android | Shipping (will take ages)
                      11. Now you can open your freshly built engine with the fix in place. Located: \Engine\Binaries\Win64\UE4Editor.exe (it will take absolutely ages the first time you open and do anything)


                      For all that building stuff you can find documentation from Epic games on how to do it on this link: https://github.com/EpicGames/UnrealEngine/tree/4.10

                      I actually used branch 4.9 however all branches should work in theory

                      Annoying we need to do this - hope Epic can give feedback on putting the fix in for all!
                      Does anyone know if this is still needed in 4.11?

                      Comment


                        #12
                        Originally posted by Pabooklas View Post
                        Does anyone know if this is still needed in 4.11?
                        Yes i think as android still not supported .

                        Comment


                          #13
                          Thanks for a reply. Time to download Visual Studio I guess.

                          Comment


                            #14
                            So I have been away for quite some time but does it work now? Is it possible to make multiplayer work with Android?
                            Do Not Argue Toxic Game
                            Balloony PoP get it on Google Play
                            Fishy Blub Blub
                            get it on Google Play

                            Comment


                              #15
                              Originally posted by KillerSneak View Post
                              So I have been away for quite some time but does it work now? Is it possible to make multiplayer work with Android?
                              it will be with 4.12

                              Comment

                              Working...
                              X