Hello!
I’m currently attempting to set up networking in Unreal Engine 4. Right now, I have a button to create a session using LAN (which works fine). Then, I have a timer set up to try and find sessions (also using LAN) every half second. However, find sessions fails every time, with or without me running a session. Here’s my steps that I’ve been using to test:
- Start game
- Click the “Start Server” button: it prints out the text saying that the session has been started.
- Read the text being printed to the screen: it prints the text that is sent out on failure.
This is my blueprint for creating the session: I know that this (supposedly) succeeds because the “On Success” print string is fired.
This is my blueprint for finding the session: I know this fails because the print string under the “On Failure” pin is fired.
I have attempted many variations on both DefaultEngine.ini and Gravity.Build.cs, but nothing has worked. Here are those files.
// Gravity.Build.cs
using UnrealBuildTool;
public class Gravity : ModuleRules
{
public Gravity(TargetInfo Target)
{
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
PrivateDependencyModuleNames.AddRange(new string[] { });
// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
// Uncomment if you are using online features
PrivateDependencyModuleNames.Add("OnlineSubsystem");
PrivateDependencyModuleNames.Add("OnlineSubsystemNull");
if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
{
if (UEBuildConfiguration.bCompileSteamOSS == true)
{
DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
}
}
}
}
[placeholder text, to split the two code files… ]
// My WHOLE DefaultEngine.ini, because I'm not sure if I messed something up.
[URL]
[/Script/Engine.UserInterfaceSettings]
RenderFocusRule=NavigationOnly
DefaultCursor=None
TextEditBeamCursor=None
CrosshairsCursor=None
GrabHandCursor=None
GrabHandClosedCursor=None
SlashedCircleCursor=None
UIScaleRule=ShortestSide
UIScaleCurve=(EditorCurveData=(Keys=((Time=480.000000,Value=0.444000),(Time=720.000000,Value=0.666000),(Time=1080.000000,Value=1.000000),(Time=8640.000000,Value=8.000000))),ExternalCurve=None)
[/Script/Engine.RendererSettings]
r.MobileHDR=True
r.AllowOcclusionQueries=True
r.MinScreenRadiusForLights=0.030000
r.MinScreenRadiusForDepthPrepass=0.030000
r.PrecomputedVisibilityWarning=False
r.TextureStreaming=True
Compat.UseDXT5NormalMaps=False
r.AllowStaticLighting=True
r.NormalMapsForStaticLighting=False
r.GBuffer=True
r.GenerateMeshDistanceFields=False
r.Shadow.DistanceFieldPenumbraSize=0.050000
r.TessellationAdaptivePixelsPerTriangle=48.000000
r.SeparateTranslucency=True
r.TranslucentSortPolicy=0
TranslucentSortAxis=(X=0.000000,Y=-1.000000,Z=0.000000)
r.CustomDepth=1
r.DefaultFeature.Bloom=True
r.DefaultFeature.AmbientOcclusion=True
r.DefaultFeature.AmbientOcclusionStaticFraction=True
r.DefaultFeature.AutoExposure=True
r.DefaultFeature.MotionBlur=True
r.DefaultFeature.LensFlare=True
r.DefaultFeature.AntiAliasing=2
r.EarlyZPass=3
r.EarlyZPassMovable=False
r.DBuffer=False
r.ClearSceneMethod=1
r.WireframeCullThreshold=5.000000
UIScaleRule=ShortestSide
UIScaleCurve=(EditorCurveData=(Keys=),ExternalCurve=None)
[/Script/HardwareTargeting.HardwareTargetingSettings]
TargetedHardwareClass=Desktop
AppliedTargetedHardwareClass=Desktop
DefaultGraphicsPerformance=Maximum
AppliedDefaultGraphicsPerformance=Maximum
[OnlineSubsystem]
DefaultPlatformService=Null
PollingIntervalInMs=20
[/Script/OnlineSubsystemUtils.IpNetDriver]
InitialConnectTimeout=120.0
[/Script/Engine.GameEngine]
NetDriverDefinitions=ClearArray
;+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
;+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[/Script/EngineSettings.GameMapsSettings]
EditorStartupMap=/Game/Gravity/Levels/StartScreen
LocalMapOptions=
TransitionMap=
bUseSplitscreen=True
TwoPlayerSplitscreenLayout=Horizontal
ThreePlayerSplitscreenLayout=FavorTop
GameInstanceClass=/Script/Engine.GameInstance
GameDefaultMap=/Game/Gravity/Levels/StartScreen
ServerDefaultMap=/Engine/Maps/Entry
GlobalDefaultGameMode=/Script/Engine.GameMode
GlobalDefaultServerGameMode=None
I’ve tried many variations on all of these files, but nothing has really worked… I’ve probably been missing something obvious, but I’m not the most adept at networking… also, I’m not going to deal with Steam or other services right now, because I’m just attempting to get basic local multiplayer working. Don’t know where to go from here… thanks!