Carpet

Carpet

2M Downloads

[Suggestion] Lag Tester

Kallefinn opened this issue ยท 5 comments

commented

Im not sure if there is already a practical way of testing contraptions under laggy conditions but it would be helpful to be able to perform a tick warp under extreme conditions to make sure it is lag proof. So i would propose the addition of a tick warp with lag spikes to test for extreme casses. If there already is a way or if it isnt possible please let me know.

commented

But that is system specific, so you can't do that.

commented

like it's different from pc to pc

commented

Almost sure that Thread.sleep(5000) would make any system generate a lag spike.
But of course generating a lag spike under a tick warp would basically slow down the ticks, so it wouldn't be a tick warp anymore.
It would be about finding what does the game consider a "lag spike" and force that state instead in order to keep the game fast.

Maybe instead of a specific "sub" tick warp, a command to produce that state in any moment and in a tick warp it could be used by setting a command block to trigger it in a clock.

commented

Actually, the 1.12 version of Carpet uses exactly that at LagSpikeHelper.java#L28, but once again that does literally lag the game for that time, making the tick warp ticks really slow.

commented

you should be able to have a script doing lag exactly how you would wanted from it. By using entity events, using on_tick or by using schedule you can 'add stress' in various points of the game tick.