> ## Documentation Index
> Fetch the complete documentation index at: https://docs.directgvr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create delta update paths

> Use update_path.py to create byte-level deltas between releases on your build machine or through the Delta API.

Delta update paths are the byte-level differences between two releases. They're much smaller to download than block-level updates. You can create them on your own build machine or have the cloud-based Delta API create them. This page uses [update\_path.py](https://docs.directgvr.com/release-automation/deployment-scripts.md#update_path-py).

## Requirements

* At least two releases deployed to the same repository. See [Deploy a release](https://docs.directgvr.com/release-automation/deploy-a-release.md).

## Choose the target release

The target is the release players update to. Previous releases with a delta can update to it. Choose it with one of:

* `latest`: the most recently deployed release in the repository.
* `target_description`: the description you gave the release when deploying, for example `"Game Client Data Files version 1.0.88"`.
* `target_id`: the release ID (SHA1) from `tracker.json`, for example `149266e3f92cdc3173e4992911cc21c3cfdc809c`.
* `target_version`: the version you gave the release when deploying, for example `"1.0.88"`.

## Choose the source releases

Sources are the releases players update from. Choose them with one of:

* `sources_built_after`: a Unix timestamp. Every release after it, except the target, is a source. For example, `1582936330` is February 29, 2020 12:32:10 AM GMT.
* `source_id`: a release ID (SHA1) from `tracker.json`.
* `sources_before_target`: the number of releases deployed just before the target. With `5` and target version 10, versions 9, 8, 7, 6 and 5 are sources.
* `sources_recent`: the number of most recent releases, ignoring the target. With `5`, 20 releases deployed and target 10, versions 20, 19, 18, 17 and 16 are sources.
* `sources_within`: a time window back from now. For example, `604800` seconds uses every release from the last 7 days. The target is ignored.

You also need `repository` and `sync_directory`.

## Choose where deltas are created

Set `update_process`:

* `console` (default): the Console tools in your release package create deltas on your build machine.
* `API`: the Solid State Networks Delta API on AWS creates them.

### On your build machine

Your build machine can read releases from your CDN and write deltas back to it, as long as you've [configured access to your remote locations](https://docs.directgvr.com/release-automation/configure-server-or-cdn.md). Speed is then limited by your network, CPU and memory.

If your data is on a disk on the build machine, only CPU and memory limit the speed, which is much faster. After the deltas are built, copy them to your CDN with `release_copy.py` or `repository_sync.py`. We recommend this if you use your build machine for deltas.

> [!NOTE]
>
> On your build machine, update paths are built one after another so each gets as much CPU and memory as possible. The Delta API builds them in parallel because it scales automatically.

### Through the Delta API

The Delta API needs access to your data. The configuration file in `console_config` must pass credentials for your CDN or S3 bucket to the service, and your license must include delta creation through the API. Speed depends mostly on how fast the service can read files from your server or CDN. S3 buckets are usually fastest because they're in AWS.

> [!WARNING]
>
> You can't use a local path on your build machine, such as `c:/deployments/game/`, as `sync_directory` with the Delta API. The API can't reach it and the process fails.

## Example configuration

This configuration reads from and writes to an S3 bucket, uses the Delta API, and creates update paths 15 to 18, 16 to 18 and 17 to 18 for the `llama-game` repository:

```json theme={null}
{
  "sync_directory": "s3://<bucket>/<path>/",
  "repository": "llama-game",
  "target_version": "18.0.003",
  "sources_before_target": 3,
  "update_process": "API"
}
```

Run `update_path.py` with the configuration file or the same values as command-line arguments.

## What the script does

The script shows the target release ID and each source release ID. With the Delta API, it shows progress lines from the service and checks until each step finishes.

For every update path, it:

1. Creates indexes for the source releases.
2. Creates masks.
3. Creates deltas.
4. Creates the catalog, the file the launcher uses for the mask and delta information.

How long it takes depends on the number of deltas, the release size, each delta's size and, for the API, how fast it can read your data. The message `Update path complete for source ID...` means the update paths were created.

## Related

* [Create environments and promote releases](https://docs.directgvr.com/release-automation/environments-and-promotion.md)
* [Can DirectGVR decrease your patch sizes?](https://docs.directgvr.com/release-automation/patch-sizes.md)
* [Updates without a delta](https://docs.directgvr.com/release-automation/updates-without-delta.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.