bevyengine / bevyengine/bevy

Native Tick Timers

Open
#1,633 1 comment 0 reactions 0 assignees View on GitHub
A-Time C-Feature C-Usability X-Needs-SME
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## What problem does this solve or what need does it fill?

> Tick based timers are timers that operate not on real time, but on the number of state updates that occur. Each state update constitutes a "tick".
>
> For any timer that does not update outside a game session, a tick based timer is preferred. This makes games more consistent and replayable (which also means they are easier to debug).

From the [bevy_tick_timers](https://github.com/maplant/bevy-tick-timers) crate.

There are three arguments for moving this in-tree IMO:
1. Ensure API consistency and stability.
2. Encourage beginners to use tick-timers for most gameplay, rather than more complex and flaky real-time timers.
3. Allow us to use tick-timers internally, such as for delayed state chart transitions (see #1597).

## What solution would you like?

Borrow from @maplant's solid foundation and create a Bevy drop-in-replacement for ordinary real-time timers.

## What alternative(s) have you considered?

Continue to rely on a third-party library. I've argued above why I think this is inferior.

## Additional context

None.

Contributor guide

Open the contributing guide

Research direction

Start by reading the bevy_tick_timers crate linked in the issue and the related delayed state chart transition discussion in #1597. Define the in-tree API and integration points needed for a Bevy drop-in replacement for ordinary real-time timers. Done means tick-based timers are available in Bevy and suitable for internal delayed transitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.