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

schedule bonus ticks #2253

Open
wants to merge 4 commits into
base: mc1.18.x
Choose a base branch
from
Open

Conversation

wagyourtail
Copy link

@wagyourtail wagyourtail commented Nov 10, 2022

schedule at the end of the tick, drop if lagging too much

add config option for max tps drop TimeWatch can cause

is this a good idea?

@pupnewfster pupnewfster self-assigned this Nov 10, 2022
@pupnewfster
Copy link
Collaborator

This definitely sounds like something that would be good as a config option at the least, will try and take a look at it whenever I next get around to working on ProjectE

for (SpedUpItem item : queue) {

// reasonable range so a single doesn't hog too much
int ticks = Mth.clamp(item.getTicksLeft() / divisor, 1, Math.min(totalTicks, 1_000));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's probably a better function usable here,

the idea is to get a ratio so that things that have 100 bonus ticks don't get the same as things with only like 10. but we also don't want this while loop to take too long for a single iteration, since it only checks if it's out of time each loop

@pupnewfster
Copy link
Collaborator

I am going to look into this in the next few days, though odds are I will more so pull it out of the PR/reimplement and copy bits as I am currently finishing up 1.19 before moving to 1.20 and this PR is targeted at 1.18

pupnewfster added a commit to pupnewfster/ProjectE that referenced this pull request Oct 29, 2023
@pupnewfster
Copy link
Collaborator

pupnewfster@a90c2ac was my experimentation with this and there are some things I am not quite sure about in regards to things like assuming all blocks have same number of ticks given to them then they do one at a time a single extra tick, but it means validation has to be done again as if one of the blocks that got accelerated was a miner or something then the other block may no longer exist. So for now I am shelving this until 1.20.3+ when mojang is adding a tick command to make testing this easier and potentially if we are lucky maybe is doing some cleanup of how things are ticked to allow batching them easier? (doubtful but we can hope)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants