[Solved] Multi thread game

Hello,
I’m new to GDevelop. I’m developing a puzzle game intended for mobile and maybe web.
I’m in the early prototyping stage (almost completed) and until now I used Android Studio and Java but, since the game is not so complex and since with GDevelop I could export also for iOS, I plan to switch to GDevelop.

I wonder if, in Javascript, it is possible to build a multi thread game.
I need to create a silent ‘demon’ that quietly run in background while the user is playing and update some of the data structures used by the game.

It is possible ?
And how? (any link to the documentation is appreciated)

Hi, maybe I completely miss the point of what you actually want to do, but if you mean you want your game to adjust to the player’s decisions, time passed etc. and based on that have several threads and endings in your game, that’s possible with Gdevelop - as in case of JS or other languages and engines - by using variables and timers.

If you mean to use JS in Gdevelop that’s possible but actually not necessary for changing variables and adjusting the game to the players decisions. That’s all possible with the events.

If you need complexer data structures, you can use structures and arrays Variables - GDevelop documentation

If you mean to use JS in Gdevelop that’s possible but actually not necessary for changing variables and adjusting the game to the players decisions. That’s all possible with the events.

Yes I know this. My situation is a bit different:

The thread should do a search in a high dimension al space. The result of the search is used by the game. But, in any case, I already managed (just yesterday) to split the search in little chunks and execute each chunk in the update method. If the chunks are little enough the update remain fast and the player does not notice what’s happening. So the thread is no more needed!

1 Like

Solved