-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide fixed_update
behind a feature flag
#14911
Conversation
Apparently |
Whoever sees this first let me know why this is even a thing and whether we should change it. |
fixed_update
behind a feature flag
Based on the migration guide, it appears as though this feature will be disabled by default. Is that correct? The attached issue mentions that FixedUpdate should be enabled by default. I'll strongly advocate for that stance as well. It's basically a requirement for any game that needs a physics engine and at least for 3D games, that's the norm rather than the exception. It's also a common enough staple in other engines that I think making users opt out rather than opt in is the better choice here. |
I ran some examples and it seemed like the gizmos behavior was preserved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! One more thing to do: add a top-level feature here, which enables a corresponding feature in bevy_internal
. Otherwise it'll be quite annoying to enable this when relying on bevy
alone.
It looks like your PR is a breaking change, but you didn't provide a migration guide. Could you add some context on what users should update when this change get released in a new version of Bevy? |
You added a new example but didn't add metadata for it. Please update the root Cargo.toml file. |
nevermind... fixed it i think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there; feature flagging looks good but I have a nit about the gizmos code.
I think that should be good let me know if I missed something. |
@@ -31,6 +31,7 @@ The default feature set enables most of the expected features of a game engine, | |||
|bevy_ui|A custom ECS-driven UI framework| | |||
|bevy_winit|winit window and input backend| | |||
|default_font|Include a default font, containing only ASCII characters, at the cost of a 20kB binary size increase| | |||
|fixed_time|Provides the fixed update schedules| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should link somewhere on our docs so that new users encountering this flag don't get confused what any of that means? Could also link to the fixed timestep example, that one has a nice documentation of the feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just include the link in the description?
Really fun to get into the weeds with this PR. feels like I'm actually getting somewhere with my contributions to bevy. |
@Jondolf @JMS55 @maniwani, if y'all have time I would appreciate your opinions on how / if we should proceed on this. I don't feel super strongly about this. The technical implementation is good, and I think this it's reasonable for some games to just not use fixed update, but I don't really care how they achieve that goal. Even a lint would be fine. |
Haven't reviewed the code, but my opinion hasn't changed. Feature flag's make things harder to program, and especially test (we already have way too many combinations of flags). If the goal is just to skip the schedule when unseeded to save performance, I'd rather look into ways to make empty schedules cheaper, or put it behind a runtime config in a resource or app setting or something. I'd prefer to save feature flags for truly necessary cases, like heavy optional dependencies. |
My larger goal here is project-level consistency: making it impossible to screw up and put some of your logic in FixedUpdate and some in Update. I think I'll swap this to a lint. Closing. |
Objective
Solution
cfg
directives.Testing