2 ms·
As an x-gamedev, suspect/resume/stackful coroutines made them too heavy to have several thousand of them running during a game loop for our game. At the time we
by socalgal2 7mo ago
As an x-gamedev, suspect/resume/stackful coroutines made them too heavy to have several thousand of them running during a game loop for our game. At the time we used GameMonkey Script: https://github.com/publicrepo/gmscript https://github.com/publicrepo/gmscript
That was over 20 years ago. No idea what the current hotness is.
- fluoridation 7mo agoSeveral thousand? What were you using them for? Coroutines' main utility is that they let you write complex code that pauses and still looks sensible, so for games, you'd typically put stuff like the behavior of an NPC in a coroutine. If you have thousands of things to put each in its own coroutine, they must have been really, really simple stuff. At that point, the cost of context switching can become significant.
- socalgal2 7mo ago> the cost of context switching can become significant. Which is why a solution with no (or very tiny) context switching is preferred over one that's heavy to switch. > they must have been really, really simple stuff Yes, because they were low-overhead it was trivial to start them for all kinds of tiny things.