World
The World, the place where all Entities live.
The world stores all its entities, it contains methods to create, destroy and query them and handles all the internal mechanics. Therefore it is the most important class, you will use the world heavily. Time to play God.
Lifecycle
var world = World.Create(); // Creating a world full of life
world.TrimExcess(); // Frees unused memory
world.Dispose(); // Clearing the world like God in the First Testament
World.Destroy(world); // Doomsday
Best of all, you can create any number of worlds with almost infinite entities. You rarely have so much life and freedom. To be precise,2,147,483,647
worlds with 2,147,483,647
entities each are possible.
Customize
You can also customize the world a little to suit your needs, for example the initial capacity or how big the chunks
should be:
var customizedWorld = World.Create(
chunkSizeInBytes: 16_382, // The base size of each chunk
minimumAmountOfEntitiesPerChunk: 100, // The base amount of entities per chunk
archetypeCapacity: 8, // The initial size of the archetype array
entityCapacity: 64 // The initial amount of entities
);
Good to know
Now we have a world. A world with all the prerequisites for creating life, changing it and destroying it.
The world has the rudimentary methods on which everything in Arch is based. If you only want to work with them, this is possible and offers one less level of abstraction.
And much more...
Working with Events, the CommandBuffer or several other features directly!
We'll go into more detail later. But now enough talk, go on. Something is lurking behind the next bush.
Last updated
Was this helpful?