PURE_ECS
PURE_ECS, making your entities even slimmer and faster.
Last updated
Was this helpful?
PURE_ECS, making your entities even slimmer and faster.
Last updated
Was this helpful?
Entities contain some meta data by default to make it easier for you as a developer. If you leave them out, however, you can still squeeze out some performance.
This is where PURE_ECS
comes into play. This is a way of reducing the empty size of each to just 4 bytes! The way to make your even more efficient! This means that even more entities fit into each individual chunk, which means that your queries process the entities even more efficiently. All entity operations speed up automatically. You want to bring millions of entities into battle? You can!
How do you do that, you ask? It takes a bit of work, but it's worth it.
As this feature is based on C# preprocessor flags, you first need the source. You must therefore include in your project and cannot use the Arch nugget. The best way to do this is to . Once you've done that, you only have to do one thing.
Now you have your fork with PURE_ECS
as preprocessor flag. To use this in your own project, you only need to do one more thing. Remove Arch as nuget and add your own Arch fork to your own project to enjoy the new features.
How you integrate this is up to you. You can copy your Arch fork manually into your project, for example. What I recommend, however, are . This way you can simply integrate your own Arch fork into your project using Git.
So now you have Arch with Pure_ECS
in your project... what now? Firstly, you should notice that you can no longer work directly on the struct. This is intentional, the entity has been minimised and no longer knows which world it is in. You have to adapt and tell it yourself!
Nothing else changes. Almost a free optimisation... Pretty cool, isn't it?
All methods of the struct are no longer available with PURE_ECS
. So you can no longer do this.
Instead, you now have to work entirely with the . And always tell the world on which entity you want to execute what. All methods that were originally available in the are also accessible in the world.