A way to combine multiple unreal projects into one
Use the GenerateProjectFiles.bat
and .uprojectdirs
files of the engine directory
- First refer to the comments in the
Default.uprojectdirs
file - Create a new
my.uprojectdirs
or directly modify theDefault.uprojectdirs
file and write to e.g.Project/
- When you run
GenerateProjectFiles.bat
build a solution, you will additionally look for Unreal Project directories from the Level 1 subdirectory of the Engine Directory/Project directory, such asUnrealEngine/Project/LyraGame
finish
Because only subdirectories can be specified in the
.uprojectdirs
file, if you want projects in external directories to be included in the solution file, you can use thesymbol-link
functionality provided by the system
Deprecated
Original intention
For working and studying purpose, I have multiple Unreal Projects on my computer, and they share the same engine
By default, each project file is a stand-alone solution file generated by UBT(Unreal Build Tool)
This brings me some problems:
Due to the high cost of opening a solution, the waiting time and memory footprint may get multiplied when opening multiple solutions at the same time
When the IDE is bugged, or the engine code is updated and triggering “symbol reparsing”, It takes at least 15 minutes to boot up, which is really a torture
I think that different project solutions should treat the project with same physical path as the same project, the Unreal Engine project file should not be re-parsed in each solution
But both of the Rider
and Visual Studio
(the most powerful IDE of the universe;) will get it re-parsed in every solution. It is very tortuous and makes me confused, hoping some expert could explain the reason behind this
Demand
So I was thinking: since these IDEs are “stupid” and unreliable, could I find a way to manually combine multiple solutions into one?
Steps
I am sharing the steps to accomplish the job using Rider
:
Among the solutions that you want to open together, choose the one you like as the main solution, open it up
Add other project files
In
Explorer
, the solution browser, right-click any project folder, such asGames
, selectAdd
,Add Existing Project...
, and choose the relative project fileAssuming we are adding the
LyraStarterGame
project, then these files should locate atLyraStarterGame_Folder\\Intermediate\\ProjectFiles\\LyraStarterGame.vcxproj
- In “Solution Configuration”, modify the configuration of the project just added
in the toolbar of the upper right corner, click
DebugGameEditor | Win64
button (this is mySolution Configuration
, the text of the button would be different according to your configuration), and selectEdit Solution Configurations...
find the project just added, you should notice that they are default configured as something like
DebugClient | Arm64
, change it to what you need, generally it should be the same asSolution Configuration
- Modify the project file parameter
back to
Explorer
, the solution browserright-click the project just added (again, using
LyraStarterGame
as an example), selectEdit
,Edit LyraStarterGame.vcxproj
replace all the
$(SolutionDir)
with$(ProjectDir)..\\..\\
inLyraStarterGame.vcxproj
($(SolutionDir)
is the root path of current solution,$(ProjectDir)
is the root path of current project file, which isLyraStarterGame_Folder\\Intermediate\\ProjectFiles\\
, using..\\
twice, we get the root path of current project)if you don’t want to replace all of them at once, searching your “
build configuration
” such asDebugGame_Editor|x64
, find the relevant configuration, you can only replace the text within the threeNMake
command lines, but probably encounter some problems because of can not parse the project file correctly: for exampleSwitch Header/Source
is not working, grammar coloring is broken. If so, do a full replacement should solve the problem
Limitation
Every time the project file is regenerated, the relative file would be overriden and the steps above need to be re-done. If any IDE could support this or having a tool to automated this, life would be much easier