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.
Is there some other config required for android?? Is Android as a host working at all???
You cannot create host using Android. For Mobile, HTML5 and consoles you can build client only. If you developing multiplayer game for mobile devices, you must build Dedicated (Standalone) Server on Linux or Windows platforms.
I’m trying to check with him but would be great if Epic could really clear that up - I think I even saw a Epic twitch stream where they were trying to connect a oculus dk2 and gearvr on some dragon fly multiplayer demo where it also did not connect to the gearvr (ie: android) device
The user TheJamsh claims that an android client can join to an android host (or is here a misunderstanding): “What we’ve done before is used local LAN-based WiFi between Android tablets and PC (but Android-Android also works fine) - with a WiFi router.”
At least some Android devices do not seem to resolve their own local host addresses properly (every distro is different) meaning that Android can’t act as a server. I don’t have an Apple device on hand, but looking at the source code IOS should work fine.
Whether mobile devices have the CPU performance to act as a server is a separate question/issue.
I have issued a pull request on github that fixes the ‘Android unable to resolve local host address’ issue.
I have had no problem getting this to work (local WiFi multiplayer) on Android to Android or Android (server) to PC (client), using the unreal engine you get from the Epic launcher (not source build).
My project is Blueprint (with 1 C++ class added to expose splitscreen flag to blueprints). No dedicated server involved. It’s wifi only so it doesn’t rely on any online subsystem (set it to NULL) such as a dedicated server or Steam would involve.
I have gotten this to work with no changes to my game designed for PC LAN.
The versions I have used are 4.19, 4.20. and 4.23
I think I used NULL (all caps) instead of Null in the ini file though.
On some Android devices however, I have to start the game, turn WiFi off, then back on again, before I can join a PC hosted game. But all other use cases work without any problems.
TL;DR: This works for WiFi. It’s worked for a long time. If you’re still having problems, maybe I can help you figure it out. It is possible the Android you’re testing on is unable to act as a server due to device limitations.
I did not use Advanced Sessions plugin either, just the built-in Create Session, Find Sessions, and Join Session nodes. I can try to send screenshots later. Will you send screenshots of your BP where it joins session? Maybe I can see what’s wrong in yours.