# Save File Setup

Save File Setup is the main component you will be working with. This component will work exactly as it's named; it will create a save file in the user's system that you can save and load data from.

<figure><img src="/files/X67A532i7MRCUXZmfMUT" alt=""><figcaption><p>Save file setup component</p></figcaption></figure>

#### File Name

The name of the file that will be saved in the player's system.

#### Save Location

There are 2 common locations that you can store player files.

1. **Persistent Data Path:** a directory path where data expected to be kept between runs can be stored.
2. **Data Path:** the path to the game data folder on the target device.

{% hint style="info" %}
It's generally recommended to use persistent data path. Data path may not work on all platforms; however, it is good for testing purposes, as the save file will be stored in the Unity project.
{% endhint %}

#### File Path

This is the extra path after the save location path. For example, in the above image, the file `URP_Example_Save` will be stored in the path `StylishEsper/ESave/Example` in the game's data folder.

#### File Type

The file type determines the saved data format and the file extension. Currently, only the JSON format is supported.

#### Encryption Method

Only the AES encryption algorithm is supported at this time. The default option is no encryption.

#### AES  Key and IV

The key and IV are used for the AES algorithm. You can click the 'Generate AES Tokens' button to generate a random token for both.

#### Add to Storage

If add to storage is checked, the save file will be added to the save storage.

#### Background Task

If background task is checked, both saving and loading operations will be executed in a background thread instead of the main thread. This is great to use if you have a large save file.

{% hint style="warning" %}
If you need something to happen after saving and loading is done, and if 'background task' is checked, make sure to wait for the operation to complete first. [Learn more here.](/esave/scripting/understanding-background-save-and-load.md)
{% endhint %}


---

# 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://espergames.gitbook.io/esave/getting-started/components/save-file-setup.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.
