Hello, I am new here and have been following this course on Linux. I am 17 or 18 lectures into Section 03 at the time of this writing and I would like to share my experiences so far in detail.
My System Specs:
- OS: Linux Mint 18 Cinnamon
- CPU: AMD FX-6300
- RAM: 8 GB DDR3
- GPU: NVIDIA GTX 750 Ti
- Drivers: Proprietary, Version 361.42
UE4 Linux Main Page: Unreal Engine 4 Linux Support
First I’d like to note that UE4 appears to work rather well on Linux. It does have some minor bugs, but nothing serious that I’ve found. The bigger problem I had was setting it up in the first place. As you probably know, Epic does not release any precompiled packages of UE4 for Linux, which means we have to compile it from source. This isn’t too big of a problem, fortunately, since the UE4 is open source and the source comes with a handy set of scripts that automate the whole process… mostly.
While UE4 does have a script that automatically installs the main dependencies it uses, it doesn’t necessarily pick up everything. When I first tried to build UE4, I was using Linux Mint 17.3, and I had a horrible time with dependencies. In particular, the utility program hlscc (I think it was called, could be wrong, anyway I think it converts HLSL code to GLSL, so it’s important) failed to compile with basically no error output. I don’t really remember everything I went through to get it working, but my advice is to 1) learn where to find your system libraries are since sometimes the dependencies are installed, but they are not where the compiler expects them to be, and 2) make sure you know that your compiler can actually find it’s standard libraries. GCC seems to find it’s own libraries just fine, but Clang requires that the include library headers be in a system variable called CPLUS_INCLUDE_PATH and the compiled libraries themselves be in LIBRARY_PATH. For example, on my system I set cplus include path with:
export CPLUS_INCLUDE_PATH=/usr/include/c++/4.8:/usr/include/x86_64-linux-gnu/c++/4.8
If you are not familiar with exporting variables or shell scripting in general, I recommend doing a little research on it. Shell script is pretty simple, I learned the bulk of it in a day. Also look up what a .bashrc file is and how to use it.
If you get through compilation with little to no dependency issues, then you are pretty much good to go. However, be aware that UE4 is big, and it is even bigger as just source. For those with a slow internet connection, downloading UE4 can take a long time and updating in the future will be no less tedious. Also, for those using Git, don’t forget to update submodules when you fetch a new branch, because those by far take the longest to download. Furthermore, UE4 takes a long time to compile. On my modest machine it takes about 2 hours.
After it’s compiled, you have your fresh UE4 binaries ready to rock and roll, but you aren’t quite done yet. First, I recommend making a launcher for the editor on your desktop, I just used a simple shell script with a custom icon (see the docs for more info). The first problem I encountered when launching UE4 for the first time was how incredibly long it took to launch. Looking at the command line output didn’t help much either, since it is a massive spew of information. It did eventually launch though. It pulled up the project manager dialog and it looked like it was working. At this time UE4 began to convert it’s ~2,500 internal shaders from HLSL to GLSL, which that in itself took around a half hour. Anyway, I found that the project manager worked and I was able to make a test project just fine, except for the project manager wouldn’t always hand off control to the project itself. In fact, the project manager would usually just exit and not launch the project at all.
Thankfully, the fix is easy for this one. You can make another simple shell script that launches UE4 editor with your project as an argument to skip the project manager (again, see the docs for more info). Launching a project directly actually launches the editor faster than launching to the project manager, so this is a pretty solid win.
So at this point I was able to open up projects in the editor without issue and everything appeared to work fine. At this point I had to get an IDE for UE4 to use. UE4 supports quite a few, and I ultimately chose CodeLite because CodeLite looks very similar to MS Visual Studio and because UE4 supports it without any additional plugins. However, installing the IDE of your choice is not enough, you will have to go find the engine config and set the Source Code Accessor to whatever you chose (See UE4’s Known Issues) Even with UE4 supporting CodeLite best, it still isn’t perfect. In particular, if you build your game code from CodeLite, UE4 will not be notified to Hotload the new code, so you will still have to use the compile button within the editor to update your changes. While this makes it tempting to only compile from UE4, I quickly found that UE4 does not provide detailed compiler output so if something goes wrong, you have nothing to go off of.
The final problem I ran into so far was with building the lighting. For some reason, it would export the scene information, but then it would just hang at 0% for it’s lighting build progress. After a little digging, I found I had to open up the TCP/UDP port 6666 in my firewall for the light build to work. I thought this was rather odd, since I couldn’t fathom why the light builder would need to use the network to work. Well, after I ported my project to Windows later, I noticed that UE4 was actually exporting the lighting build to some application called SWARM, which apparently organizes work over a network. Having the firewall block the light build on Windows isn’t really a problem since Windows prompts you to let UE4 through the firewall on first launch.
As a final note, I did find out that it is easy to work with UE4 cross platform. Since UE4 is essentially the same on every platform, I decided to setup a repo for my UE4 projects on BitBucket and use that to sync my project between operating systems (I run multiple OS’s on one computer). Now I can comfortably follow this course from Linux Mint or Windows, using the respective tools for either system.
Update: I just switched back to Linux after using Windows and found that the auto exposure in UE4 appears to be broken. I am pretty sure it wasn’t last time I used it, so I’m not sure what happened. The manual controls for exposure still work though. To access your exposure settings, in the 3D view open the lighting menu (top left of screen) and it is at the bottom of that.
That’s all I’ve got for now. I hope somebody will find it useful. I’ll come back through and update this post as necessary as I progress. Also, if anybody wants to use sections of my post to help make a proper wiki entry up top, please feel free to.