Stride Forums Archive

Is it possible to incorporate ECS pattern with Xenko engine?

14 posts, 9164 views, 2018-08-16 to 2020-03-24

starikcetin 2018-08-16 #1

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.

RobertCampbell (Robert Campbell) 2018-08-19 #2

Yes, Xenko implements ECS.

starikcetin 2018-08-20 #3 in reply to #2

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?

RobertCampbell (Robert Campbell) 2018-08-20 #4 in reply to #3

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.

starikcetin 2018-08-20 #5 in reply to #4

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

sebas77 (Sebastiano Mandalà) 2018-08-21 #6 in reply to #5

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:

Kryptos (Nicolas Musset) 2018-08-21 #7 in reply to #6

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

tonfilm 2018-08-21 #8

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

tonfilm 2018-08-22 #9

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?

xen2 (Virgile) 2018-08-23 #10 in reply to #9

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

sebas77 (Sebastiano Mandalà) 2018-08-23 #11

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.

starikcetin 2018-09-06 #12 in reply to #10

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

Eideren 2020-03-24 #16

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.

Kryptos (Nicolas Musset) 2020-03-24 #17 in reply to #16

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