> For the complete documentation index, see [llms.txt](https://machinations.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://machinations.gitbook.io/docs/connections/labels.md).

# Labels

Labels are applied to Connections. Depending on which type of Connections they are used, Labels determine the rate at which Resources flow, or how the diagram's State changes.

## Resource Connections Labels

&#x20;Labels on Resource Connections dictate how Resources flow between Nodes.

Here are the types of Labels supported by Resource Connections:

| **Label Types**  | **Format**         | **Examples**                  |
| ---------------- | ------------------ | ----------------------------- |
| flow rate        | x                  | 0; 2 ; 13; 0.5                |
| random flow rate | Dx; yDx; x%        | D6; 2D5; D3-D2; 20%; 50%      |
| intervals        | x\|y               | 1\|4; 2\|2; D6\|3; D3\|(D6+2) |
| multipliers      | x\*y               | 2\*50%; 3\*D3                 |
| all resources    | all                | all                           |
| description      | description: label | damage: D3                    |

## State Connections Labels

Labels attached to State Connections indicate the effects of state and state changes on other elements in the diagram.

Here are the Label types you can use, and to which types of State Connection they can be applied:

| **Label Types**    | **Format**        | **Examples**             | **Applicable to**                 |
| ------------------ | ----------------- | ------------------------ | --------------------------------- |
| modifiers          | +; -; +x; -x; +x% | +; -; +2; -0.3; +5%; -2% | value modifiers; node modifiers   |
| interval modifiers | +xi; -xi          | +2i; -1i                 | value modifiers                   |
| probabilities      | x%; x             | 20%; 3                   | triggers after a gate             |
| conditions         | ==x; !=x; x; >=x; | ==0; !=2; >=4;           | activators; triggers after a gate |
| range (conditions) | x..y              | 2..5; 4..7               | activators; triggers after a gate |
| trigger maker      | \*                | \*                       | triggers                          |
| reverse trigger    | !                 | !                        | revers triggers                   |

## Intervals

You may want a Node in your diagram to be activated less than every time step.

{% hint style="success" %}
Create flow rates with an interval by using **|** &#x20;

For example, a Source that has an output rate of 1|5 will produce 1 Resource every 5 time steps.
{% endhint %}

**You can use random flow rates with Intervals**. A production rate of D6|3 will produce between one and six Resources every 3 steps.&#x20;

**Intervals can be random as well**. A production rate of 1|(D4+2) indicates that 1 Resource is produced every 3 to 6 steps.&#x20;

{% hint style="info" %}
Random Intervals can be a good way to keep the player’s attention on the game.
{% endhint %}

You can even use a production rate of D6|D6, which indicates between one and six resources are produced every one to six steps.

:wrench: **Intervals can also be modified dynamically.** Label Modifiers that have an `i` as a unit of their modification (for example, +1i or -3i) will change their target’s interval.

![](/files/-MLqthLrYClegyR96QA9)

In the example above, the Difficulty Factor initially increases 1 Difficulty point every 2 running steps (1|2). By adding the Interactive Register with the Label Modifier +1i, we're able to change the interval dynamically, in this case, we modified it to 1 Difficulty point up to every 5 running steps (1|2+3). (Hint: watch the Running Steps count in the gif to track the changes.)

## Combining random flow rates

When working with random flow rates, it is often useful to combine multiple chances into one value. For example, a Source might have two chances of producing a Resource during every time step.

![](/files/-LckzmNj15eQxlawCWMF)

The two constructions are equivalent, but the one on the right is less cluttered. If you need to use different probabilities, however, you will have to create a construction like the one on the left.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://machinations.gitbook.io/docs/connections/labels.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.
