# Getting Started

## Installation

Simply import the package from the package manager. You can move the TileWorldCreator folder wherever you want inside of your project.

> TileWorldCreator version 3 is a complete rewrite and is therefore not compatible with saved maps from version 2. Tiles made for v2 can be reused for version 3. Version 3 has a completely new and more flexible workflow for creating maps based on different generators and modifiers. This allows you to create and modify maps based on "rules".

## URP & HDRP

To make ours and your lives easier, all Tile preset materials are using the built-in RP.\
If you're using URP or HDRP you can simply upgrade those materials in your project by selecting:

* URP\
  `Edit / Render Pipeline / Universal Render Pipeline / Upgrade Project Materials to UniversalRP Materials`
* HDRP\
  `Edit / Render Pipeline / HD Render Pipeline / Upgrade Project Materials to HDRP Materials`

## AOT Platforms

{% hint style="info" %}
&#x20;API level .Net 4.X is required for all AOT build platforms
{% endhint %}

## Quick start

> Let's create our first map.

{% embed url="<https://www.youtube.com/embed/cscc5_BeY58>" %}

#### Create new asset

1. First create a `TileWorldCreatorAsset` in your project.\
   Right click in the project window and select: `Create -> TileWorldCreator -> New TileWorldCreator Asset`
2. Create a new empty scene and add a new GameObject to your scene.
3. Add the TileWorldCreator component to it.\
   [![quickStart0](https://github.com/doorfortyfour/TileWorldCreator/raw/master/docs/img/twcQuickStart0.gif)](https://github.com/doorfortyfour/TileWorldCreator/blob/master/docs/img/twcQuickStart0.gif)

#### Assign Asset

[![quickstart1](https://github.com/doorfortyfour/TileWorldCreator/raw/master/docs/img/twcQuickStart1.gif)](https://github.com/doorfortyfour/TileWorldCreator/blob/master/docs/img/twcQuickStart1.gif)

1. Assign the newly created `TileWorldCreatorAsset` file to the empty slot of the TileWorldCreator component.
2. Set the map size to 20x20 for example.
3. Click on the `+` button in the blueprint layers stack to create a new layer.

#### Add your first generator

[![quickstart2](https://github.com/doorfortyfour/TileWorldCreator/raw/master/docs/img/twcQuickStart2.gif)](https://github.com/doorfortyfour/TileWorldCreator/blob/master/docs/img/twcQuickStart2.gif)

1. Select the new blueprint layer.
2. Name your layer: `Base` and set a color for the preview texture.
3. Click on the `+` button of the layer action stack and select: `Generators / CellularAutomata`
4. Click on the execute layer button.
5. TileWorldCreator has generated your first map.

> TileWorldCreator executes all layers and their corresponding action stack from top to bottom. [![executionOrder](https://github.com/doorfortyfour/TileWorldCreator/raw/master/docs/img/executionOrder.png)](https://github.com/doorfortyfour/TileWorldCreator/blob/master/docs/img/executionOrder.png)

#### Instantiate tiles

The scene is still quite empty though. Let's instantiate some tiles.\
[![quickstart3](https://github.com/doorfortyfour/TileWorldCreator/raw/master/docs/img/twcQuickStart3.gif)](https://github.com/doorfortyfour/TileWorldCreator/blob/master/docs/img/twcQuickStart3.gif)

1. Add a build layer of type `3D 4-Tiles` to the build layers stack.
2. Name it: Island, for example
3. Let's assign a blueprint layer to it. Select the `Base` layer.
4. Click on `Add Tiles Preset` and assign the cliffs tile preset located in `TileWorldCreator / Tiles / Version 2 Tiles / CliffIsland`
5. Click on `Execute all build layers` or on the `Play` button on the layer.
6. Congratulations your map has been built!

[![quickstart4](https://github.com/doorfortyfour/TileWorldCreator/raw/master/docs/img/twcQuickStart4.gif)](https://github.com/doorfortyfour/TileWorldCreator/blob/master/docs/img/twcQuickStart4.gif)

> Next: Play with different modifiers and tile sets. Also have a look at the demo scenes.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://giantgrey.gitbook.io/tileworldcreator-documentation/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
