jrockett6 / bevy_godot4

Bring Bevy's ECS to Godot4
MIT License
39 stars 8 forks source link

Mandatory to use one of (as_physics_system, as_visual_system) for each system? #5

Open YPares opened 2 months ago

YPares commented 2 months ago

I've been checking a bit the implementation, and am I right in assuming that any system added to the bevy app needs to use either as_physics_system or as_visual_system?

Because if a system uses neither, it seems it will run BOTH in the _process and the _physics_process, and therefore that it'll be updated too often. How do the default bevy systems (added from the standard bevy plugins you are using) behave in that context?

If so, would there be a way to defend against that, for instance by running systems by default only in the _process, and moving them to _physics_process if they are explicitly tagged with as_physics_system?

jrockett6 commented 2 months ago

Good call, setting things to use process updates by default and only use physics frames when tagged explicitly would be better.

Likely some of the standard bevy plugins behavior is not as expected - like the FrameCountPlugin and potentially others.

YPares commented 4 weeks ago

Maybe a possibility is to use World and Schedules directly, and discard the App? See for instance the example in https://docs.rs/bevy/latest/bevy/ecs/system/struct.Deferred.html

This may also lighten the build as I believe you'd need only bevy_ecs ( https://github.com/bevyengine/bevy/tree/main/crates/bevy_ecs ) and not the whole bevy crate.