UE development problem notes and data collection

UE开发的问题笔记和资料辑录

In daily development and learning, I have encountered and resolved some issues and collected some materials, which I have casually written down in notes. I have accumulated a fair amount related to UE, while other topics are mixed together and relatively chaotic. I have organized them into this article. Unlike the UE4 and VR Development Technical Notes, the content here is more focused on actual problem records and material collection within projects.

UE4 Error: The game module ‘xxx’ could not be loaded.

If the project shows the following error when starting:

1
The game module 'WebBrowserEx' could not be loaded. There may be an operating system error or the module may not be properly set up.

One of the reasons for this issue is that this module references an external Plugin, and you need to add the Plugins dependency item in this module’s uplugin file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.0",
"FriendlyName": "PluginA",
"Description": "",
"Category": "Other",
"CreatedBy": "",
"CreatedByURL": "",
"DocsURL": "",
"MarketplaceURL": "",
"SupportURL": "",
"CanContainContent": true,
"IsBetaVersion": false,
"Installed": false,
"Modules": [
{
"Name": "PluginA",
"Type": "Developer",
"LoadingPhase": "Default"
}
],
"Plugins": [
{
"Name": "PluginB",
"Enabled": true
}
]
}

UE4 Error: must include the same precompiled header first.

If such an error occurs during compilation:

1
2
3
4
5
6
7
8
9
10
11
12
1>------ Build started: Project: NetExampleDemo, Configuration: Development_Game x64 ------
1>Performing full C++ include scan (building a new target)
1>Creating makefile for NetExampleDemo (changes to module files)
1>EXEC : error : All source files in module "WebBrowserEx" must include the same precompiled header first. Currently "C:\Users\visionsmile\Documents\Unreal Projects\Examples\NetExampleDemo\Plugins\WebBrowserEx\Source\WebBrowserEx\Public\WebBrowserEx.h" is included by most of the source files. The following source files are not including "C:\Users\visionsmile\Documents\Unreal Projects\Examples\NetExampleDemo\Plugins\WebBrowserEx\Source\WebBrowserEx\Public\WebBrowserEx.h" as their first include:
1>
1> C:\Users\visionsmile\Documents\Unreal Projects\Examples\NetExampleDemo\Plugins\WebBrowserEx\Source\WebBrowserEx\Private\WebBrowserExWidget.cpp (including C:\Users\visionsmile\Documents\Unreal Projects\Examples\NetExampleDemo\Plugins\WebBrowserEx\Source\WebBrowserEx\Public\WebBrowserExWidget.h)
1>
1>
1> To compile this module without implicit precompiled headers, add "PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;" to WebBrowserEx.build.cs.
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: The command ""C:\Program Files\Epic Games\UE_4.18\Engine\Build\BatchFiles\Build.bat" NetExampleDemo Win64 Development "C:\Users\visionsmile\Documents\Unreal Projects\Examples\NetExampleDemo\NetExampleDemo.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.
1>Done building project "NetExampleDemo.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

You need to add:

1
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

UE4: UWebBrowser supports Chinese input

The UWebBrowser in UE does not support Chinese input by default. You can enable it using the following method. Inherit from UWebBrowser and override RebuildWidget, adding the following code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
TSharedRef<SWidget> UWebBrowserExWidget::RebuildWidget()
{
if (IsDesignTime())
{
return SNew(SBox)
.HAlign(HAlign_Center)
.VAlign(VAlign_Center)
[
SNew(STextBlock)
.Text(LOCTEXT("Web Browser", "Web Browser"))
];
}
else
{
WebBrowserWidget = SNew(SWebBrowser)
.InitialURL(InitialURL)
.ShowControls(false)
.SupportsTransparency(bSupportsTransparency)
.OnUrlChanged(BIND_UOBJECT_DELEGATE(FOnTextChanged, HandleOnUrlChanged));
// support chinese input
if (WebBrowserWidget.IsValid())
{
class ITextInputMethodSystem* const TextInputMethodSystem = FSlateApplication::Get().GetTextInputMethodSystem();
WebBrowserWidget->BindInputMethodSystem(TextInputMethodSystem);
}

return WebBrowserWidget.ToSharedRef();
}

}

I have made it a separate plugin. The GitHub address is: hxhb/WebBrowserEx418.

UE4: UnrealBuildTool Dependency Warning

1
UnrealBuildTool: Warning: Plugin 'A' does not list plugin 'B' as a dependency, but module 'A' depends on 'B'

Add the Plugins item in the .uplugin file of Plugin A:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.0",
"FriendlyName": "PluginA",
"Description": "",
"Category": "Other",
"CreatedBy": "",
"CreatedByURL": "",
"DocsURL": "",
"MarketplaceURL": "",
"SupportURL": "",
"CanContainContent": true,
"IsBetaVersion": false,
"Installed": false,
"Modules": [
{
"Name": "PluginA",
"Type": "Developer",
"LoadingPhase": "Default"
}
],
"Plugins": [
{
"Name": "PluginB",
"Enabled": true
}
]
}

UE4: Instanced Stereo Rendering

Instance Stereo Rendering was introduced in UE4.11, its principle is to draw both eyes with a single draw call, thereby shortening the render thread’s time and enhancing GPU performance.

To enable it (ProjectSetting-Engine-Rendering):

UE4: HandleNetworkFailure

When there is a network error in UE, UEngine::HandleNetworkFailure is called to receive error messages and handle errors. The error type is enumerated as ENetworkFailure::Type, indicating several types of network errors. Taking the server rejecting a player’s join request as an example, in this networking architecture of UE, the way to create/join a game is by using CreateSession/JoinSession, and players can be rejected by AGameModeBase::Prelogin, with the method being that returning an ErrorMessage that is not empty indicates rejection:

1
2
3
4
5
6
7
8
9
10
/**
* Accept or reject a player attempting to join the server. Fails login if you set the ErrorMessage to a non-empty string.
* PreLogin is called before Login. Significant game time may pass before Login is called
*
* @param Options The URL options (e.g. name/spectator) the player has passed
* @param Address The network address of the player
* @param UniqueId The unique id the player has passed to the server
* @param ErrorMessage When set to a non-empty value, the player will be rejected using the error message set
*/
virtual void PreLogin(const FString& Options, const FString& Address, const FUniqueNetIdRepl& UniqueId, FString& ErrorMessage);

The call stack for GameMode’s PreLogin is:

When a player is rejected from joining the game, the server sends an error message to the currently connected client:

1
2
3
// call in server send to client
// function is UWorld::NotifyControlMessage
FNetControlMessage<NMT_Failure>::Send(Connection, ErrorMsg);

PS: The implementation of FNetControlMessage<T>::Send is wrapped by the macro DEFINE_CONTROL_CHANNEL_MESSAGE_ONEPARAM, defined in the file DataChannel.h. This message is sent to the client, which handles the error through UEngine::HandleNetworkError, and it notifies UGameInstance::HandleNetworkError, but does not pass the ErrorMessage to GameInstance. We can override UGameEngine to pass the ErrorMessage to the outside.

PS: After players are rejected, they will return to the Game Default Map in the project settings.

UGameInstance::HandleNetworkError

This function is called when a network link error occurs (and it will also be called when the server rejects a player’s join request).

The call stack (you can inherit UEngine to replace the Engine implementation) is:

1
UEngine::HandleNetworkError -> UEngine::HandleNetworkFailure_NotifyGameInstance -> GameInstance->HandleNetworkError(FailureType, bIsServer);

VS breakpoint call stack:

The implementation of UEngine::HandleNetworkFailure is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Runtime\Source\Runtime\Engine\Private\UnrealEngine.cpp
void UEngine::HandleNetworkFailure(UWorld *World, UNetDriver *NetDriver, ENetworkFailure::Type FailureType, const FString& ErrorString)
{
UE_LOG(LogNet, Log, TEXT("NetworkFailure: %s, Error: '%s'"), ENetworkFailure::ToString(FailureType), *ErrorString);

if (!NetDriver)
{
return;
}

// Only handle failure at this level for game or pending net drivers.
FName NetDriverName = NetDriver->NetDriverName;
if (NetDriverName == NAME_GameNetDriver || NetDriverName == NAME_PendingNetDriver)
{
// If this net driver has already been unregistered with this world, then don't handle it.
if (World)
{
if (!FindNamedNetDriver(World, NetDriverName))
{
// This netdriver has already been destroyed (probably waiting for GC)
return;
}
}

// Give the GameInstance a chance to handle the failure.
HandleNetworkFailure_NotifyGameInstance(World, NetDriver, FailureType);

ENetMode FailureNetMode = NetDriver->GetNetMode(); // NetMode of the driver that failed
bool bShouldTravel = true;

switch (FailureType)
{
case ENetworkFailure::FailureReceived:
break;
case ENetworkFailure::PendingConnectionFailure:
// TODO stop the connecting movie
break;
case ENetworkFailure::ConnectionLost:
// Hosts don't travel when clients disconnect
bShouldTravel = (FailureNetMode == NM_Client);
break;
case ENetworkFailure::ConnectionTimeout:
// Hosts don't travel when clients disconnect
bShouldTravel = (FailureNetMode == NM_Client);
break;
case ENetworkFailure::NetGuidMismatch:
case ENetworkFailure::NetChecksumMismatch:
// Hosts don't travel when clients have actor issues
bShouldTravel = (FailureNetMode == NM_Client);
break;
case ENetworkFailure::NetDriverAlreadyExists:
case ENetworkFailure::NetDriverCreateFailure:
case ENetworkFailure::OutdatedClient:
case ENetworkFailure::OutdatedServer:
default:
break;
}

if (bShouldTravel)
{
CallHandleDisconnectForFailure(World, NetDriver);
}
}
}

void UEngine::HandleNetworkFailure_NotifyGameInstance(UWorld *World, UNetDriver *NetDriver, ENetworkFailure::Type FailureType)
{
bool bIsServer = true;

if (NetDriver != nullptr)
{
bIsServer = NetDriver->GetNetMode() != NM_Client;
}

if (World != nullptr && World->GetGameInstance() != nullptr)
{
World->GetGameInstance()->HandleNetworkError(FailureType, bIsServer);
}
else
{
// Since the UWorld passed in might be null, as well as the NetDriver's UWorld,
// go through the world contexts until we find the one with this net driver.
for (auto& Context : WorldList)
{
if (Context.PendingNetGame != nullptr &&
Context.PendingNetGame->NetDriver == NetDriver &&
Context.OwningGameInstance != nullptr)
{
// Use the GameInstance from the current context.
Context.OwningGameInstance->HandleNetworkError(FailureType, bIsServer);
}
}
}
}

The definition of ENetworkFailure:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Runtime\Engine\Classes\Engine\EngineBaseType.h
/** Types of network failures broadcast from the engine */
UENUM(BlueprintType)
namespace ENetworkFailure
{
enum Type
{
/** A relevant net driver has already been created for this service */
NetDriverAlreadyExists,
/** The net driver creation failed */
NetDriverCreateFailure,
/** The net driver failed its Listen() call */
ConnectionLost,
/** A connection to the net driver has timed out */
ConnectionTimeout,
/** The net driver received an NMT_Failure message */
FailureReceived,
/** The client needs to upgrade their game */
OutdatedClient,
/** The server needs to upgrade their game */
OutdatedServer,
/** There was an error during connection to the game */
PendingConnectionFailure,
/** NetGuid mismatch */
NetGuidMismatch,
/** Network checksum mismatch */
NetChecksumMismatch
};
}

UE4: Max Agent

The number of AI supported by UE is configured in Project Settings-Engine-Crowd Manager-Config-Max Agents, which defaults to 50. I thought the issue in the project was logical but didn’t expect such a configuration to exist.

MakeRotFromXY

The purpose of the MakeRotFrom** functions declared in UKismetMathSystem is to pass an axis (XY/YZ/YX, etc.) and then calculate the rotation from the default axis (0,0,0) to that axis.

UE4 Error: C1853 precompiled header file

The following error occurred when compiling the engine:

1
fatal error C1853: 'C:\Program Files\Epic Games\UE_4.19\Engine\Intermediate\Build\Win64\UE4Editor\Development\Engine\SharedPCH.Engine.h.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa)

Solution: Delete the folder generated under Engine\Intermediate\Build\Win64 for that module and recompile.

UE4 Error: C4577: ‘noexcept’ used

I encountered an error when compiling UE 4.18.3 with VS2017:

1
error C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc

This error arises from attempting to use exceptions, as UE4 does not allow exceptions by default, leading to this error. The solution is to add:

1
bEnableExceptions = true;

to the build.cs of the module that reported the error, then recompile.

UE4 Error: error : ‘’: Bad command or expression

Check the encoding format of the reported file:

Change it to UTF-8:

UE4: Break a C++ Struct in BP

To create a USTRUCT structure in C++, and be able to Break/Make in Blueprints, the following operations are required:

  1. Mark the USTRUCT as BlueprintType.
  2. Add BlueprintReadWrite to the UPROPERTY of member variables (EditAnyWhere does not control whether it can be Broken).

UE4 Error: C4700: uninitialized local variable ‘Parms’ used

Returning a custom structure type in an unimplemented interface produces the following error:

1
inetplayerstate.gen.cpp(36): error C4700: uninitialized local variable 'Parms' used

The code is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// struct declare
#pragma once
#include "CoreMinimal.h"
#include "FClampData.generated.h"

USTRUCT(BlueprintType)
struct FClampData
{
GENERATED_USTRUCT_BODY()

UPROPERTY(BlueprintReadWrite)
bool bUseClamp;
UPROPERTY(BlueprintReadWrite)
int iMin;
UPROPERTY(BlueprintReadWrite)
int iMax;
};

The interface used:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once
#include "Data/Struct/FClampData.h"
#include "CoreMinimal.h"
#include "INetPlayerState.generated.h"

// This class does not need to be modified.
UINTERFACE(BlueprintType, MinimalAPI)
class UINetPlayerState : public UInterface
{
GENERATED_BODY()
};

class SANGUOWARRIORS_API IINetPlayerState
{
GENERATED_BODY()

// Add interface functions to this class. This is the class that will be inherited to implement this interface.
public:
// ...
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
FClampData GetAssetClampData()const;
};

The error location in inetplayerstate.gen.cpp is:

1
2
3
4
5
6
FClampData IINetPlayerState::GetAssetClampData() const
{
check(0 && "Do not directly call Event functions in Interfaces. Call Execute_GetAssetClampData instead.");
INetPlayerState_eventGetAssetClampData_Parms Parms;
return Parms.ReturnValue;
}

The definition of INetPlayerState_eventGetAssetClampData_Parms wraps the return value structure:

1
2
3
4
5
#define SanguoWarriors_Source_SanguoWarriors_Public_Interface_GameFramework_INetPlayerState_h_15_EVENT_PARMS \
struct INetPlayerState_eventGetAssetClampData_Parms \
{ \
FClampData ReturnValue; \
};

According to previous articles: Some Misunderstandings about Compiler-Generated Default Constructors, if our structure FClampData does not provide a default constructor, then the structure INetPlayerState_eventGetAssetClampData_Parms will also not generate a default constructor, hence its object will not be initialized. Therefore, to solve this problem, we can define a default constructor for our defined USTRUCT:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma once
#include "CoreMinimal.h"
#include "FClampData.generated.h"

USTRUCT(BlueprintType)
struct FClampData
{
GENERATED_USTRUCT_BODY()
FORCEINLINE FClampData():bUseClamp(false),iMin(0),iMax(0){};
UPROPERTY(BlueprintReadWrite)
bool bUseClamp;
UPROPERTY(BlueprintReadWrite)
int iMin;
UPROPERTY(BlueprintReadWrite)
int iMax;
};

Another, simpler method is to use reference parameters for the interface’s return value (the exposed & parameter in Blueprint nodes will be on the right, const& on the left), but for C++ calls, a real argument must be passed:

1
2
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
void GetAssetClampData(FClampData& rData)const;

References are inherently implemented as pointers.

UE4: GetPlayerController

The Player in UE is centered around PlayerController, and PlayerCharacter/PlayerPawn/PlayerCameraManager are all retrieved from PlayerController.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// GameplayStatics.cpp
class APlayerController* UGameplayStatics::GetPlayerController(const UObject* WorldContextObject, int32 PlayerIndex )
{
if (UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull))
{
uint32 Index = 0;
for (FConstPlayerControllerIterator Iterator = World->GetPlayerControllerIterator(); Iterator; ++Iterator)
{
APlayerController* PlayerController = Iterator->Get();
if (Index == PlayerIndex)
{
return PlayerController;
}
Index++;
}
}
return nullptr;
}

ACharacter* UGameplayStatics::GetPlayerCharacter(const UObject* WorldContextObject, int32 PlayerIndex)
{
APlayerController* PC = GetPlayerController(WorldContextObject, PlayerIndex);
return PC ? Cast<ACharacter>(PC->GetPawn()) : nullptr;
}

APawn* UGameplayStatics::GetPlayerPawn(const UObject* WorldContextObject, int32 PlayerIndex)
{
APlayerController* PC = GetPlayerController(WorldContextObject, PlayerIndex);
return PC ? PC->GetPawnOrSpectator() : nullptr;
}

APlayerCameraManager* UGameplayStatics::GetPlayerCameraManager(const UObject* WorldContextObject, int32 PlayerIndex)
{
APlayerController* const PC = GetPlayerController(WorldContextObject, PlayerIndex);
return PC ? PC->PlayerCameraManager : nullptr;
}

UE: Editor crashes on exit in Online Mode

In the editor, when simulating online, the engine crashes upon exit. The log is as follows:

1
[2019.04.30-06.43.04:039][512]LogPlayLevel: Error: No PIE world was found when attempting to gather references after GC.

This happens because an RPC event was invoked in the level blueprint. Removing it will solve the issue.

UE4: AI culled when not in player’s view in online game

In online games, if monsters are out of the player’s view, they will be culled, and their collision events will not be triggered. The solution is to change the SkeletonMeshComponent’s update skeleton configuration to always so that they will not be culled.

UE: Error for not including CoreUObject.h

Relevant link: How to modify these errors in plugin? thanks

UE: C4668 Error ‘’ is not defined as a preprocessor macro

If such an error appears in UE:

1
error C4668: '__GUNC__' is not defined as a preprocessor macro, replicing with '0' for '#if/#elif'

The solution is to add bEnableUndefinedIdentifierWarnings=false; in the *.Build.cs file (default is true).
In the UBT code:

1
2
3
// Source\Programs\UnrealBuildTool\Configuration\ModuleRules.cs
// Enable warnings for using undefined identifiers in #if expressions
public bool bEnableUndefinedIdentifierWarnings = true;

This controls whether /we4668 is added to the compilation parameters:

1
2
3
4
5
6
7
8
9
10
11
12
// Source\Programs\UnrealBuildTool\Platform\Windows\VCToolChain.cs
if(WindowsPlatform.bUseVCCompilerArgs && CompileEnvironment.bEnableUndefinedIdentifierWarnings)
{
if (CompileEnvironment.bUndefinedIdentifierWarningsAsErrors)
{
Arguments.Add("/we4668");
}
else
{
Arguments.Add("/w44668");
}
}

UE: Detach Error in Net

In recent days, a colleague encountered a synchronization issue: the client grabs an item, uses AttachToComponent to hold it, and uses DetachFromComponent to release it when discarding. It works perfectly in single-player mode, but there’s an issue in network synchronization (UE’s network architecture) as follows (for testing, I wrote a very simple example, using the most basic C/S architecture, completely handled by the server (the client only initiates RPC calls and receives variable synchronization)):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
LogOutputDevice: Error: === Handled ensure: ===
LogOutputDevice: Error: Ensure condition failed: !bRegistered || GetAttachParent()->GetAttachChildren().Contains(this) [File:D:\Build\++UE4+Release-4.18+Compile\Sync\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp] [Line: 2001]
LogOutputDevice: Error: Attempt to detach SceneComponent 'Cube' owned by 'Weapon_C_0' from AttachParent 'Scene' while not attached.
LogOutputDevice: Error: Stack:
LogOutputDevice: Error: [Callstack] 0x0000000006FB2786 UE4Editor-Core.dll!FWindowsPlatformStackWalk::StackWalkAndDump() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\windows\windowsplatformstackwalk.cpp:200]
LogOutputDevice: Error: [Callstack] 0x0000000006D5123A UE4Editor-Core.dll!FDebug::EnsureFailed() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:298]
LogOutputDevice: Error: [Callstack] 0x0000000006D6B906 UE4Editor-Core.dll!FDebug::OptionallyLogFormattedEnsureMessageReturningFalse() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:425]
LogOutputDevice: Error: [Callstack] 0x00000000DCB09BCF UE4Editor-Engine.dll!USceneComponent::DetachFromComponent() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\components\scenecomponent.cpp:2001]
LogOutputDevice: Error: [Callstack] 0x00000000DCB20A19 UE4Editor-Engine.dll!USceneComponent::K2_DetachFromComponent() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\components\scenecomponent.cpp:1987]
LogOutputDevice: Error: [Callstack] 0x00000000DC5615D0 UE4Editor-Engine.dll!USceneComponent::execK2_DetachFromComponent() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\classes\components\scenecomponent.h:105]
LogOutputDevice: Error: [Callstack] 0x0000000006695264 UE4Editor-CoreUObject.dll!UFunction::Invoke() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:4542]
LogOutputDevice: Error: [Callstack] 0x0000000006859B74 UE4Editor-CoreUObject.dll!UObject::CallFunction() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:732]
LogOutputDevice: Error: [Callstack] 0x000000000686FA41 UE4Editor-CoreUObject.dll!UObject::ProcessContextOpcode() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:2167]
LogOutputDevice: Error: [Callstack] 0x0000000006871B72 UE4Editor-CoreUObject.dll!UObject::ProcessInternal() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:954]
LogOutputDevice: Error: [Callstack] 0x0000000006695264 UE4Editor-CoreUObject.dll!UFunction::Invoke() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:4542]
LogOutputDevice: Error: [Callstack] 0x0000000006870F66 UE4Editor-CoreUObject.dll!UObject::ProcessEvent() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1314]
LogOutputDevice: Error: [Callstack] 0x00000000DC61E64B UE4Editor-Engine.dll!AActor::ProcessEvent() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\actor.cpp:693]
LogOutputDevice: Error: [Callstack] 0x00000000DD35AEDF UE4Editor-Engine.dll!FRepLayout::CallRepNotifies() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\replayout.cpp:2407]
LogOutputDevice: Error: [Callstack] 0x00000000DCBBE6AB UE4Editor-Engine.dll!FObjectReplicator::CallRepNotifies() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\datareplication.cpp:1474]
LogOutputDevice: Error: [Callstack] 0x00000000DCBE84BF UE4Editor-Engine.dll!FObjectReplicator::PostReceivedBunch() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\datareplication.cpp:1032]
LogOutputDevice: Error: [Callstack] 0x00000000DCBEB549 UE4Editor-Engine.dll!UActorChannel::ProcessBunch() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\datachannel.cpp:2297]
LogOutputDevice: Error: [Callstack] 0x00000000DCBF902C UE4Editor-Engine.dll!UActorChannel::ReceivedBunch() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\datachannel.cpp:2139]
LogOutputDevice: Error: [Callstack] 0x00000000DCBFD75C UE4Editor-Engine.dll!UChannel::ReceivedSequencedBunch() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\datachannel.cpp:296]
LogOutputDevice: Error: [Callstack] 0x00000000DCBFC6AE UE4Editor-Engine.dll!UChannel::ReceivedNextBunch() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\datachannel.cpp:665]
LogOutputDevice: Error: [Callstack] 0x00000000DCBFD4C5 UE4Editor-Engine.dll!UChannel::ReceivedRawBunch() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\datachannel.cpp:388]
LogOutputDevice: Error: [Callstack] 0x00000000DD0E23A6 UE4Editor-Engine.dll!UNetConnection::ReceivedPacket() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\netconnection.cpp:1319]
LogOutputDevice: Error: [Callstack] 0x00000000DD0E3602 UE4Editor-Engine.dll!UNetConnection::ReceivedRawPacket() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\netconnection.cpp:728]
LogOutputDevice: Error: [Callstack] 0x00000000D6F1A2E3 UE4Editor-OnlineSubsystemUtils.dll!UIpNetDriver::TickDispatch() [d:\build\++ue4+release-4.18+compile\sync\engine\plugins\online\onlinesubsystemutils\source\onlinesubsystemutils\private\ipnetdriver.cpp:232]
LogOutputDevice: Error: [Callstack] 0x00000000DD0C065F UE4Editor-Engine.dll!TBaseUObjectMethodDelegateInstance<0,UNetDriver,void __cdecl(float)>::ExecuteIfSafe() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:858]
LogOutputDevice: Error: [Callstack] 0x00000000DC51CF78 UE4Editor-Engine.dll!TBaseMulticastDelegate<void,float>::Broadcast() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:937]
LogOutputDevice: Error: [Callstack] 0x00000000DCF653F8 UE4Editor-Engine.dll!UWorld::Tick() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\leveltick.cpp:1296]
LogOutputDevice: Error: [Callstack] 0x00000000FE7D6BA6 UE4Editor-UnrealEd.dll!UEditorEngine::Tick() [d:\build\++ue4+release-4.18+compile\sync\engine\source\editor\unrealed\private\editorengine.cpp:1659]
LogOutputDevice: Error: [Callstack] 0x00000000FF084AC6 UE4Editor-UnrealEd.dll!UUnrealEdEngine::Tick() [d:\build\++ue4+release-4.18+compile\sync\engine\source\editor\unrealed\private\unrealedengine.cpp:396]
LogOutputDevice: Error: [Callstack] 0x0000000035025A26 UE4Editor.exe!FEngineLoop::Tick() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3296]
LogOutputDevice: Error: [Callstack] 0x0000000035035430 UE4Editor.exe!GuardedMain() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\launch.cpp:166]
LogOutputDevice: Error: [Callstack] 0x00000000350354AA UE4Editor.exe!GuardedMainWrapper() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
LogOutputDevice: Error: [Callstack] 0x0000000035042379 UE4Editor.exe!WinMain() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
LogOutputDevice: Error: [Callstack] 0x0000000035043D57 UE4Editor.exe!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
LogOutputDevice: Error: [Callstack] 0x0000000045863DC4 KERNEL32.DLL!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x0000000045D63691 ntdll.dll!UnknownFunction []

This is due to the Attach component itself and the Attach Parent‘s Component Replication being set, and detaching in the variable synchronization event OnRep_ received from the server will trigger this. Essentially, this issue can be summarized in one sentence: Detaching itself from the AttachParent will check if it exists in the AttachChildren list of the parent being detached. The assertion is triggered because its parent exists (Parent != nullptr), but the parent object’s AttachChildren does not include itself. In C/S architecture, the client should primarily handle presentation, not logic. The above issue arises from the implementation thought under online mode, as UE’s Attach and Detach are synchronized. I’ll analyze this issue from the code later.

UE Package: Couldn’t save package, filename is too long

When packing, this error occurs because the absolute path length of certain resources on Windows exceeds 260 characters, which is an NTFS limitation. Therefore, moving the project path to the root directory of the disk or reducing the directory levels will help. The relevant code in the engine is:

1
2
3
4
5
6
7
8
9
10
11
// Source/Editor/UnrealEd/Private/CookOnTheFlyServer.cpp(UE4.18.3)
// need to subtract 32 because the SavePackage code creates temporary files with longer file names then the one we provide
// projects may ignore this restriction if desired
const int32 CompressedPackageFileLengthRequirement = bConsiderCompressedPackageFileLengthRequirements ? 32 : 0;
const FString FullFilename = FPaths::ConvertRelativePathToFull(PlatFilename);
if (FullFilename.Len() >= (PLATFORM_MAX_FILEPATH_LENGTH - CompressedPackageFileLengthRequirement))
{
LogCookerMessage(FString::Printf(TEXT("Couldn't save package, filename is too long: %s"), *PlatFilename), EMessageSeverity::Error);
UE_LOG(LogCook, Error, TEXT("Couldn't save package, filename is too long :%s"), *PlatFilename);
Result = ESavePackageResult::Error;
}

The PLATFORM_MAX_FILEPATH_LENGTH is defined under Runtime/Core/Public for each platform. For Windows, another macro WINDOWS_MAX_PATH is used:

1
2
3
4
5
6
D:\UnrealEngine\Offical_Source\4.18\Engine\Source\Runtime\Core\Public\Windows\WIndowsPlatform.h:
57 #define PLATFORM_HAS_BSD_TIME 0
58 #define PLATFORM_USE_PTHREADS 0
59: #define PLATFORM_MAX_FILEPATH_LENGTH WINDOWS_MAX_PATH
60 #define PLATFORM_HAS_BSD_SOCKET_FEATURE_WINSOCKETS 1
61 #define PLATFORM_USES_MICROSOFT_LIBC_FUNCTIONS 1

The WINDOWS_MAX_PATH macro is defined in Runtime/Core/Private/Windows/MinimalWindowsApi.h:

1
#define WINDOWS_MAX_PATH 260

Clearly, UE does not use Windows’ MAX_PATH macro, hardcoding it to 260, meaning the maximum file path length on Windows in UE is 260 characters (32 characters must be subtracted if bConsiderCompressedPackageFileLengthRequirements is enabled). Although Windows 10 aims to [remove the 260 character limit](Microsoft removes 260 character limit for NTFS Path in new Windows 10 Insider Preview), the engine has already supported it, and (UE4.22 Released supported long file name features experimentally).

Import the following registry:

1
2
3
4
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"LongPathsEnabled"=dword:00000001

External reading:

UE Enable Multi-Sampling and Forward Rendering

ProjectSetting - Rendering - ForwardRenderer/DefaultSetting-Anti - Aliasing Method

UE4 Plugin: ModuleType (Required)

.uplugin Module Type Descriptors.

Sets the type of Module. Valid options are Runtime, RuntimeNoCommandlet, Developer, Editor, EditorNoCommandlet, and Program. This type determines which types of applications this Plugin’s Module is suitable for loading in. For example, some plugins may include modules that are only designed to be loaded when the editor is running. Runtime modules will be loaded in all cases, even in shipped games. Developer modules will only be loaded in development runtime or editor builds, but never in shipping builds. Editor modules will only be loaded when the editor is starting up. Your Plugin can use a combination of modules of different types.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Engine\Programs\UnrealBuildTool\System\ModuleDescriptor.cs
// The type of host that can load a module
public enum ModuleHostType
{
Default,

// Any target using the UE4 runtime
Runtime,

// Any target except for commandlet
RuntimeNoCommandlet,

// Any target or program
RuntimeAndProgram,

// Loaded only in cooked builds
CookedOnly,

// Loaded only when the engine has support for developer tools enabled
Developer,

// Loaded only by the editor
Editor,

// Loaded only by the editor, except when running commandlets
EditorNoCommandlet,

// Loaded only by programs
Program,

// Loaded only by servers
ServerOnly,

// Loaded only by clients
ClientOnly,
}

UE4 Plugin: LoadingPhase (Optional)

.uplugin Module LoadingPhase Descriptors.

If specified, controls when the plugin is loaded at start-up. This is an advanced option that should not normally be required. The valid options are Default (which is used when no LoadingPhase is specified), PreDefault, and PostConfigInit. PostConfigInit enables the module to be loaded before the engine has finished starting up key subsystems. PreDefault loads just before the normal phase. Typically, this is only needed if you expect game modules to depend directly on content within your plugin or types declared within the plugin’s code.

If no LoadingPhase item is specified in the .upugin, the default is Default:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Engine\Programs\UnrealBuildTool\System\ModuleDescriptor.cs
// Indicates when the engine should attempt to load this module
public enum ModuleLoadingPhase
{
/// Loaded at the default loading point during startup (during engine init, after game modules are loaded.)
Default,

// Right after the default phase
PostDefault,

// Right before the default phase
PreDefault,

// Loaded before the engine is fully initialized, immediately after the config system has been initialized. Necessary only for very low-level hooks
PostConfigInit,

// After PostConfigInit and before coreUobject initialized. used for early boot loading screens before the uobjects are initialized
PreEarlyLoadingScreen, // Since 4.20

// Loaded before the engine is fully initialized for modules that need to hook into the loading screen before it triggers
PreLoadingScreen,

// After the engine has been initialized
PostEngineInit,

// Do not automatically load this module
None,
}

The Difference Between GENERATED_BODY and GENERATED_UCLASS_BODY

GENERATED_BODY:

  • Does not include any access specifiers; class defaults to private; struct defaults to public.
  • Declares and defines a constructor that takes const FObjectInitializer&.

GENERATED_UCLASS_BODY:

  • Includes public access specifier.
  • Contains a declaration for a constructor with parameter const FObjectInitializer&, requiring a definition in the code.
1
2
3
4
5
6
7
8
9
10
11
12
// .h file
// ...
GENERATED_BODY()

public:
AFPSGameMode(const class FObjectInitializer& ObjectInitializer);

// .cpp file
AFPSGameMode::AFPSGameMode(const class FObjectInitializer& ObjectInitializer)
{
// constructor functionality
}

Reference link: GENERATED_BODY vs GENERATED_UCLASS_BODY

Extensibility in UE4

UE4 Slate UI Framework

Networking in UE4

UE4 Engine Overview

Epic’s Build Tools & Infrastructure

UHT Macro Definitions

The definitions for macros such as GENERATED_BODY, UPROPERTY, and UFUNCTION are found in:

1
Engine\Source\Runtime\CoreUObject\Public\UObject\ObjectMacros.h

UE Build: MakeShareable no matching

If we create a T C++ native pointer through MakeShareable to construct an FRawPtrProxy<T> and use it to construct a TSharedPtr<t>, we may sometimes see the following error:

1
2
3
4
Engine\Source\Programs\UE4Launcher\Source\Private\UI\WidgetUELauncher.cpp(620): error C2672: 'MakeShareable': no matching overloaded function found
Engine\Source\Programs\UE4Launcher\Source\Private\UI\WidgetUELauncher.cpp(620): error C2780: 'SharedPointerInternals::FRawPtrProxy<ObjectType> MakeShareable(ObjectType *,DeleterType &&)': expects 2 arguments - 1 provided
Engine\Source\Runtime\Core\Public\Templates/SharedPointer.h(1666): note: see declaration of 'MakeShareable'
Engine\Source\Programs\UE4Launcher\Source\Private\UI\WidgetUELauncher.cpp(620): error C2784: 'SharedPointerInternals::FRawPtrProxy<ObjectType> MakeShareable(ObjectType *)': could not deduce template argument for 'ObjectType *' from 'TSharedRef<ObjectType,0>'

This is because the destructor access of type T is set to protected, and these reference-counted smart pointers call the destructor when the count reaches 0, leading to a compilation error. If it’s necessary to create a TSharedPtr<T>, and T is a derived class of SWidget, you can make struct SharedPointerInternals::FRawPtrProxy<T> a friend (as Makeshareable() constructs this object):

1
2
// SEditableBoxWraper is a custom Widget derived by SWidget 
friend struct SharedPointerInternals::FRawPtrProxy<SEditableBoxWraper>;

UE Auto-Save Resources on Editor Compile

UE Run-time Dynamic Update Navigation

UE EditorModule Not Loading in Standalone

Note: If the Module Type is set to Editor, it will not load in Standalone. It may work well in editor mode, but have no effect when running Standalone. Newly created plugins should ideally be of Developer or Runtime type.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.0",
"FriendlyName": "TaskTools",
"Description": "",
"Category": "Other",
"CreatedBy": "",
"CreatedByURL": "",
"DocsURL": "",
"MarketplaceURL": "",
"SupportURL": "",
"CanContainContent": true,
"IsBetaVersion": false,
"Installed": false,
"Modules": [
{
"Name": "TaskTools",
"Type": "Developer",
"LoadingPhase": "Default"
}
]
}

UE Version Number Macro Definitions

Macros that tag the engine version in the engine:

  • ENGINE_MAJOR_VERSION
  • ENGINE_MINOR_VERSION
  • ENGINE_PATCH_VERSION

These are defined in Engine/Source/Runtime/Launch/Resources/Version.h:

1
2
3
4
5
// These numbers define the banner UE4 version, and are the most significant numbers when ordering two engine versions (that is, a 4.12.* version is always 
// newer than a 4.11.* version, regardless of the changelist that it was built with)
#define ENGINE_MAJOR_VERSION 4
#define ENGINE_MINOR_VERSION 19
#define ENGINE_PATCH_VERSION 0

The engine version information is also recorded in the Engine\Build\Build.version file:

1
2
3
4
5
6
7
8
9
10
{
"MajorVersion": 4,
"MinorVersion": 18,
"PatchVersion": 3,
"Changelist": 0,
"CompatibleChangelist": 3709383,
"IsLicenseeVersion": 0,
"IsPromotedBuild": 1,
"BranchName": ""
}

UE Blueprint Loop Iteration Maximum Count

The loop limit in UE blueprints needs to be set in ProjectSetting - Engine - Blueprints (default is 1000000):

UE: Primary Asset Id

First, add the resource path in Project Setting - Game - Asset Manager:

Then you can select it in the blueprint’s PrimaryAssetId:

UE Package Error: noexcept

If you encounter the following error during packaging:

1
C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc

Add the following in *.target.cs:

1
bForceEnableExceptions = true;

UE Package: Create Compressed Cooked Packages

Compress pak during packaging:

UE Package: Use Log in Shipping

In my previous article Macro defined by UBT in UE4#USE_LOGGING_IN_SHIPPING, I mentioned that you can use bUseLoggingInShipping in the Module’s *.target.cs to control whether logging is enabled for packages in Shipping mode.
Note: Currently, only supported in source version engines. If using the Engine installed via Launcher, it will report a linking error:

1
error LNK2001: unresolved external symbol "struct FLogCategoryLogSerialization LogSerialization" (?LogSerialization@@3UFLogCategoryLogSerialization@@A)

Additionally, if you encounter the following error:

1
C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc

Then add this in *.target.cs:

1
bForceEnableExceptions = true;

UE4 Package: LogLinker Error: xxxx has an inappropriate outermost

Encountered the following error during packaging:

1
2
3
4
5
UATHelper: Packaging (Windows (64-bit)):   LogLinker: Error: HOTRELOADED_INetGameMode_1 has an inappropriate outermost, it was probably saved with a deprecated outer (file: ../../../../../../SanguoWarriors/Content/CoreBP/GamePlayFramework/GameMode/Net_GameMode_VR_Ex.uasset)
UATHelper: Packaging (Windows (64-bit)): LogLinker: Error: HOTRELOADED_INetGameMode_1 has an inappropriate outermost, it was probably saved with a deprecated outer (file: ../../../../../../SanguoWarriors/Content/CoreBP/GamePlayFramework/GameMode/Net_GameMode_VR_Ex.uasset)
UATHelper: Packaging (Windows (64-bit)): LogLinker: Error: HOTRELOADED_INetGameMode_1 has an inappropriate outermost, it was probably saved with a deprecated outer (file: ../../../../../../SanguoWarriors/Content/CoreBP/GamePlayFramework/GameMode/Net_GameMode_VR_Ex.uasset)
UATHelper: Packaging (Windows (64-bit)): LogLinker: Error: HOTRELOADED_INetGameMode_1 has an inappropriate outermost, it was probably saved with a deprecated outer (file: ../../../../../../SanguoWarriors/Content/CoreBP/GamePlayFramework/GameMode/Net_GameMode_VR_Ex.uasset)
UATHelper: Packaging (Windows (64-bit)): LogLinker: Error: HOTRELOADED_INetGameMode_1 has an inappropriate outermost, it was probably saved with a deprecated outer (file: ../../../../../../SanguoWarriors/Content/CoreBP/GamePlayFramework/GameMode/Net_GameMode_VR_Ex.uasset)

This resource references some invalid resources:

The solution is to casually modify something in the blueprint, then click to save and compile. Finally, reopen its Reference Viewer to ensure that there are no invalid resources.

UE4 Package: FMemoryWriter does not support data larger than 2GB. Archive name: None.

This error occurred during packaging:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
UATHelper: Packaging (Windows (64-bit)):   LogWindows: Error: begin: stack for UAT
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: === Critical error: ===
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error:
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: Fatal error: [File:D:\Build\++UE4+Release-4.18+Compile\Sync\Engine\Source\Runtime\Core\Public\Serialization/MemoryWriter.h] [Line: 42]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: FMemoryWriter does not support data larger than 2GB. Archive name: None.
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error:
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error:
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000EB1AA388 KERNELBASE.dll!UnknownFunction []
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000D87676D4 UE4Editor-ApplicationCore.dll!FWindowsErrorOutputDevice::Serialize() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\applicationcore\private\windows\windowserroroutputdevice.cpp:65]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000C1BA330B UE4Editor-Core.dll!FOutputDevice::Logf__VA() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\misc\outputdevice.cpp:70]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000C1B347F9 UE4Editor-Core.dll!FDebug::AssertFailed() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:414]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000BD417374 UE4Editor-CoreUObject.dll!FMemoryWriter::Serialize() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\core\public\serialization\memorywriter.h:42]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000BD510857 UE4Editor-CoreUObject.dll!FUntypedBulkData::SerializeBulkData() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\serialization\bulkdata.cpp:1253]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000BD647A5C UE4Editor-CoreUObject.dll!UPackage::Save() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\coreuobject\private\uobject\savepackage.cpp:5122]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000B5F0EB8D UE4Editor-UnrealEd.dll!UEditorEngine::Save() [d:\build\++ue4+release-4.18+compile\sync\engine\source\editor\unrealed\private\editorengine.cpp:4220]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000B5DD112E UE4Editor-UnrealEd.dll!UCookOnTheFlyServer::SaveCookedPackage() [d:\build\++ue4+release-4.18+compile\sync\engine\source\editor\unrealed\private\cookontheflyserver.cpp:3229]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000B5DD2473 UE4Editor-UnrealEd.dll!UCookOnTheFlyServer::SaveCookedPackages() [d:\build\++ue4+release-4.18+compile\sync\engine\source\editor\unrealed\private\cookontheflyserver.cpp:2300]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000B5DDE3B7 UE4Editor-UnrealEd.dll!UCookOnTheFlyServer::TickCookOnTheSide() [d:\build\++ue4+release-4.18+compile\sync\engine\source\editor\unrealed\private\cookontheflyserver.cpp:1763]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000B5C77D61 UE4Editor-UnrealEd.dll!UCookCommandlet::CookByTheBook() [d:\build\++ue4+release-4.18+compile\sync\engine\source\editor\unrealed\private\commandlets\cookcommandlet.cpp:902]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000B5C9F391 UE4Editor-UnrealEd.dll!UCookCommandlet::Main() [d:\build\++ue4+release-4.18+compile\sync\engine\source\editor\unrealed\private\commandlets\cookcommandlet.cpp:583]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000C5E0D25F UE4Editor-Cmd.exe!FEngineLoop::PreInit() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2167]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000C5E0525A UE4Editor-Cmd.exe!GuardedMain() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\launch.cpp:127]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000C5E054AA UE4Editor-Cmd.exe!GuardedMainWrapper() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000C5E12379 UE4Editor-Cmd.exe!WinMain() [d:\build\++ue4+release-4.18+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000C5E13193 UE4Editor-Cmd.exe!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000EB954034 KERNEL32.DLL!UnknownFunction []
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000EE083691 ntdll.dll!UnknownFunction []
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00000000EE083691 ntdll.dll!UnknownFunction []
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error:
UATHelper: Packaging (Windows (64-bit)): LogWindows: Error: end: stack for UAT

This is because the baked lighting file for the scene exceeded 2GB, while UE’s FMemoryWriter only supports files up to 2GB. Therefore, it is necessary to change the scene’s lighting parameters (PackedLightAndShadowMapTextureSize or split the scene into multiple sub-levels, ensuring that each sub-level’s *_BuildData.uasset is less than 2GB).

UE Crash: DestructibleMesh causes crashes

In recent usage, creating a DestructibleMesh on the server, then destroying it on the server after it is broken, causes a crash on the client. If it is just hidden after breaking without destruction, it does not crash. This issue exists in UE4.18.3; I will record this and study it in-depth later.

未完待续。

Scan the QR code on WeChat and follow me.

Title:UE development problem notes and data collection
Author:LIPENGZHA
Publish Date:2019/05/27 22:07
Word Count:13k Words
Link:https://en.imzlp.com/posts/25331/
License: CC BY-NC-SA 4.0
Reprinting of the full article is prohibited.
Your donation will encourage me to keep creating!