[Solved] Upgraded to 4.10 to avoid 4.9.2 network bug. bug is still present. Is it possible to fix without restarting project

I build my project using Unreal Engine version 4.9.2. It is a networked FPS prototype which uses Blueprint networking to create, find and join sessions, similar to Multiplayer Shootout demo. Everything was working fine in editor but when I packaged game and played it I am unable to host (and presumably join) a session on same device or a LAN connected device.

I discovered recently that version 4.9.2 had a bug with networking code. I hoped that upgrading to 4.10 and removing Saved and Intermediate folders to regenerate project files might work but it did not.

I would just like to know if there is any way to fix issue other than restarting whole project on 4.10?

Thanks!

Hi Stevo,

What bug are you referring to in 4.9.2 with networking? Can you provide logs from 4.9 or 4.10 packaged project for both Client and Server?

Hi ,

I’m not sure what bug is specifically but it affects ability for a packaged game to create and join online sessions. I am using built in networking support (OnlineSubsystem) and try to create a LAN multiplayer game.

I will be happy to provide logs if you can help me to find them.

I should also have added that I think it might be related to whether or not project has any C++ or if it is built entirely in Blueprints. I’ve been trying today to build projects with and without C++ on version 4.10.1 and one with C++ fails at networking stuff, while one with no C++ works fine.

When I added a single C++ class to Blueprint only project it also began to fail when trying to create a LAN session.

Did you read about this bug somewhere, or is it just something you experienced? I’m just trying to determine if this is a known issue we’re already investigating and you saw a related AnswerHub post on it.

logs will be in packaged game’s folder, in the \Saved\Logs folder. If you up that folder and attach it here, I can take a look.

If you can give me specific steps to recreate problem in a new project, that would be very helpful as well. Thank you.

EDIT: note that there will only be logs for packaged game in a Development package, not Shipping.

one I was reading:

I think this has carried over into 4.10
I notice reading it again that it’s PiE which I assume is play in editor. My issue only occurs with a packaged build. It’s set to package as a “Development” build. I don’t know if I’ve packaged it wrong but I don’t have any logs in that folder after launching game.

Steps to reproduce in 4.10.1:
Build from FirstPersonTemplate.
Create two levels Menu and GameLevel.
Create FirstPersonPlayerController blueprint.
Create GameMode with that PlayerController set as default.
Override Menu level world settings with new GameMode.
Create GameInstance blueprint and set that to default in project settings.

In GameInstance built CustomEvent called “HostGame” with a PlayerController “in” parameter.
Connect CreateSession node, wire between CustomEvent PlayerController parameter and CreateSession node. Set CreateSession node to LAN enabled.
Connect Success node to OpenLevel and set LevelName to “GameLevel” and add the “listen” option to enable other players to connect.

In PlayerController create CustomEvent which runs on server. Get GameInstance and cast it to GameInstance blueprint you created. As GameInstance call “HostGame” and pass self as PlayerController.
Lastly use C key to call CustomEvent in PlayerController.

Build in development mode for Windows 64bit. Open game and press C key. Server should create a Session and load game level.

To break:
Add any C++ class to project and build it again. session should fail to create. For this I added a PlayerStart class and a UPROPERTY(EditAnywhere, Category=“Default”)
bool bTeamB;

Hopefully that will help you to reproduce bug/error/failure. I have not tried those exact steps in 4.9.2 but I’m guessing same behaviour will occur. Thanks for your help so far and if anything else is required let me know.

Hi Stevo,

This does appear to be related to adding C++ to a Blueprints project. I was able to reproduce Create Session failure after adding a blank C++ class to a project, and I’ve entered a bug report for issue (UE-24814). I’ll post here with any updates. Unfortunately for now you’ll need to start with a C++ project if you’re going to need to use code as well as Create Session node. Thanks for report!

Okay. I think I solved it. I’m kicking myself and you may wish to do same.

Essentially I hadn’t configured C++ part of project for Networking. This requires, so I’ve learned, that Build.cs file include these lines:

PublicDependencyModuleNames.AddRange(
         new string[] { 
                "Core", 
                "CoreUObject", 
                "Engine", 
                "InputCore", 
                "OnlineSubsystem", 
                "OnlineSubsystemUtils"
            }
        );

        DynamicallyLoadedModuleNames.AddRange(
            new string[] {
		"OnlineSubsystemNull"
	}
);

Adding references to OnlineSubsystem appears to have cleared up problem. I can now create, find and join networking games on my local area connection. I would like to ask that this be made clear somewhere on wiki or documentation as it took me a very long time to discover.

Thanks for all your help.