armory3d / armory

3D Engine with Blender Integration
https://armory3d.org
zlib License
3.06k stars 315 forks source link

Entity component system #850

Open luboslenco opened 6 years ago

luboslenco commented 6 years ago

Investigate leveling up the current trait system to ECS.

troyedwardsjr commented 6 years ago

I would be interested in helping with this. Pure Entity Component Systems are great, and even Unity is planning on implementing one soon as an isolated part of their engine (https://www.youtube.com/watch?v=EWVU6cFdmr0). It seems to be the current trend as many in the industry are waking up to the massive benefits of this architecture in games.

If anyone is not aware of them, or need to be convinced this is worthwhile, some of the benefits are:

Proper, performant, pure ECS is difficult to implement.

It would be nice to write Haxe CPP externs / WebAssembly bindings through Emscripten for JS (similar to haxebullet) to the library entt (https://github.com/skypjack/entt), which is currently the fastest open source ECS library available in C++ (https://github.com/skypjack/entt#performance), and has proven to be battle tested as it is used in the new C++ version of Minecraft, a multi-billion dollar game. However, due to its metaprogramming / template nature it would be very difficult to write bindings / externs for it as it stands.

I would recommend instead, we would use something like the Haxe library ECX, as it has comparable performance to the C++ libraries, is already cross-platform and has great performance across all targets (https://eliasku.github.io/ecx2_versus.html) using Typed Arrays (https://github.com/eliasku/hotmem).

Let me know if you have any thoughts.

HeadClot commented 6 years ago

Hey - I too would like to echo my support for this feature. I wont be able to help out with programming but I should be able to help out with testing and reporting bugs.

William-Godwin commented 5 years ago

And here is one of the coolest libraries for ECS! I use it myself ^ _ ^

https://github.com/skypjack/entt

zicklag commented 5 years ago

Just a warning about ECX I, just heard from the maintainer that:

currently I have no plans to support ecx/hotmem/hxmake libraries in my spare time, as these libraries are experimental/educational projects.

Just something to keep in mind, not that we might not want to use it still and maintain it with Armory if it is the best library out there.

PDeveloper commented 5 years ago

Hmmm, I could try finalizing where I left Eskimo. Benchmarks were good + using Haxe4 it would be even more viable with its heavy macro use for clean API, but fast performance.

masterneme commented 5 years ago

+1 for EnTT

porky11 commented 5 years ago

I'm not a fan of many inbuilt systems. It seems preferable, when it's possible to import your own ECS somehow. Not sure, if this is possible now.

Filtiarn00 commented 5 years ago

If you do this It will give me no reason to stay with Unity. I love Unity's new Entity Component System over Monobehavours. It makes much more sense. I happy to be a tester and report bugs.

andrewolaughlin commented 5 years ago

@troyedwardsjr What do you think about this new development with EnTT? Does it change anything in regards to what you wrote months ago?

https://github.com/skypjack/entt/wiki/Push-EnTT-across-boundaries

longpinkytoes commented 4 years ago

i need ECS for my main game project :)

skypjack commented 4 years ago

@andrewolaughlin actually, I'm currently moving it forward to a model where you don't have anymore to name your types. It's on the branch experimental and I'm actively working on this part to make everything run across boundaries flawlessly. :+1:

dpomier commented 4 years ago

I think ecso could be a nice candidate too. It is still experimental at this point but presents some advantages, such as strong code-analyses capabilities and it is super simple to use. I will try to build an Armory project with it when I have time. It would theoretically be possible to also plug external implementations as "backend" to offer different runtime, this is something I would like to explore in the future :)