Formula-Student-Driverless-Simulator
Formula-Student-Driverless-Simulator copied to clipboard
Feat/add unreal engine 5.3
This Pull Request attempts to make the necessary changes for running the project in Unreal Engine 5.3. The initial motivation came from the discussion in another PR and in the Airsim project here due to experiencing the same error.
Switching to UE5.3 doesn't seem to fix this though. Even after modifying the code to obey the new UE5.3 rules, it prints the following build log including the exact same error as before:
Setting up bundled DotNet SDK
Running command : dotnet Engine/Binaries/DotNET/UnrealBuildTool/UnrealBuildTool.dll Development Linux -Project=<redacted>/fsds/UE4Project 5.3/FSOnline.uproject -TargetType=Editor -Progress -NoHotReloadFromIDE
Log file: <redacted>/unreal-engine-5.3/Engine/Programs/UnrealBuildTool/Log.txt
DEPRECATION: 'IniKeyBlacklist', which is a config key in section [/Script/UnrealEd.ProjectPackagingSettings], in '<redacted>/fsds/UE4Project 5.3/Config/DefaultGame.ini', has been deprecated. Using 'IniKeyDenylist' instead. It is recommended you update your .ini files as soon as possible, and replace IniKeyBlacklist with IniKeyDenylist
Using 'git status' to determine working set for adaptive non-unity build (<redacted>/unreal-engine-5.3).
Using 'git status' to determine working set for adaptive non-unity build (<redacted>/fsds).
@progress push 5%
@progress 'Generating code...' 0%
@progress 'Generating code...' 67%
@progress 'Generating code...' 100%
@progress pop
Building BlocksEditor...
[Upgrade]
[Upgrade] Using backward-compatible build settings. The latest version of UE sets the following values by default, which may require code changes:
[Upgrade] bLegacyParentIncludePaths = false => Omits module parent folders from include paths to reduce compiler command line length. (Previously: true).
[Upgrade] CppStandard = CppStandardVersion.Default => Updates C++ Standard to C++20 (Previously: CppStandardVersion.Cpp17).
[Upgrade] WindowsPlatform.bStrictConformanceMode = true => Updates MSVC strict conformance mode to true (Previously: false).
[Upgrade] Suppress this message by setting 'DefaultBuildSettings = BuildSettingsVersion.V4;' in BlocksEditor.Target.cs, and explicitly overriding settings that differ from the new defaults.
[Upgrade]
[Upgrade]
[Upgrade] Using backward-compatible include order. The latest version of UE has changed the order of includes, which may require code changes. The current setting is:
[Upgrade] IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_0
[Upgrade] Suppress this message by setting 'IncludeOrderVersion = EngineIncludeOrderVersion.Latest;' in BlocksEditor.Target.cs.
[Upgrade] Alternatively you can set this to 'EngineIncludeOrderVersion.Latest' to always use the latest include order. This will potentially cause compile errors when integrating new versions of the engine.
[Upgrade]
Determining max actions to execute in parallel (16 physical cores, 16 logical cores)
Executing up to 16 processes, one per physical core
@progress 'Compiling C++ source code...' 0%
------ Building 3 action(s) started ------
@progress 'Compiling C++ source code...' 33%
[1/3] Link (lld) libUnrealEditor-AirSim.so
ld.lld: error: undefined symbol: pthread_cond_clockwait
>>> referenced by condition_variable.h:227 (/usr/bin/../include/c++/v1/__condition_variable/condition_variable.h:227)
>>> client.cc.o:(std::__1::condition_variable::__do_timed_wait[abi:ue170006](std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l>>>)) in archive <redacted>/fsds/UE4Project 5.3/Plugins/AirSim/Source/AirLib/deps/rpclib/lib/librpc.a
ld.lld: error: undefined symbol: UPhysicalMaterial::GetPrivateStaticClass()
>>> referenced by PhysicalMaterial.h:61 (Runtime/PhysicsCore/Public/PhysicalMaterials/PhysicalMaterial.h:61)
>>> <redacted>/fsds/UE4Project 5.3/Plugins/AirSim/Intermediate/Build/Linux/x64/UnrealEditor/Development/AirSim/Module.AirSim.cpp.o:(ACarPawn::ACarPawn())
>>> referenced by PhysicalMaterial.h:61 (Runtime/PhysicsCore/Public/PhysicalMaterials/PhysicalMaterial.h:61)
>>> <redacted>/fsds/UE4Project 5.3/Plugins/AirSim/Intermediate/Build/Linux/x64/UnrealEditor/Development/AirSim/Module.AirSim.cpp.o:(ACarPawn::ACarPawn())
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Total time in Parallel executor: 0.19 seconds
Total execution time: 1.56 seconds
Opening the project in UE5.3 is as such currently at least from my Linux machine not possible so it couldn't be tested; it is expected to not work as is, but maybe serve as a base to do the last few changes necessary so this PR is currently marked as a draft.
Also, I'm completely new to UE and 3D programming so make sure to check my changes twice :). The most interesting part is the CarPawnSimApi.cpp where indeed the logic needed to be changed due to UE's switch from PhysX to Chaos.
In all changes I mainly tried to find the corresponding "new" UE5 function and replace with it; the compiler not crying anymore doesn't mean it actually works though.
EDIT: Most of the changes were taken from here and adjusted as needed.