Hi Epic,
UnrealLightmass executable, which is part of the external tools/Programs coming with UE5 sources, will become outdated after a fresh
installed build.
Reason: In UE5.x UnrealLightmass has been included exclusively in UE5 solution and not as part of the game project as it used to be in UE4.
Here is a potential solution I was thinking to roll-out:
The idea is to automate these steps by creating something like a post build step that does it automatically, thereby reducing/avoiding any human intervention.
Place these steps in a batch file and create a post build rule to execute it for you under Visual Studio 2022 along with UE5 solution (*.sln):
- Navigate to “<YourProjectRoot>\<EngineFolder>\Engine\Build\BatchFiles”
- Enter command " ./Build.bat UnrealLightmass Win64 Development -verbose "
The real question is:
Is the proposed solution the conventional way of solving this issue or there is/are another/other solutions used by other game studios to solve the same problem?
Thanks in advance,
Fabio
Hello,
Thank you for reaching out.
I’ve been assigned this issue, and we will be looking into automating building UnrealLightmass when building the editor for you.
Hi Stephen,
and thanks for your reply.
Do we have an ETA for this request and also how the integration of the same will happen on our/your side?
Thanks again for your assistance.
Hello,
You can add Unreal Lightmass as a PreBuildTarget in your Editor.Target.cs file:
public class YourEditorTarget : TargetRules { public YourEditorTarget(TargetInfo Target) : base(Target) { ... PreBuildTargets.Add(new TargetInfo("UnrealLightmass", Target.Platform, Target.Configuration, Target.Architectures, null, Target.Arguments)); ... } }
To add Unreal Lightmass when performing automated builds through a script, you can add it as a separate build step in the script, like you have done.
If you are using Build Graph, you can add Unreal Lightmass as a compile target. For an example of that, please see ./Engine/Build/Graph/Examples/BuildEditorAndTools.xml:
<!-- Compile the tool executables --> <Node Name="Compile Tools Win64" Requires="Update Version Files" Produces="#ToolBinaries"> ... <Compile Target="UnrealLightmass" Platform="Win64" Configuration="Development" Tag="#ToolBinaries" Arguments="$(ToolCompileArgs)"/> ... </Node>
Please let us know if this helps.
Hi Stephen,
thanks for your prompt response.
We will revise the options you gave us and select the one that suits our needs.
thanks again for your help
Hello,
Thank you for the reply.
Can we now close your case? You can always re-open it if you find you have additional questions about the same topic.
Hi Stephen,
we went for the first option you’ve suggested. Deleted UnrealLightmass.exe from the Win32 folder. Recompiled the Engine/Editor, but I couldn’t see the UnrealLightmass.exe out of my fresh compilation.
We’ve just added (I don’t think we need to re-generate the project files, right?), in our *.*Editor.Target.cs:
PreBuildTargets.Add(new TargetInfo(“UnrealLightmass”, Target.Platform, Target.Configuration, Target.Architectures, null, Target.Arguments));
Could Kindly shed some light on why the UnrealLightmass.exe doesn’t get compiled despite the fix?
Thanks
Hello,
Can you please check the /Engine/Binaries/Win64 folder for UnrealLightmass.exe?
Please do regenerate project files, and check the build log to see if it compiled Unreal Lightmass.
If generating project files does not solve the issue, please try a clean compile.
Hi Stephen,
sorry for the late reply and thanks for your prompt response.
We rolled out a different (and probably temporary solution) to the lightmass compilation issue.
We ended up creating our own batch file like below:
`@echo off
rem Clean and rebuild UnrealLightmass
set ENGINE_DIR=%~dp0
set TARGET=UnrealLightmass
set PLATFORM=Win64
set CONFIG=Development
rem Step 1: Clean
call “%ENGINE_DIR%Build.bat” %TARGET% %PLATFORM% %CONFIG% -Clean
rem Step 2: Rebuild
call “%ENGINE_DIR%Build.bat” %TARGET% %PLATFORM% %CONFIG% -WaitMutex %*
rem Keep the window open
echo.
echo Build complete. Press any key to exit.
pause`Eventually try to call this batch from somewhere meaningful, in order to automate the whole compilation process.
However, we were under the impression that compiling the Engine would automatically handle UnrealLightmass as well, so it was a bit unexpected to have to implement a fix for something that, as far as we understood, shouldn’t have been an issue to begin with.
Note: The issue started showing up from Unreal Engine 5.4 and now we are under 5.5, but still experiencing the same.
Looking forward to hear from you,
Thanks
Hello,
We have been unable to reproduce the failure to build Unreal Lightmass you are experiencing.
Can you please share a test project that demonstrates this build failure? It can be based on any of the C++ Templates, with your build settings added to the <project>Editor.Build.cs file.
The guide for test projects:
[Content removed]