-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Valence tick #377
Valence tick #377
Conversation
.add_system(despawn_disconnected_clients) | ||
.add_system(run_every_20_ticks.in_schedule(CoreSchedule::FixedUpdate)) | ||
.add_system(manual_tick_interval) | ||
.insert_resource(FixedTick::new(20)) |
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.
Does this mean this only allows for one timer?
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.
Functionally it works the same as bevy_timer, so yeah, i think so, which is why I added the other example, or want to run it on a seperate scheduler, or maybe even make it some form of dynamic scheduler if thats possible?
Could be useful for #440 |
@Bafbi I don't think so. The behavior we'd want for rate limiting is more dynamic than just "send x packets every n ticks" |
@dyc3 What do you mean? we would just not be able to the delay per entity (which is not really an indispensable feature) but would get the behavior wanted . |
Regardless in this PR's current state, it's only possible to have one |
With systems already running once per game tick and with only one |
Description
Describe the changes you've made. Link to any issues this PR fixes or addresses.
Adapted the bevy_time implementation to be used with Ticks as usize instead of Time as Instant/Duration, allows you to run systems with a fixed tick interval.
Quick note: This does (still) use
CoreSchedule::FixedUpdate
and I am not sure that it should, I looked briefly in how to add a custom Schedule thing, but that went way over my head.What I am missing, (also from bevy itself) is how to make multiple FixedTick to run separate systems, I don't think it's possible, I would prefer to assign a system to a schedule, where you can have systems run at different intervals without needing to resort to something like https://github.com/valence-rs/valence/pull/377/files#diff-50197256120b6495759f6a7d5ff7276b9716bc0deddc48b62e174c0762e4ac00R68
But that might just be a bevy generic limitation from what I can tell.