# Pak Loading

Check here to learn how REPak works and how to build a rpak.

### Pak Types and Load Paths

**RPAK** loading behavior depends on the server type:

* Client / Listen Server
  * Loads `.rpak` files from the `paks/Win64` folder.
  * These files must include **all dependencies** required for loading.
  * If any `.starpak` files are associated, they **must** also be included.
* Dedicated Server
  * Loads `.rpak` files from the `paks/Win64_Server` folder.
  * Server only `.rpak` files should exclude unnecessary assets such as textures, materials, and UI assets.
    * Avoid using client rpaks on dedicated servers. Doing so will increase memory usage and slow down load times.
  * `.starpak` files are **not required** for dedicated server.

### Loading RPAK Files

The SDK supports two methods for loading `.rpak` files:

* Preloaded Rpaks
  * These `.rpak` files are loaded during the first map load and **remain loaded for the entire session**.
  * To designate `.rpak` files as preloaded, a `preload.rson` file is required in the same directory.

#### Preload.rson Format:

```yaml
Paks:
[
    common_sdk.rpak,
    example2.rpak,
    ui_sdk.rpak
]
```

* Playlist Controlled Rpaks
  * These `.rpak` files are dynamically loaded/unloaded based on the selected playlist and level changes.
  * To use this system, specify the `.rpak` and related playlist names in the `mod.vdf` file.

{% hint style="warning" %}
The structure and usage of mod.vdf are described on the previous page.
{% 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://docs.r5reloaded.com/pak-loading.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.
