Is it possible to incorporate ECS pattern with Xenko engine?

As you may know, Unity is implementing ECS pattern to the core engine. But they are leaving the community in darkness all the time, I don’t like it.

  1. Does Xenko have built-in support for the ECS pattern?
  2. If not, can I plug-and-play a .Net ECS library such as Artemis CSharp? How hard would it be?

Thanks.

Yes, Xenko implements ECS.

I took a quick look at the documentation but I can’t find anything about ECS implementation of Xenko. Can you link me the relevant parts of the documentation?

I don’t know about the documentation but the best I can provide is the source code reference:

https://github.com/xenko3d/xenko/tree/master/sources/engine/Xenko.Engine/Engine

You can see a few components and game systems implemented.

The documentation is lacking right now: https://doc.xenko.com/latest/en/manual/engine/entity-component-model/index.html but the source code is a good reference.

Hmm, I was looking for a more DOD ECS. Thanks for your help, regardless.

Funny enough I just wrote this on reddit: https://www.reddit.com/r/xenko/comments/991pm7/sveltoecs_on_xenko/

please let me know if you are interested in helping me making it work with Xenko :slight_smile:

Funny enough I just wrote a comment on reddit :slight_smile:

2 Likes

Funny enough I just wrote a custom component for xenko in the root render feature demo repository:

however, i have a question here for @xen2:
how does the xenko entity component system relate to the new ways of dealing with composition and multi threading as described here in the unity intro videos? what they are doing is basically laying the data out in a cache friendly way and then run parallelized jobs on it. is this already possible in the xenko engine, or how does it relate to xenkos approach to multi threading?

We have the System part of the ECS to easily get list of given component and parallelize their processing if needed.
Example: https://github.com/xenko3d/xenko/blob/0669deabfe65a04f80041433420f0ace0ad5ca9a/sources/engine/Xenko.Engine/Engine/Processors/TransformProcessor.cs#L102

What we don’t have yet is cache localized data, and maybe it could be reorganized better to be job friendly.
However, cache localized array is something we already do in the RenderFeature layer, and the idea was to do something similar for the ECS at some point (and rearchitecture some part of it to be more efficient).

I have just added an Epic to cover that: https://github.com/xenko3d/xenko/issues/132

I leave it here in case you are interested, but with Svelto.ECS my main goal is not just performance. I see adopting ECS as a shift of paradigm from Object Oriented Programming which let easily to write modular, testable and maintainable code. The github page links to all my articles in case you want to know more.

Can I use this existing ECS to write my game logic? Is there any editor support for it?

Just to clarify a bit Kryptos’ latest reply as people have been mis-interpreting it on Discord, he is referring to ‘Aman_Deep’'s reply (as you can see on the upper-right of that reply), which was removed from this thread, not tonfilm/tebjan’s unity video.

2 Likes

Looks like it could be confusing. I will remove my reply then. (along that message once you have seen it).