www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Bubel ECS - Entity-Component-System architecture implementation

reply Mergul <wismerchil interia.eu> writes:
Hello everyone, I'm glad to announce release of my Bubel ECS 
library.

Bubel ECS is Entity-Component-System architectural pattern 
implementation in D language.
Library aims to delivery fast and flexible architecture for 
developing games. It's  nogc and betterC compatible. WASM is 
supported through Emscripten. Library has no external 
dependencies and was tested on Linux, Windows, Android and WASM.
Project was developed in data oriented designed fashion and 
supports multithreading with automatic job generation. For more 
information go to Gitlab repository page.

Its beta version but core is fully functional and finished. I 
have planned some bigger features like Worlds support, better 
events handling or even C-API which can lead to some changes in 
API.

If you want try Bubel ECS I prepared demo which works in browers 
through WASM (Emscripten) and even supports multithreading (on 
Chromium based browsers, Firefox had some performance issues even 
on single threaded version when last tested)
Demo is still WIP and it can be hard to understad how it works 
(how to use its features). There is possibility to enable/disable 
almost all systems in runtime and changing components and data 
for all entities. All components and systems are exact 
representation of what they are in code.

I'm using Gitlab CI for automated testing (betterC testing 
included)

Note: Library support multithreading but has no code for actual 
parallel execution, it only generates jobs and dependencies. In 
demos I'm using mmutils.thread_pool (my brother's library) .I 
will add simple integration code for it in near future for people 
who wants multithreading working out-of-the-box.

Dub: https://code.dlang.org/packages/bubel_ecs
Gitlab: https://gitlab.com/Mergul/bubel-ecs
Documentation: https://mergul.gitlab.io/bubel-ecs/ecs.html
Wiki: https://gitlab.com/Mergul/bubel-ecs/-/wikis/home (WIP I've 
started making tutorial there)
Online demo: https://mergul.gitlab.io/bubel-ecs/ecs_demo.html
Mar 08
next sibling parent drug <drug2004 bk.ru> writes:
On 3/8/21 10:45 PM, Mergul wrote:
 Hello everyone, I'm glad to announce release of my Bubel ECS library.
 
 Bubel ECS is Entity-Component-System architectural pattern 
 implementation in D language.
 Library aims to delivery fast and flexible architecture for developing 
 games. It's  nogc and betterC compatible. WASM is supported through 
 Emscripten. Library has no external dependencies and was tested on 
 Linux, Windows, Android and WASM.
 Project was developed in data oriented designed fashion and supports 
 multithreading with automatic job generation. For more information go to 
 Gitlab repository page.
 
 Its beta version but core is fully functional and finished. I have 
 planned some bigger features like Worlds support, better events handling 
 or even C-API which can lead to some changes in API.
 
 If you want try Bubel ECS I prepared demo which works in browers through 
 WASM (Emscripten) and even supports multithreading (on Chromium based 
 browsers, Firefox had some performance issues even on single threaded 
 version when last tested)
 Demo is still WIP and it can be hard to understad how it works (how to 
 use its features). There is possibility to enable/disable almost all 
 systems in runtime and changing components and data for all entities. 
 All components and systems are exact representation of what they are in 
 code.
 
 I'm using Gitlab CI for automated testing (betterC testing included)
 
 Note: Library support multithreading but has no code for actual parallel 
 execution, it only generates jobs and dependencies. In demos I'm using 
 mmutils.thread_pool (my brother's library) .I will add simple 
 integration code for it in near future for people who wants 
 multithreading working out-of-the-box.
 
 Dub: https://code.dlang.org/packages/bubel_ecs
 Gitlab: https://gitlab.com/Mergul/bubel-ecs
 Documentation: https://mergul.gitlab.io/bubel-ecs/ecs.html
 Wiki: https://gitlab.com/Mergul/bubel-ecs/-/wikis/home (WIP I've started 
 making tutorial there)
 Online demo: https://mergul.gitlab.io/bubel-ecs/ecs_demo.html
 
Nice package! I'm glad you publish it
Mar 08
prev sibling next sibling parent reply Meta <jared771 gmail.com> writes:
On Monday, 8 March 2021 at 19:45:58 UTC, Mergul wrote:
 Hello everyone, I'm glad to announce release of my Bubel ECS 
 library.

 Bubel ECS is Entity-Component-System architectural pattern 
 implementation in D language.
 Library aims to delivery fast and flexible architecture for 
 developing games. It's  nogc and betterC compatible. WASM is 
 supported through Emscripten. Library has no external 
 dependencies and was tested on Linux, Windows, Android and WASM.
 Project was developed in data oriented designed fashion and 
 supports multithreading with automatic job generation. For more 
 information go to Gitlab repository page.

 Its beta version but core is fully functional and finished. I 
 have planned some bigger features like Worlds support, better 
 events handling or even C-API which can lead to some changes in 
 API.

 If you want try Bubel ECS I prepared demo which works in 
 browers through WASM (Emscripten) and even supports 
 multithreading (on Chromium based browsers, Firefox had some 
 performance issues even on single threaded version when last 
 tested)
 Demo is still WIP and it can be hard to understad how it works 
 (how to use its features). There is possibility to 
 enable/disable almost all systems in runtime and changing 
 components and data for all entities. All components and 
 systems are exact representation of what they are in code.

 I'm using Gitlab CI for automated testing (betterC testing 
 included)

 Note: Library support multithreading but has no code for actual 
 parallel execution, it only generates jobs and dependencies. In 
 demos I'm using mmutils.thread_pool (my brother's library) .I 
 will add simple integration code for it in near future for 
 people who wants multithreading working out-of-the-box.

 Dub: https://code.dlang.org/packages/bubel_ecs
 Gitlab: https://gitlab.com/Mergul/bubel-ecs
 Documentation: https://mergul.gitlab.io/bubel-ecs/ecs.html
 Wiki: https://gitlab.com/Mergul/bubel-ecs/-/wikis/home (WIP 
 I've started making tutorial there)
 Online demo: https://mergul.gitlab.io/bubel-ecs/ecs_demo.html
Awesome! In the demo, I noticed that if there are >3000 entities spawned, there will be periodic dips in the FPS. Could this be Javascript's GC kicking in?
Mar 09
parent reply Mergul <wismerchil interia.eu> writes:
On Tuesday, 9 March 2021 at 14:29:37 UTC, Meta wrote:
 Awesome! In the demo, I noticed that if there are >3000 
 entities spawned, there will be periodic dips in the FPS. Could 
 this be Javascript's GC kicking in?
What browser are you using? I've tested couple of browsers. In general JavaScript shouldn't be a problem, from what I know WASM only growth its memory. Library itself almost never call malloc (so memory is always allocated). On firefox I had problem with FPS most of a time and I'm not sure what cause this problem (I found several bug reports which could be related to that). Besides Firefox every web browser I tested was based on chromium engine. I didn't see any periodic dips, even with <200k entities. Maybe there is some problem related to WebGL or JS Workers. When JS side detects that WASM threads are enabled in browser it loads multithreaded version of WASM code and spawn workers. But overall multithreaded execution is always more stable for me. Another thing is that application has to work in the "unblocking" way. It means that main thread has to release control to web browser every frame and browser sometime takes more CPU time. And last thing, I'm not specialist in web technologies so it could be something else what I'm not aware of :)
Mar 09
next sibling parent reply ryuukk_ <ryuukk_ gmail.com> writes:
That's impressive, and shows the D capabilities, the future is 
WASM!!! glad to see D ready for it!

I'm working on a similar project, thanks for sharing, it'll be 
very helpful for me!
Mar 09
parent reply Meta <jared771 gmail.com> writes:
On Tuesday, 9 March 2021 at 16:36:31 UTC, ryuukk_ wrote:
 That's impressive, and shows the D capabilities, the future is 
 WASM!!! glad to see D ready for it!
Yes, I forgot to mention this, but WASM support out of the box is awesome!
Mar 09
parent Mergul <wismerchil interia.eu> writes:
On Tuesday, 9 March 2021 at 21:01:07 UTC, Meta wrote:
 On Tuesday, 9 March 2021 at 16:36:31 UTC, ryuukk_ wrote:
 That's impressive, and shows the D capabilities, the future is 
 WASM!!! glad to see D ready for it!
Yes, I forgot to mention this, but WASM support out of the box is awesome!
I have to note that for clarification. D can be compiled to WASM only using betterC switch (as nor Phobos or Druntime can be compiled to WASM). For demo I also used SDL2 which also supports Emscripten target. From my side to support WASM I had to remove D's TLS from code (in demo I used pthread_key as replacement), implement atomic operations using Emscripten API, write stdc bindings and my little std library (allocators). While targeting WASM core.stdc.* modules can't be used as they have no WASM implementation.
That's impressive, and shows the D capabilities, the future is 
WASM!!! glad to see D ready for it!
 Thanks for an excellent release!
 Nice package! I'm glad you publish it
Many thanks for your kind words.
 I'm working on a similar project, thanks for sharing, it'll be 
 very helpful for me!
Fell free to ask any questions if you want. Demo code isn't documented (except some demos files) and looks messy in places.
Mar 09
prev sibling parent reply Meta <jared771 gmail.com> writes:
On Tuesday, 9 March 2021 at 15:21:26 UTC, Mergul wrote:
 On Tuesday, 9 March 2021 at 14:29:37 UTC, Meta wrote:
 Awesome! In the demo, I noticed that if there are >3000 
 entities spawned, there will be periodic dips in the FPS. 
 Could this be Javascript's GC kicking in?
What browser are you using? I've tested couple of browsers. In general JavaScript shouldn't be a problem, from what I know WASM only growth its memory. Library itself almost never call malloc (so memory is always allocated). On firefox I had problem with FPS most of a time and I'm not sure what cause this problem (I found several bug reports which could be related to that). Besides Firefox every web browser I tested was based on chromium engine. I didn't see any periodic dips, even with <200k entities. Maybe there is some problem related to WebGL or JS Workers. When JS side detects that WASM threads are enabled in browser it loads multithreaded version of WASM code and spawn workers. But overall multithreaded execution is always more stable for me.
This is in Chrome 88.0.4324.192 on my 2015 Macbook Pro.
Mar 09
parent James Blachly <james.blachly gmail.com> writes:
On 3/9/21 4:02 PM, Meta wrote:
 On Tuesday, 9 March 2021 at 15:21:26 UTC, Mergul wrote:
 On Tuesday, 9 March 2021 at 14:29:37 UTC, Meta wrote:
 Awesome! In the demo, I noticed that if there are >3000 entities 
 spawned, there will be periodic dips in the FPS. Could this be 
 Javascript's GC kicking in?
What browser are you using? I've tested couple of browsers. In general JavaScript shouldn't be a problem, from what I know WASM only growth its memory. Library itself almost never call malloc (so memory is always allocated). On firefox I had problem with FPS most of a time and I'm not sure what cause this problem (I found several bug reports which could be related to that). Besides Firefox every web browser I tested was based on chromium engine. I didn't see any periodic dips, even with <200k entities. Maybe there is some problem related to WebGL or JS Workers. When JS side detects that WASM threads are enabled in browser it loads multithreaded version of WASM code and spawn workers. But overall multithreaded execution is always more stable for me.
This is in Chrome 88.0.4324.192 on my 2015 Macbook Pro.
Interesting; Here on a 2012 Macbook pro with Firefox I have consistent 60 FPS even at 3500 elements with no periodic drops
Mar 10
prev sibling parent Guillaume Piolat <first.name spam.org> writes:
On Monday, 8 March 2021 at 19:45:58 UTC, Mergul wrote:
 Hello everyone, I'm glad to announce release of my Bubel ECS 
 library.

 Bubel ECS is Entity-Component-System architectural pattern 
 implementation in D language.
 Library aims to delivery fast and flexible architecture for 
 developing games. It's  nogc and betterC compatible. WASM is 
 supported through Emscripten. Library has no external 
 dependencies and was tested on Linux, Windows, Android and WASM.
 Project was developed in data oriented designed fashion and 
 supports multithreading with automatic job generation. For more 
 information go to Gitlab repository page.
Thanks for an excellent release!
Mar 09