Multithreading events (Web Workers)

What is a “multithreading”?

  1. A thread is like a mini worker inside your game.
  2. Normally, GDevelop runs stuff one at a time on 1 thread (the “main thread”)
  3. With multithreading, you can make other threads do stuff in parallel
  4. Example:
  • Main thread = draws your game
  • Thread 1 = calculates enemy AI
  • Thread 2 = loads new level data
  • all at the same time!!

Why?

  • Heavy logic (procedural world gen, pathfinding, etc) slows the game >:(
  • No current way to natively use multiple cores :<
  • Threads = faster, smoother games :3
  • Big heavy game doesnt kill itself.

Proposal
Add a new advanced event block “Background thread event” or “Thread event” which would be a normal event, except it works in the background thread or on a specific thread. (ofc the event would have limited actions and conditions due to limitation)

2 Likes