Friflo.Engine.ECS icon indicating copy to clipboard operation
Friflo.Engine.ECS copied to clipboard

[Feature Request] Extend System Groups

Open wuming123 opened this issue 5 months ago • 2 comments

I would like to add the ability to specify how many ticks a SystemGroup should run every, similar to Bevy's SystemGroup control.

wuming123 avatar Oct 23 '25 14:10 wuming123

You can pass the ticks via the struct UpdateTick. They are passed as parameter of the method SystemGroup.Update(UpdateTick tick).

I you mean something different please show the a Bevy example which illustrates what you want.

friflo avatar Oct 24 '25 12:10 friflo

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        // System A: Runs every 0.5 seconds
        .add_systems(Update, fast_system.run_if(on_timer(Duration::from_millis(500))))
        // System B: Runs every 1 second
        .add_systems(Update, medium_system.run_if(on_timer(Duration::from_secs(1))))
        // System C: Runs every 2 seconds
        .add_systems(Update, slow_system.run_if(on_timer(Duration::from_secs(2))))
        .run();
}

fn fast_system() {
    println!(“[FAST] 500ms tick”);
}

fn medium_system() {
    println!(“[MEDIUM] 1s tick”);
}

fn slow_system() {
    println!(“[SLOW] 2s tick”);
}

Like this, each system can run at different frequencies.

wuming123 avatar Oct 25 '25 01:10 wuming123