> For the complete documentation index, see [llms.txt](https://wise-shepherd-games.gitbook.io/theia-ecs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wise-shepherd-games.gitbook.io/theia-ecs/world.md).

# World

Everything lives on or is created through the world.

The `World` is the container for **everything** in Theia. Every operation in the framework is scoped to a specific `World` instance, and entities cannot cross between worlds.

```csharp
World hoxxes = new World();
```

The constructor accepts an **optional** initial entity capacity, rounded up to the next power of two:

```csharp
World hoxxes = new World(capacity: 4096);
```

Capacity affects only the **initial buffer size**; the world **grows past it** on demand. The default may be suitable for most projects.

A typical setup creates one `World` for the entire game session. Multi-world setups (level transitions, isolated subsystems, test scenarios) instantiate independent `World` instances; **they share no state**.

When the world is no longer needed, dispose it to **tear down the event wiring**:

```csharp
hoxxes.Dispose();
```

Pooled state held inside the world (archetypes, relation storage, deferred queues, etc.) **becomes eligible for garbage collection** when the world itself is no longer reachable.
