Optimizations & Fixes - Ideas #98

Open
opened 2026-09-07 17:43:34 +00:00 by kirsle · 0 comments
Owner
  • In pkg/scripting, eliminate race conditions with Pub/Sub message passing. For example, if you place Gem Totems close together, e.g. as a totem pole, and the player collides with all of them simultaneously to deposit gems, the game can lock up because the totems are all triggering and publishing to each other. The doodad scripts seem to run in parallel and lead to deadlocks when writing to the queue channels. Move them to be sequential and resolve this edge case.
  • In pkg/scripting, make functions like setInterval and animations locked to the game's frame rate instead of real wallclock time. The JS docs already have a warning about using time.Now() functions to indicate that wallclock time can be unreliable for important timing events. setTimeout should translate the milliseconds given to an appropriate fraction of the game's FPS target.
- [x] In pkg/scripting, eliminate race conditions with Pub/Sub message passing. For example, if you place Gem Totems close together, e.g. as a totem pole, and the player collides with all of them simultaneously to deposit gems, the game can lock up because the totems are all triggering and publishing to each other. The doodad scripts seem to run in parallel and lead to deadlocks when writing to the queue channels. Move them to be sequential and resolve this edge case. - [x] In pkg/scripting, make functions like setInterval and animations locked to the game's frame rate instead of real wallclock time. The JS docs already have a warning about using `time.Now()` functions to indicate that wallclock time can be unreliable for important timing events. `setTimeout` should translate the milliseconds given to an appropriate fraction of the game's FPS target.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
SketchyMaze/doodle#98
No description provided.