Nonblocking computation with Web Workers
Instead of the main thread drawing the screen, the heavy AI navigation is left to the Web Worker, and the results are received as messages, so that the screen does not stop while you think about it.
- Category
- Game AI
Technical terms · Web Worker · postMessage / onmessage · Main-thread blocking (long task)