Skip to content

Instantly share code, notes, and snippets.

@AndreaCatania
Last active April 19, 2025 16:19
Show Gist options
  • Save AndreaCatania/4996c673ecb3d6b4e947e24554a0d7bf to your computer and use it in GitHub Desktop.
Save AndreaCatania/4996c673ecb3d6b4e947e24554a0d7bf to your computer and use it in GitHub Desktop.

Linux

Compile unreal from source - Linux

Compile unreal from source - Linux

Follow this documentation to compile unreal from source: https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Linux/BeginnerLinuxDeveloper/SettingUpAnUnrealWorkflow/


Make clean

Make clean

make ARGS=-clean

Generate project files command line

Generate project files command line

To generate project files you have to execute the following command: sh ./GenerateProjectFiles.sh /path/to/workspace/PROJECT/PROJECT.uproject -game -engine -vscode

NOTE: -vscode is used to generate VSCode workspace.

NOTE: Follow this guide to properly setup VSCode: https://docs.unrealengine.com/5.0/en-US/setting-up-visual-studio-code-for-unreal-engine/


Unreal versioning of Binaries

Unreal versioning of Binaries

How do I change version of compiled unreal engine?

Manually-Specified Build ID

It is possible to force your Build ID to a specific value. You can accomplish this by adding a BuildId entry (as a string variable) to your Engine/Build/Build.version JSON file, but it is not recommended, as it removes the check to prevent using incompatible Modules. It is particularly easy to run outdated code if using a forced Build ID with Plugins that may be shared between multiple Projects. SOURCE: https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/BuildTools/UnrealBuildTool/VersioningofBinaries/

For some reason the above doesn't work. What you have to do is:

  1. Execute ./Setup.sh
  2. Navigate to .config/Epic/UnrealEngine/Install.ini
  3. Remove any line but the header, the file should look exactly like this:
[Installations]
  1. Create a new directory and file: .config/Epic/UnrealEngine/LauncherInstalled.dat
  2. Add the following data:
{
    "InstallationList": [
        {
            "AppName": "UE_5.1",
            "InstallLocation": "/path/to/UnrealEngine"
        }
    ]
}
  1. Done, enjoy your engine version.

Note: The source of this info is UE discord Linux channel.


Windows

Best Windwows toolchain version

You can check the best toolchain version for Urneal engine here: UnrealEngine/Engine/Config/Windows /Windows_SDK.json

Good to know

Rename classes, modules without breaking Blueprint

Rename classes, modules without breaking Blueprint

After a class or module rename you have to add a Core Redirect to make sure the BPs will continue working. Follow the doc here: https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/ProgrammingWithCPP/Assets/CoreRedirects/

Note 1: The MatchSubstring=true doesn't work so it's needed to use the full path

+EnumRedirects=(OldName="/Script/StrayBalls.EFlTeam", NewName="/Script/MGame.EFlTeam")
+ClassRedirects=(OldName="/Script/StrayBalls.FlHolographicObjectManager", NewName="/Script/MGame.FlHolographicObjectManager")
+StructRedirects=(OldName="/Script/StrayBalls.FlMeshMaterials", NewName="/Script/MGame.FlMeshMaterials")

Note 2: Make sure to put the redirects under [CoreRedirects] inside DefaultEngine.ini

Note 3: Once the CoreRedirects works, you can re-compile and re-save all the BPs / Assets to make sure those use the new calss. Afterward you can remove the CoreRedirects.

To perform the above action you can use the UE4 commandlet

./UE4Editor /path/to/workspace/PROJECT/PROJECT.uproject -run=resavepackages
   OR
./UE4Editor /path/to/workspace/PROJECT/PROJECT.uproject -run=resavepackages -fixupredirectors

Event to detect when a controller is connected or disconnected
IPlatformInputDeviceMapper::GetOnInputDeviceConnectionChange()
Unreal Engine UObject pointers types
// Can be considered as a raw pointer.
TObjectPtr<UInputAction> MoveAction; 

// Store a reference of an object that may be already garbage collected (owns it)
TSoftObjectPtr<UInputAction> MoveAction; 

// Stores a non-owning reference to the object (acting like a weak smart ptr)
TWeakObjectPtr<UInputAction> MoveAction; 

// Store a reference of an object and owns it, preventing to garbage collect.
TStrongObjectPtr<UInputAction> MoveAction; 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment