Replace world delta time with duration and make systems suspend-friendly. #170
Replies: 3 comments 16 replies
-
For the duration I am not sure how that will feel from a UX point of view. E.g. in LibGDX (my main usage for Fleks) I get a float delta time from the library that can be passed to Fleks. Is the duration thing an object? Because creating an object each frame creates a lot of garbage for the GC. I wonder how that will look like. For coroutines: would be cool but it adds an extra dependency to the library that not everyone might use. How big is the coroutine dependency? If you have time and motivation then feel free to make a PR. Then it easier for me to verify what kind of impact it will have by testing it in some of my games. |
Beta Was this translation helpful? Give feedback.
-
Regarding Duration, I have created a PR available here: #171. Regarding coroutines, it's more complicated. There's no absolute need to use external libraries, but functions need to be at least marked as "suspend". Maybe we should publish two versions: a classic one and another with coroutines that allows distributing system updates in a distributed manner. What do you think about having a classic version of Fleks and another with concurrency? |
Beta Was this translation helpful? Give feedback.
-
In the first pass, I duplicated the systems to create one that supports suspendable functions on update without adding coroutine libraries (except for testing). #172 This is the naive approach. With the library, we could use dispatchers and create complex system update orchestration, but that requires some design first. Give me some time to think about an implementation. I’m open to suggestions. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I would like to propose a couple of enhancements to the library to improve its functionality and flexibility:
Replace World Delta Time with Duration:
Currently, our ECS library uses a floating-point value to represent the world delta time. While this approach works, it limits the flexibility and precision of time management within the library. I propose replacing this float with a more versatile duration type.
Using a duration type would offer several benefits:
Support for Coroutines:
Currently, the library does not natively support suspending and resuming systems, which limits its ability to handle asynchronous operations efficiently. I propose enhancing the library to make systems suspend-friendly, enabling support for coroutines.
What do you think about that?
Beta Was this translation helpful? Give feedback.
All reactions