# T#2

You can set-up your own Unreal Environment with [these instructions](https://github.com/Microsoft/AirSim/#how-to-get-it).

For this tutorial, we will use a simple block environment.

Blocks environment is available in repo in folder `Unreal/Environments/Blocks` and is designed to be lightweight in size. That means its very basic but fast.

Here are quick steps to get Blocks environment up and running:

## Windows

1. Make sure you have [installed Unreal and built AirSim](https://github.com/ykkimhgu/gitbook_docs/blob/master/simulator/airsim/tutorial/broken-reference/README.md).
2. Make sure you have `uproject` files are associated with Unreal engine
   * After installation of Unreal, Restart computer
   * Open `Epic Game Launcher` -> `Unreal Engine` -> `Unreal Engine 4.24.x`

     <img src="https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-f61ea9572e1fc04bd5988be109ea88422b127823%2Fepic1.jpg?alt=media" alt="epic1" data-size="original">
   * Associate `uproject` with Unreal engine

     <img src="https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-93f0ce246ea969ca58b6c0789d413f6fbd1c7d48%2Fepic2.jpg?alt=media" alt="epic1" data-size="original">
3. Open `Command Prompt for VS 2019` and navigate to folder `AirSim\Unreal\Environments\Blocks` and run `update_from_git.bat`. Or you can run `update_from_git.bat` by double clicking the file in File Explorer
4. With File Explorer, double click on generated .sln file to open in Visual Studio 2019 or newer.
5. Make sure `Blocks` project is the startup project. Click the right mouse button and select `Startup project`.

   <img src="https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-048661c87fd73d61fa44ad57c2857cbac247b47f%2Fblock1.jpg?alt=media" alt="block1" data-size="original">
6. Build configuration is set to `DebugGame_Editor` and `Win64`. Hit F5 to run.

   <img src="https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-153cd4b12bda3fe6de98be72590cf3e51938fb44%2Fblock2.jpg?alt=media" alt="block2" data-size="original">
7. Press the Play button in Unreal Editor and you will see something like in below video. Also see [how to use AirSim](https://github.com/Microsoft/AirSim/#how-to-use-it).

   [![Blocks Demo Video](https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-658dc8b1ec95105d02b03bfaac316413dd893504%2Fblocks_video.png?alt=media)](https://www.youtube.com/watch?v=-r_QGaxMT4A)

### Changing Code and Rebuilding

For Windows, you can just change the code in Visual Studio, press F5 and re-run. There are few batch files available in folder `AirSim\Unreal\Environments\Blocks` that lets you sync code, clean etc.

## FAQ

#### I see warnings about like "\_BuitData" file is missing.

These are intermediate files and you can safely ignore it.
