> For the complete documentation index, see [llms.txt](https://organized-chaos.gitbook.io/organized-chaos-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://organized-chaos.gitbook.io/organized-chaos-docs/quackmobil/graphics-presets-and-performance.md).

# Graphics presets and performance

The three graphics presets, what each value does and how to keep the load low.

A graphics preset decides how far away ducks are animated, how often they update and which effects are drawn. The server sets a default, and players can pick their own.

## Choosing a preset

| Option                     | Default          | Meaning                                                                                                                          |
| -------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Preset`            | `'balanced'`     | Default preset for all players: `'performance'`, `'balanced'` or `'quality'`                                                     |
| `Config.AllowPlayerChoice` | `true`           | Players may pick their own preset with `/quackquality`. It is saved on their computer                                            |
| `Config.QualityCommand`    | `'quackquality'` | Name of that command                                                                                                             |
| `Config.Override`          | `{}`             | Overrides single values of **every** preset. `{ Feathers = 0 }` disables feathers for everyone, whatever preset a player chooses |

## What the presets contain

The presets are in `Config.Presets`. You can change the values or add presets of your own.

| Value            | performance | balanced                  | quality               | Meaning                                                                                                |
| ---------------- | ----------- | ------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------ |
| `PropDistance`   | 150         | 300                       | 400                   | Metres up to which ducks get head, wings and feet. Beyond it they are drawn without them               |
| `DetailDistance` | 50          | 120                       | 250                   | Metres up to which head and feet are animated. Beyond it they hold still, and only flapping wings move |
| `UpdateRates`    | 30 / 15 / 8 | every frame / 30 / 15 / 8 | every frame / 30 / 15 | Animation updates per second, by distance from the camera                                              |
| `OwnDuckRate`    | 60          | every frame               | every frame           | Updates per second for your own duck                                                                   |
| `IdleLookAround` | off         | on                        | on                    | The head looks around while standing with a driver                                                     |
| `FootTapping`    | off         | on                        | on                    | A foot taps impatiently while standing                                                                 |
| `ScanInterval`   | 2000        | 1000                      | 1000                  | Milliseconds between two searches for new ducks                                                        |
| `LightDistance`  | 60          | 120                       | 200                   | Metres up to which the eye lights of other ducks are drawn. Your own are always drawn                  |
| `EyeLightSpots`  | 1           | 1                         | 2                     | `1` is one light cone from between the eyes, `2` one cone per eye                                      |
| `EyeGlow`        | off         | on                        | on                    | A visible glow inside the eyes                                                                         |
| `Feathers`       | 5           | 10                        | 16                    | Feathers per crash. `0` switches them off                                                              |

### Update rates

`UpdateRates` is a list of distance bands. Each entry is `{ up to metres, updates per second }`, and `0` means every frame:

```lua
UpdateRates = { { 35.0, 0 }, { 80.0, 30 }, { 150.0, 15 }, { math.huge, 8 } },
```

| Preset      | Bands                                                                      |
| ----------- | -------------------------------------------------------------------------- |
| performance | 30 per second up to 25 m, 15 up to 60 m, 8 beyond                          |
| balanced    | Every frame up to 35 m, 30 per second up to 80 m, 15 up to 150 m, 8 beyond |
| quality     | Every frame up to 80 m, 30 per second up to 200 m, 15 beyond               |

## What keeps the load low

* **Parked ducks without a driver cost nothing.** Their animation pauses until someone gets in, they get hit, they quack or they take off.
* **Ducks off screen** are not animated.
* **Ducks beyond `DetailDistance`** pause entirely. Only flapping wings in flight still move.
* **Distant ducks** update less often, independent of the player's frame rate.
* **The horn** costs nothing per frame with `Config.Horn.KeyMapping = true`.
* **The models** have several detail levels.
* **Swimming** is the game's own physics. The water drive only runs while a player drives a duck in water.

## For weak computers

Force the performance preset for everyone:

```lua
Config.Preset = 'performance'
Config.AllowPlayerChoice = false
```

For the lowest possible load, turn the ducks into plain vehicles:

```lua
Config.SimpleMode = true
```
