Svelto.ECS
3.2.5
See the version list below for details.
dotnet add package Svelto.ECS --version 3.2.5
NuGet\Install-Package Svelto.ECS -Version 3.2.5
<PackageReference Include="Svelto.ECS" Version="3.2.5" />
paket add Svelto.ECS --version 3.2.5
#r "nuget: Svelto.ECS, 3.2.5"
// Install Svelto.ECS as a Cake Addin #addin nuget:?package=Svelto.ECS&version=3.2.5 // Install Svelto.ECS as a Cake Tool #tool nuget:?package=Svelto.ECS&version=3.2.5
Svelto Entity Component System 3.x
=====================================
Real ECS framework for c#. Enables to write encapsulated, decoupled, maintainable, highly efficient, data oriented, cache friendly, code without pain. Although the framework is platform agnostic (compatible with c# 7 and .net standard 2.0), it comes with several Unity extensions.
Why using Svelto.ECS with Unity?
Svelto.ECS wasn't born just from the needs of a large team, but also as a result of years of reasoning behind software engineering applied to game development. Svelto.ECS hasn't been written just to develop faster code, it has been designed to help develop better code. Performance gains is just one of the benefits in using Svelto.ECS, as ECS is a great way to write cache-friendly code. Svelto.ECS has been developed with the idea of ECS being a paradigm and not just a pattern, letting the user shift completely away from Object Oriented Programming with consequent improvements of the code design and code maintainability. Svelto.ECS is the result of years of iteration of the ECS paradigm applied to real game development with the intent to be as foolproof as possible. Svelto.ECS has been designed to be used by a medium-size/large team working on long term projects where the cost of maintainability is relevant. Svelto.ECS can be educative for all kind of developers, but small teams must take in consideration the learning curve/cost of ECS in general and Svelto.ECS in particular.
Svelto.ECS is also fully compatible with DOTS and Svelto.ECS code can be fully burstied and jobified.
Svelto.ECS is compatible with Unity 2019.3.x cycle as long as it's not used with DOTS ECS. If DOTS ECS integration is necessary, Svelto.ECS will always target the last stable unity version using DOTS.
Why using Svelto.ECS without Unity?
The question is just for fun! There are so many c# game engines out there (Stride, Monogame, FlatRedBall, WaveEngine, UnrealCLR, UniEngine just to mention some) and Svelto.ECS is compatible with all of them!
How to clone the repository:
The folders Svelto.ECS and Svelto.Common, where present, are submodules pointing to the relative repositories. If you find them empty, you need to update them through the submodule command. Check some instructions here: https://github.com/sebas77/Svelto.ECS.Vanilla.Example/wiki
Svelto distributed as Unity Package through OpenUPM
read this article for more information: http://www.sebaslab.com/distributing-svelto-through-openupm/ or just install the package that comes from the link https://package-installer.glitch.me/v1/installer/OpenUPM/com.sebaslab.svelto.ecs?registry=https%3A%2F%2Fpackage.openupm.com
Note on the System.Runtime.CompilerServices.Unsafe.dll dependency and the bit of a mess that Unity Package Dependency System is:
Unity Package System has a big deficiency when it comes to dll dependency solving: two packages cannot point to the same dependency from different sources. Since Unity Collection removed the Unsafe.dll dependency, I had to distribute my own package. This means that if you want to use Svelto from UPM, you will need Svelto unsafe dll to be the only unsafe dll in the project. Otherwise you just download the source code and solve dependencies manually.
Svelto distributed as Nuget
I am not a Nuget expert, but thanks to our contributors, Svelto.ECS can be found at https://www.nuget.org/packages/Svelto.ECS/
Official Examples (A.K.A. where is the documentation?)
Svelto doesn't have official documentation. The reason is that documentation is costly to mantain and...I reckon people don't need it, thanks to the highly documented and simple mini-examples. Please check and study them all regardless the platform you intend to use Svelto with.
* Mini Examples: https://github.com/sebas77/Svelto.MiniExamples (including articles)
- Unit Tests: https://github.com/sebas77/Svelto.ECS.Tests
After that, you can get all the help you need from the official chat:
Official Discord Server (join to get help from me for free!)
Official Articles
Framework articles:
- Svelto ECS 3.0 is finally here (re-introducing svelto, this article is important for starters!)
- Introducing Svelto ECS 2.9 (shows what's changed since 2.8)
- Introducing Svelto ECS 2.8 (shows what's changed since 2.7)
- Svelto.ECS 2.7: what’s new and best practices (shows what's changed since 2.5)
- Introducing Svelto ECS 2.5 (shows what's changed since 2.0)
- Svelto.ECS 2.0 is production ready (shows what's changed since 1.0)
- Svelto ECS is now production ready
Theory related articles (in order of publishing date):
- OOP abstraction layer in an ECS-centric application (this article is important for starters!)
- Inversion of Control with Unity – part 1
- Inversion of Control with Unity – part 2
- The truth behind Inversion of Control – Part I – Dependency Injection
- The truth behind Inversion of Control – Part II – Inversion of Control
- The truth behind Inversion of Control – Part III – Entity Component System Design
- The truth behind Inversion of Control – Part IV – Dependency Inversion Principle
- The truth behind Inversion of Control – Part V – Entity Component System design to achieve true Inversion of Flow Control
- The Quest for Maintainable Code and The Path to ECS
Practical articles
- Svelto.ECS Internals: How to avoid boxing when using structs with reflection
- Svelto ECS 3.0 Internals: profiling the Entity Collection
- Svelto ECS 3.0 Internals: Support Native Memory Natively
- Svelto MiniExamples: GUI and Services Layer with Unity
- Svelto Mini (Unity) Examples: Doofuses Must Eat
- Svelto Mini Examples: The Unity Survival Example
- Learning Svelto.ECS by example – The Vanilla Example
- Porting a boid simulation from UnityECS/Jobs to Svelto.ECS/Tasks
- Svelto.ECS+Tasks to write Data Oriented, Cache Friendly, Multi-Threaded code
Note: I included the IoC articles just to show how I shifted over the years from using an IoC container to use an ECS framework and the rationale behind its adoption.
Users Generated Content (I removed all the outdated articles, so this is a call for new ones!)
In case of bugs
Best option is to fork and clone https://github.com/sebas77/Svelto.ECS.Tests, add new tests to reproduce the problem and request a pull. I will then fix the issue. Also feel free to contact me on Discord.
The Github wiki page
Completely outdated and could even mislead. Feel free to update it if you have a good understanding of Svelto! I decided I won't update it anymore as it's better for me to focus on other parts of Svelto development. If you need any help, you will need to join the aforementioned discord server.
I like the project, how can I help?
Hey, thanks a lot for considering this. You can help in several ways. The simplest is to talk about Svelto.ECS and spread the word, the more we are, the better it is for the community. Then you can help with the documentation, updating the wiki or writing your own articles. Svelto.ECS has all the features needed to make a game with the ECS pattern, but some areas are lacking: A visual debugger and more unit tests are needed. Other platforms other than Unity could get some love too: Stride Game, Godot, monogame, FNA or whatever supports c#. Porting to other languages, especially c++, would be awesome but probably pointless. Please check the lane dedicated to the community tasks list here: https://github.com/users/sebas77/projects/3 and let me know if you want to take something on!
Svelto Framework is used to develop the following products(*):
*If you want your products made with Svelto here, just send me an email or whatever, I'll be super happy to add them.
Note: Dear Svelto Users : Although I am committed to help you and write articles as much as I can, I will never be able to keep all the documentation up to date. If you are a happy svelto user and you want to contribute, please feel free to update the github wiki! 🙏👊
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Svelto.ECS:
Package | Downloads |
---|---|
Svelto.ECS.Schema
Package Description |
|
AkroGame.ECS.Inspector
API for Svelto ECS Inspector tool |
|
AkroGame.ECS.Websocket
Package Description |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Svelto.ECS:
Repository | Stars |
---|---|
Doraku/Ecs.CSharp.Benchmark
Benchmarks of some C# ECS frameworks.
|
Version | Downloads | Last updated |
---|---|---|
3.5.2 | 123 | 7/14/2024 |
3.5.1 | 256 | 1/7/2024 |
3.5.0-pre | 182 | 9/17/2023 |
3.4.6 | 465 | 5/1/2023 |
3.4.5 | 372 | 4/3/2023 |
3.4.4 | 234 | 4/1/2023 |
3.4.3 | 303 | 3/18/2023 |
3.4.2 | 260 | 3/6/2023 |
3.4.1 | 246 | 3/5/2023 |
3.4.0 | 250 | 3/4/2023 |
3.3.2 | 1,121 | 6/4/2022 |
3.3.1 | 882 | 4/26/2022 |
3.3.0 | 458 | 4/11/2022 |
3.2.5 | 3,043 | 10/10/2021 |
3.2.4 | 305 | 10/6/2021 |
3.2.3 | 292 | 10/6/2021 |
3.2.2 | 300 | 10/4/2021 |
3.1.3 | 304 | 1/15/2021 |
3.1.2 | 218 | 1/15/2021 |
3.1.1 | 223 | 1/15/2021 |
3.1.0 | 489 | 1/10/2021 |