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:
[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”):
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
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.
The last few entries in the log explain some of what’s going on.
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.
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…
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 .
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:
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)
@ 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 .
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.
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 .
There are many tutorials how to do it for pc on youtube. For android it’s exactly the same. So follow one of them on YouTube. Then just hook your create, find and join events to umg buttons or even android buttons for testing.
Also edit the defaultengine.in file like the op wrote.
Wow! I can’t believe this I was actually able to get this to work. It sounds like a giant blind alley at first (took me probably around 3 hours), but it worked! This has to be the best instructions/boldest workaround I have ever seen. hahaha Thank you so much for the clear steps and wisdom. I was lost without this. You guys rock!