How to Download and Build Unreal Engine 5 from Source

preview_player
Показать описание

In this video, we go over how to download the Unreal Engine source code from the Epic Games Github repository and build that source code in Visual Studio. In order to access the Github repo, we had to connect a Github account to an Epic Games account. We also discuss the various branches and tags in the repo so that you know which version of Unreal Engine you're using and how to retrieve the files for the version of Unreal that you are interested in. By the end of the video, you should be able to use your engine source build to develop games in the editor. The process covered in this video can be applied to other operating system platforms such as Mac and Linux, not just Windows.

*****IMPORTANT LINKS*****
How to remove cached credentials from Git for:
For the two links above, make sure to include the '.NET desktop development', 'Desktop development with C++', and 'Game development with C++'
workloads with your Visual Studio installation

*****IMPORTANT COMMANDS*****
To zoom out or in: Ctrl + or Ctrl -
cd [directory-path]
cd "[directory-path-with-spaces]"
Clearing the command line screen on:
Linux: clear
Windows: cls
Listing out all files in a directory on:
Linux/Bash: ls -a
Windows: dir /a
git branch -a
git tag
You can use arrow keys to scroll up and down the branches and tags from 'git branch -a' and 'git tag' respectively
Press q to get out of the 'git branch -a' or 'git tag' command
git checkout [name-of-branch-or-tag]
If you are getting an error from the checkout, then force a checkout by running the command above with '-f' added
For the two commands above, if running in Command Prompt, remove the './' at the beginning of each command
For the two commands above, if running on a Linux or Mac environment, replace 'bat' with 'sh' at the end of each command
On Linux, run 'make' after creating the Unreal Engine project files

How to support the channel:

Social media links:

0:00 Connecting Epic Games and Github accounts
2:18 Downloading Unreal Engine from source
4:05 Exploring branches and tags
8:27 Building Unreal Engine from source
11:40 Running Unreal Engine from source

#unrealengine #unrealenginesource #ue5
Рекомендации по теме
Комментарии
Автор

If you're getting a 404 error when trying to view the Unreal Engine repository on Github, then you have
to double check that you are signed into a Github account that is a member of the Epic Games Github organization.
Note that it may take some time for your account to be added to the Epic Games organization.
If you're still getting a 404 error after verifying your account and waiting some time,
then you may have to disconnect your Github account from your Epic Games account and redo the connection process that
we just went over from the beginning of the video up until [in clip 7 when I say
"just a reminder that links to the
major web pages and other useful information referenced in this video will be in the description below"].

You may be prompted to sign in to your Github account after initiating the 'git clone' command.
If prompted, make sure to provide Git the crendentials to the Github account that you connected
to your Epic Games account. Otherwise, the 'git clone' command will fail.
If not prompted, but the 'git clone' command failed,
then Git might be using credentials that are cached in memory and
linked to an account that is not part of the Epic Games Github organization.
There are links in the description to more information on how to check
this, deal with this, and troubleshoot other cloning errors.

When trying out the actively worked on, aka less stable, branches,
an error may occur while generating project files, compiling the engine, or starting up the editor.
For the two latter cases, I suggest first, if applicable, to repair your visual studio installation,
and then build or rebuild the engine.
If using Visual Studio, consider doing a clean
before building/rebuilding. Sometimes, it may be necessary to rerun the Setup and GenerateProjectFiles
scripts before compiling again. Note that this is what I would do when there are no clear reasons
as to why the failure came about. If that doesn't work, and for errors that happen while generating project files,
you can try the following options:

1) Find the file or piece of code that is causing the issue and resolve the problem
yourself.
2) Wait until the error gets resolved by someone else at a later date and pull those fixes from github
after those commits get merged with the remote epic games branch.
3) Look in the repository's commit history and go back to a working commit hash using 'git checkout',
or undo the changes made by a bad commit using 'git revert'.

Whichever one of the above courses of action you end up pursuing, be sure to rerun the Setup and GenerateProjectFiles
scripts before attempting to build the engine again just to be safe.

An example that I encountered while filming this video was that on the 5.0 branch, I was getting an error
related to duplicate definitions of a function in a class, while
generating project files. In this situation, I was able to pinpoint the recent commit that caused this issue,
and I could have just removed the duplicate definition, but luckily the next day,
a commit was pushed to the 5.0 branch on the epic games unreal engine github repo,
and I was able to just pull the changes (git pull origin 5.0), regenerate the project files,
and rebuild the engine. If I was really in a hurry,
I could have also reverted the changes made by the commit that caused the problem by doing 'git revert <commit-hash>'
In addition to reverting the commit, you can
also check out (git checkout <commit-hash>) a commit that was made before the commit that caused the issue.
In order to find commits before a specific commit, you can run 'git log <commit-hash>' (commits are listed
in descending order of commit date with the first one being the commit you specified in the command).

Normally, the project files will generate fine and the engine will build successfully with no difficulties
when building an official release or a branch of unreal engine that isn't very active.

Flopperam
Автор

For those who are building Unreal Engine 5 from source with Visual Studio 2022, make sure that you include the .NET Core 3.1 Runtime (LTS) individual component in your Visual Studio installation. It is needed when creating C++ projects for UE5.

Flopperam
Автор

need to say something about this ....when building the UE5 on visual studio the biashhh will be 200GB large after building so make sure that your drive got enough space to store the ue 5 build ...and also take in mind that the build will be like 5-8 hours long shit so take your time put the build job over night or when you leave home ... and this with last generation computer i711800, 32ram,rtx,ssd (no bullshitting) (after all that gotta mention that this tutorial is perfect and all working perfectly just like in the video if you folow the exact steps) good luck to you all!

MaxStudioCG
Автор

If you are trying to do this through the command line interface, you may need a personal access token now. If you download a visual git interface like git desktop, you can clone the project through that without having a personal access token.

loganfairbairn
Автор

Built UE5 successfully today, thanks for the guide. The editor has changed so much since the EA build last spring. I am disturbed by these things they call Quarter Cylinders :)

guyalsfere
Автор

Is there any way to make the build shorter so that it doesn't take so long? Out of 4, 700, 600 elements were built for almost 12 hours… And can you tell me which components affect the speed of build? SSD is fast, but the processor is not quite.

gerda
Автор

You are the man! Thank you so much. You should also do one about compiling against projects, to make the build smaller.

Cloroqx
Автор

11:30 Build Took me 1 hour (4000sec) with ryzen 9 5900x 12 Cores

lauch
Автор

could I get some help?
I'm at the "git checkout" part (7:35) and instead of seeing "Update Files" it's talking about a "detached HEAD" state? As far as I understand, 5.3.0-release is currently the most updated tag. Here:


$ git checkout 5.3.0-release
Note: switching to '5.3.0-release'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

git switch -c <new-branch-name>

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at a3cb3d8fdec1 5.3.0 release

valorune
Автор

When I do the ./setup.bat command in GIT BASH on my windows computer, script stops with an error because it cant find the UEPrereqSetup_x64.exe - I cant find it either.. Where can I find/install/download it?

grusommen
Автор

If you are building a version of Unreal Engine 4 instead of UE5, and are getting an error message after generating project files along the lines of "The reference assemblies for a specific version of the .NET framework were not found" or "Your project does not reference a certain version of the .NET framework, add a reference to that version in the target frameworks", then you have to go into the Visual Studio Installer, modify your Visual Studio installation, go to Individual Components, and install the targeting pack for the version of the .net framework specified in the error message. For example, for Unreal 4.27, you need the .NET Framework 4.6.2 targeting pack. Sometimes, if experiencing the latter error, you may have to run the `git clean -dfx` and `git reset --hard` commands in your local repo as well. If you run those git commands, then you'll have to run Setup.bat again before rerunning GenerateProjectFiles.bat.

Flopperam
Автор

When you said it'd take a while to compile I didn't expect 13 and a half hours

Straxedix
Автор

build in visual studio took 14 hours for me

dinoking
Автор

man this is more complex than i thought

Kimosabe-ok
Автор

Great, clear and effective.... thanks !!

toolexport
Автор

Thanks, Cloning the Repository seems to be the only way to compile it without errors...unfortunately after doing so without error I tried to launch it from Visual Studio and it screwed it up somehow...I don't know what happened but then I got errors after that, and I couldn't seem to figure out how to fix it so I'm starting over and next time I won't try to launch it from Visual Studio.

unrealdevop
Автор

when I list out the brances, mine only go up to 4.26. I want ue5. what do i do?

VisibleMRJ
Автор

When building project my UE5 was working weird today it was not copying plugin files and adding it to binaries but then i remembered i did windows update other updates dont seem to affect that much. It works fine when i copy old binaries but i think i should Rebuild the whole engine again. So this is what you have been telling in video about am i right? So should i always rebuild UE after Windows update ?

aadityarajkarki
Автор

Configuration should be as Makefile or exe? By default its Makefile but after successfully compilation process it don't create the main executable of UE4Editor. I use 4.25 Plus version

adrianmiszczuk
Автор

If I want to deploy this to various workstations would I just perform a folder copy to all workstations once I create the build via Visual Studio?

TheDeFiler