Skip to content
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

Ability to add offset to timer trigger #167

Open
puchm opened this issue Sep 9, 2024 · 0 comments
Open

Ability to add offset to timer trigger #167

puchm opened this issue Sep 9, 2024 · 0 comments

Comments

@puchm
Copy link

puchm commented Sep 9, 2024

I think it would be great to be able to add an offset to a timer trigger like so:

every 20 ticks with offset 5 do

(Or with a similar syntax)

I think this could have several great use cases, a big one for me being lag optimization.

One way that I have found to optimize programs is to divide and conquer. Instead of supplying 1000 machines with resources every 20 ticks I can divide them into 10 groups and execute each of them at different points in time. However, as of right now every timer trigger with the same interval runs it's block in the exact same tick.

The only way to run blocks in different ticks is to have slight offsets in the intervals, i.e. to have one that runs every 20 ticks, one that runs every 21 ticks and so on. Perhaps there is another way using redstone but that can become pretty complex. The way to have offsets in the intervals is not a very elegant solution. Being able to add an offset would enable the user to run all of them every 20 ticks but do so in sequence.

For example:

every 20 ticks do would run in ticks 0, 20, 40, 60 and so on
every 20 ticks with offset 5 do would run in ticks 5, 25, 45, 65 and so on

I obviously know that there are better ways to optimize a program than to do this but this seems like an easy addition that could enable further optimization to even those programs that are already optimized as much as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants