-
Notifications
You must be signed in to change notification settings - Fork 941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[$200+ Bounty] Asynchronous events #2975
Comments
4ian has contributed $200.00 to this issue on Rysolv. |
Note that ultimately this could allow for much powerful features such as first class functions by making a condition that accepts a variable, sets the variable to a uid, maps that uid to a resolver function, and then having an action that takes that variable, gets the resolver from the uid and calls it to effectively call the function. |
Thanks for opening this! 👍
Probably that also any events based behavior method or function having a wait should become automatically asynchronous ("asynchronicity" is a viral property). |
I am fine with those changes to the task list and would confirm my bounty if this new task list is used instead. |
Seeking interest in this bounty. Have no experience with Asynchronous code, but willing to learn! |
Careful, this is "very hard" task, in the sense that you need knowledge of C++, JS and spend a lot of time understanding the code generation done by GDevelop, how it works, how to adapt it. |
Yeah, I think I will start with some "First good issues" and maybe will try this later |
I'm looking into it right now, hard task indeed, I'm still trying to analyze what solution would be the cleanest... Small question: To resolve an asynchronous action on the JS platform, should I rather make it return a promise and make the code generator .then it, or should I pass in as the first parameter a callback to run the next events? |
Good question, I think this is roughly similar but maybe a promise is a bit more idiomatic and can help in the future write "asynchronous" actions in JS as easily as making a async function + declaring the function async :) But the promise should be stored and |
Description
Asynchronous events are events that do not stop the execution flow of the events sheet. Instead, they will continue to run in the background while the game continues running the game loop. Once the action finishes its task, the object context at the time of its execution is restored and actions and subevents after that action are run.
They are used in the event sheets like normal actions but have a clear visual clue and links to documentation to explain their difference from normal ones.
You can find a complete discussion about the feature here.
Tasklist (edited by @4ian)
Tasks required to claim the bounty
.SetAsynchronous()
that can be called on actions/conditions when declaring them, code generation, etc)Additional tasks
Promise.all
)Promise.any
)Alternatives considered
You can find a discussion about alternatives on the forum.
The text was updated successfully, but these errors were encountered: