Skip to content

Commit

Permalink
updated docs for upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Apr 28, 2018
1 parent a969762 commit d36e897
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 59 deletions.
24 changes: 3 additions & 21 deletions docs/build_linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ It's super simple: 1-2-3!
2. Clone Unreal in your favorite folder and build it (this may take a while!). **Note**: We only support Unreal 4.17 at present.
```bash
# go to the folder where you clone GitHub projects
git clone -b 4.17 https://github.com/EpicGames/UnrealEngine.git
git clone -b 4.18 https://github.com/EpicGames/UnrealEngine.git
cd UnrealEngine
# the Unreal build was broken a few times so we will get the commit that works
git checkout af96417313a908b20621a443175ba91683c238c8
./Setup.sh
./GenerateProjectFiles.sh
make
Expand Down Expand Up @@ -50,18 +48,6 @@ If this is the case then look for *.gch file(s) that follows after that message,

If you see other compile errors in console then open up those source files and see if it is due to changes you made. If not, then report it as issue on GitHub.

#### What are the known issues with Unreal 4.16?

* One of the major issues is [this bug in Unreal](https://answers.unrealengine.com/questions/664905/unreal-crashes-on-two-lines-of-extremely-simple-st.html). We have a workaround for some parts of the code but we haven't tested if everything is covered.
* Clicking the "End" button causes Unreal to crash.
* The report function (when you press <kbd>R</kbd>) also causes a crash because of the above reasons.

#### What are the known issues with Unreal 4.17?

* We have seen some random crashes during the startup.
* You might get a warning that says that the AirSim plugin is incompatible, which you can ignore.
* Clicking the "End" button freezes the Unreal Editor. When this happens you will need to manually kill the process.

#### Unreal crashed! How do I know what went wrong?

Go to the `MyUnrealProject/Saved/Crashes` folder and search for the file `MyProject.log` within its subdirectories. At the end of this file you will see the stack trace and messages. You can also take a look at the `Diagnostics.txt` file.
Expand All @@ -76,15 +62,11 @@ Yes, you can, but we haven't tested it. You can find the instructions [here](htt

#### What compiler and stdlib does AirSim use?

We use the same compiler, **Clang 3.9**, and stdlib, **libc++**, that Unreal uses. AirSim's `setup.sh` will automatically download them both. The libc++ source code is cloned into the `llvm-source` folder and is built into the `llvm-build` folder, from where CMake uses libc++.

#### Can I use AirSim with Unreal 4.16?

Yes! The `*.Build.cs` files are, however, no longer compatible (you will get a compile error). You can find files for 4.16 as `*.Build.4.16.cs` so just rename those.
We use the same compiler that Unreal Engine uses, **Clang 5.0**, and stdlib, **libc++**. AirSim's `setup.sh` will automatically download them both. The libc++ source code is cloned into the `llvm-source-(version)` folder and is built into the `llvm-build` folder, from where CMake uses libc++.

#### What version of CMake does the AirSim build use?

3.5.0 or higher. This should be the default in Ubuntu 16.04. You can check your CMake version using `cmake --version`. If you have an older version, follow [these instructions](cmake_linux.md) or see the [CMake website](https://cmake.org/install/).
3.9.0 or higher. This is *not* the default in Ubuntu 16.04 so setup.sh installs it for you. You can check your CMake version using `cmake --version`. If you have an older version, follow [these instructions](cmake_linux.md) or see the [CMake website](https://cmake.org/install/).

#### Can I compile AirSim in BashOnWindows?

Expand Down
22 changes: 6 additions & 16 deletions docs/build_windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
## Install Unreal Engine

1. [Download](https://www.unrealengine.com/download) the Epic Games Launcher. While the Unreal Engine is open source and free to download, registration is still required.
2. Run the Epic Games Launcher, open the Library tab from left, click on the "Add Versions" which should show the option to download Unreal 4.16 as shown below. If you have multiple versions of Unreal installed then make sure 4.16 is "Current" by clicking down arrow next to the Launch button for the version.
2. Run the Epic Games Launcher, open the Library tab from left, click on the "Add Versions" which should show the option to download Unreal 4.18 as shown below. If you have multiple versions of Unreal installed then make sure 4.18 is "Current" by clicking down arrow next to the Launch button for the version.

**Note**: Older versions of Unreal are not supported. Please see the [upgrade guide](unreal_upgrade.md) to upgrade your projects.
**Note**: If you have UE 4.16 or older projects, please see the [upgrade guide](unreal_upgrade.md) to upgrade your projects.

![Unreal Versions](images/unreal_versions.png)

## Build AirSim

1. You will need Visual Studio 2015 Update 3 (make sure to install VC++) or newer. Other versions haven't been tested.
2. Start VS2015 x64 Native Tools Command Prompt. Create a folder for the repo and run `git clone https://github.com/Microsoft/AirSim.git`.
3. Install [CMake](https://cmake.org/download/) which is used to build the rpclib submodule.
4. Run `build.cmd` from the command line. This will create ready to use plugin bits in the `Unreal\Plugins` folder that can be dropped into any Unreal project.
1. You will need Visual Studio 2017 (make sure to install VC++) or newer.
2. Start `x64 Native Tools Command Prompt for VS 2017`. Create a folder for the repo and run `git clone https://github.com/Microsoft/AirSim.git`.
3. Run `build.cmd` from the command line. This will create ready to use plugin bits in the `Unreal\Plugins` folder that can be dropped into any Unreal project.

## Setup Remote Control

Expand All @@ -31,15 +30,6 @@ Finally, you will need an Unreal project that hosts the environment for your veh
#### How do I use PX4 firmware with AirSim?
By default, AirSim uses its own built-in firmware called [simple_flight](simple_flight.md). There is no additional setup if you just want to go with it. If you want to switch to using PX4 instead then please see [this guide](px4_setup.md).

#### Build is not working on VS 2017
Known working config is:
````
Windows 10 (Education) x64
VS2015 update 3 (x86) with VC++
Cmake 3.9 (x86)
````
Even though cmake 3.7 says it added support for VS 2017 folks are reporting build issues with that.

#### I made changes in Visual Studio but there is no effect

Sometimes the Unreal + VS build system doesn't recompile if you make changes to only header files. To ensure a recompile, make some cpp file "dirty".
Sometimes the Unreal + VS build system doesn't recompile if you make changes to only header files. To ensure a recompile, make some Unreal based cpp file "dirty" like AirSimGameMode.cpp.
4 changes: 2 additions & 2 deletions docs/unreal_custenv.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ There is no `Epic Games Launcher` for Linux which means that if you need to crea

## Step by Step Instructions

1. Make sure AirSim is built and Unreal 4.16 is installed as described in [build instructions](build_windows.md).
1. Make sure AirSim is built and Unreal 4.18 is installed as described in [build instructions](build_windows.md).
2. In `Epic Games Launcher` click the Learn tab then scroll down and find `Landscape Mountains`. Click the `Create Project` and download this content (~2GB download).

![current version](images/landscape_mountains.png)
Expand All @@ -26,7 +26,7 @@ There is no `Epic Games Launcher` for Linux which means that if you need to crea
```
{
"FileVersion": 3,
"EngineAssociation": "4.16",
"EngineAssociation": "4.18",
"Category": "Samples",
"Description": "",
"Modules": [
Expand Down
54 changes: 34 additions & 20 deletions docs/unreal_upgrade.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,49 @@

# Upgrading Unreal Engine Version
# Upgrading to UE 4.18 and Visual Studio 2017

## Blocks Project
These instructions applies if you are already using AirSim on Unreal Engine 4.16. If you never installed AirSim, please see [How to get it](https://github.com/microsoft/airsim#how-to-get-it).

If you are using Blocks project that comes with AirSim then you don't need to do anything other than [installling Unreal 4.16](build_windows.md).
## Do this first

## Your Own Unreal Project
If you have your own Unreal project created in version Unreal 4.15 then you need to upgrade your project to use Unreal 4.16.
### For Windows Users
1. Install Visual Studio 2017 with VC++, Python and C#.
2. Install UE 4.18 through Epic Games Launcher.
3. Start `x64 Native Tools Command Prompt for VS 2017` and navigate to AirSim repo.
4. Run `git clean -fdx` to remove all unchecked/extra stuff from your repo.
5. Run `git pull` to get latest code from GitHub.
6. Run `build.cmd` to build everything.

### Option 1: Just Recreate Project
### For Linux Users
1. Rename or delete your exiting folder for Unreal 4.17.
2. Rename or delete your existing folder for AirSim repo.
2. Follow [Install steps for Linux](https://github.com/Microsoft/AirSim/blob/master/docs/build_linux.md#install-and-build).

If your project doesn't have any code or assets other than environment you downloaded then you can also simply [recreate the project in Unreal 4.16 Editor](unreal_custenv.md) and then copy Plugins folder from `AirSim/Unreal/Plugins`.
## Upgrading Your Custom Unreal Project
If you have your own Unreal project created in older version of Unreal Engine then you need to upgrade your project to Unreal 4.18. To do this,

### Option 2: Modify Few Files
1. Open .uproject file and look for the line `"EngineAssociation"` and make sure it reads like `"EngineAssociation": "4.18"`.
2. Delete `Plugins/AirSim` folder in your Unreal project's folder.
3. Go to your AirSim repo folder and copy `Unreal\Plugins` folder to your Unreal project's folder.
4. Copy *.bat (or *.sh for Linux) from `Unreal\Environments\Blocks` to your project's folder.
5. Run `clean.bat` (or `clean.sh` for Linux) followed by `GenerateProjectFiles.bat` (only for Windows).

Unreal 4.16 Build system has breaking changes. So you need to modify your *.Build.cs and *.Target.cs which you can find in `Source` folder of your Unreal project. So what are those changes? Below is the gist of it but you should really refer to [Unreal's official 4.16 transition post](https://forums.unrealengine.com/showthread.php?145757-C-4-16-Transition-Guide).
## FAQ

#### In your project's *.Target.cs
### I have Unreal project that is older than 4.16. How do I upgrade it?

#### Option 1: Just Recreate Project
If your project doesn't have any code or assets other than environment you downloaded then you can also simply [recreate the project in Unreal 4.18 Editor](unreal_custenv.md) and then copy Plugins folder from `AirSim/Unreal/Plugins`.

#### Option 2: Modify Few Files
Unreal versions newer than Unreal 4.15 has breaking changes. So you need to modify your *.Build.cs and *.Target.cs which you can find in `Source` folder of your Unreal project. So what are those changes? Below is the gist of it but you should really refer to [Unreal's official 4.16 transition post](https://forums.unrealengine.com/showthread.php?145757-C-4-16-Transition-Guide).

##### In your project's *.Target.cs
1. Change the contructor from, `public MyProjectTarget(TargetInfo Target)` to `public MyProjectTarget(TargetInfo Target) : base(Target)`

2. Remove `SetupBinaries` method if you have one and instead add following line in contructor above: `ExtraModuleNames.AddRange(new string[] { "MyProject" });`

#### In your project's *.Build.cs
##### In your project's *.Build.cs
Change the constructor from `public MyProject(TargetInfo Target)` to `public MyProject(ReadOnlyTargetRules Target) : base(Target)`.

#### In your *.uproject
Remove line for `EngineAssociation`

#### And finally...
1. Make sure [Unreal 4.16 is installed](build,md).
2. Double click on your project's `*.uproject` file.
3. If you are asked to select Unreal version, select 4.16.
4. The warning box might show only "Open Copy" button. Don't click that. Instead click on More Options which will reveal more buttons. Choose Convert-In-Place option. Causion: Always keep backup of your project first!
5. If you don't have anything nasty, in place conversion should go through and you are now on new version of Unreal!
##### And finally...
Follow above steps to continue upgrade. The warning box might show only "Open Copy" button. Don't click that. Instead click on More Options which will reveal more buttons. Choose `Convert-In-Place option`. *Causion:* Always keep backup of your project first! If you don't have anything nasty, in place conversion should go through and you are now on new version of Unreal.

0 comments on commit d36e897

Please sign in to comment.