Richard Dastardly Posted August 31, 2019 Posted August 31, 2019 (edited) Hey, Had a fair bit of experience with embedded lua in a couple of different game engines, this one seems a bit different to usual. I'm looking for a way of splitting a task up over several cycles so a long-running operation doesn't stall the game engine ( or server engine in this case ) out, as I've seen apparently happen recently; usually I'd do that by building a closure with a list of functions and executing them in order in the engine's lua frame tick handler ( which is often also the game engine physics tick ), but this one doesn't seem to have an equivalent handler. Is repeatedly scheduling tasks a fraction of a sec into the future really the only way of doing this? is it possible and then safe to use coroutines? Edit: after browsing some more of other people's code coroutines certainly seem usable - safe is not so easily discovered. Edited August 31, 2019 by Richard Dastardly Most Wanted: the angry Naval Lynx | Seafire | Buccaneer | Hawker Hunter | Hawker Tempest/Sea Fury | Su-17/22 | rough strip rearming / construction
Recommended Posts