# State Factory

In this documentation, we will be covering installation, usages within the game, and some examples to see how the vision of State Factory comes to life.

## What is a Finite State Machine?

Finite State Machines (FSM) have been an efficient and popular method within the FTC Community for use in both autonomous and tele-operated sequences. This is because FSMs allow for multiple *actions* to run at the same time within one *state*. Essentially, a finite state machine is a collection of states where in each state something different may execute and it can transition to another state.&#x20;

More detail can be found at [https://gm0.org](https://gm0.org/en/latest/docs/software/concepts/finite-state-machines.html).

***

<figure><img src="/files/2SwLOuVPwvJzSNPV6A2t" alt=""><figcaption><p><strong>A diagram of the finite state machine used by team</strong> <a href="https://www.wolfpackmachina.com/"><strong>18438 Wolfpack Machina</strong></a><strong>.</strong></p></figcaption></figure>

***

{% hint style="info" %}
A key feature of a finite state machine is the ability to run in a non-linear order. This means that your autonomous can go back to previous states/steps, allowing for a much more adaptive system.
{% endhint %}

***

Credits: Vikram - Don't Blink & Adam - Phantom

We wanted to give a special thank you to Noah who created Jotai, the main inspiration behind this project, and Wolfpack Machina who showed us the potential behind these systems. \
\
If you have more questions or have some recommendations that should be added, feel free to reach out to <mark style="color:red;">@.vvk.</mark> or <mark style="color:blue;">@doublebubble\_</mark> on Discord.


---

# 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://state-factory.gitbook.io/state-factory/state-factory.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.
