Re: Audio Games with Rust?

So I haven't looked into how Bevy can or can't handle this, but I think the solution to scripting is a continuation.  Possibly in general for all of Rust, if I'm being honest.  To use death as an example, split it like this:

fn do_death(args) {
    enqueue_script("script", death_after_script);
}

fn death_after_script(arg: ScriptResult) {
    // do we die or not?
}

You can use interior mutability to enqueue the script and the system can avoid enqueueing the script and do whatever inline if there's not one.  Then at the end of the current tick, you exhaust the script queue.  The downside of this is that scripts don't technically execute at the very instant they should, but they don't execute some random number of ticks later and they get the ability to intercept actions which is what you need for the sorts of game where there's weird one-off objects all over (I guess we call that an adventure game, but it applies to lots of other things).  I don't know for sure but I don't think it would be very difficult to deal with not knowing *exactly* when your script would execute, especially since you kind of don't know that anyway.

Not sure if this can be done in parallel: I can think of ways to do it, but likely not ways that play nice with Rust libraries as written.  And if Bevy doesn't give you the ability to do one-off entity access by id it's dead in the water with Bevy specifically.  But it does solve the problem for anything single player (you absolutely don't need parallel script execution for single player) and offhand I don't see why Bevy wouldn't give you the feature you need for it, I just don't know how to find out if it does quickly.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : nolan via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : nolan via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : nolan via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : nolan via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : nolan via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector

Reply via email to