Comments (2)
I tried to replicate this locally, here's my findings!
@cuppachino , where is the LogicStep
type from?
And I'm curious, is your bug report that the timer in the LogicStep
type advanced more quickly than you intended, or that when a window is unfocused the update rate has different characteristics?
Experiment Setup
The example program I used
[package]
name = "time_test"
version = "0.1.0"
edition = "2021"
[dependencies]
bevy="*"
bevy-inspector-egui = "*"
[profile.dev]
opt-level = 1
[profile.dev.package."*"]
opt-level = 3
use bevy::{input::common_conditions::input_toggle_active, prelude::*};
fn main() {
App::new()
.add_plugins(DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
//present_mode: bevy::window::PresentMode::Immediate,
..default()
}),
..default()
}))
.add_plugins(
bevy_inspector_egui::quick::WorldInspectorPlugin::default()
.run_if(input_toggle_active(true, KeyCode::Escape)),
)
.run();
}
My findings
Virtual Time (TLDR: Appears WAI on my machine)
I did find Virtual
and Real
time elapsed at slightly different rates, but it was minimally different, less than a second over a hundred seconds.
Virtual
time seems consistent based on the elapsed time of the previous update tick, and adapted based on the update loop time. For me it seems it advances roughly close to real time, besides jump discontinuities when I drag the window where real time advances, but virtual time is paused during the drag.
Fixed time (TLDR: Appears WAI on my machine)
I adjusted my Fixed timestep to step to 0.5 seconds, and it advanced at a consistent rate (although jumping every 0.5 seconds) focused or unfocused, relative to Virtual
time. It appears at least on my machine to be fairly consistent.
LogicStep time (The problem banana that I can not find)
I do not see this type in Bevy's libraries, but this appears to be the type that is having the rate issue.
Was this a name of a previously removed type?
from bevy.
@Earthmark LogicStep
is essentially a duplicate of Fixed
. My mistake was running the modified run_fixed_main_schedule
in FixedMain
.
Very sorry for wasting your time, but thank you for the detailed analysis! I thought it was a problem with the Virtual time affecting other timers, but that's probably because I was updating the virtual timer outside of the RunFixedMainLoop
.
app.init_schedule(LogicUpdate)
.add_systems(
- FixedMain,
+ bevy::app::RunFixedMainLoop,
run_fixed_main_schedule
);
The issue can probably be closed.
from bevy.
Related Issues (20)
- Bevy_ui outlines should respect BorderRadius.
- Textures not displaying properly if normal/base texture transforms don't align
- `winit::TabLeft`/`Event::Suspended` doesn't function as intended on WASM HOT 4
- Panic if changing browser zoom in WASM with an overridden scale factor HOT 1
- ECS: Assets on web keep re-downloading (help: banging head against the wall) HOT 1
- Segfault `SIGSEGV (Address boundary error)` when running examples on main HOT 6
- Lack of Doc Comments in some Render Related Files
- Exit not correctly tearing down graphics stack?? HOT 1
- RenderAssetUsages::RENDER_WORLD assets are not cleaned when their handles are dropped HOT 1
- Ui border is 1 pixel too large, or is getting aliased. HOT 11
- Audio getting progressively worse. (By default) HOT 7
- Text styles should be inheritable HOT 1
- Support user interaction in `ci_testing` HOT 1
- UI Node's transform is sometimes incorrectly calculated HOT 5
- Setting 'Specular Transmission' to a value higher than 0.0 on a standard material (or ext material) -> it wont write to depth buffer HOT 1
- Adding VolumetricLight makes objects near the camera brighter HOT 1
- Re-using transform in other apps requires a lot of deps HOT 1
- bevy_app doesn't compile without default features
- Implement `Reflect` for all `bevy_math` types HOT 1
- ComputedStates are not linked from the `States` documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bevy.