MinecraftTAS / TASmod

Minecraft Tool-Assisted Speedrun (TAS) Tools with input playback
https://discord.gg/jGhNxpd
GNU General Public License v3.0
30 stars 5 forks source link

Limit generated events to 50 events per tick #206

Open ScribbleTAS opened 4 months ago

ScribbleTAS commented 4 months ago

In 1.12, a maximum of 50 events can be executed per tick due to LWJGLs buffer sizes. TASmod circumvents this limitation, by polling all inputs as they come in. You can see this in the form of GUIs. Moving the mouse and rearranging items is considered an event, so there are a finite amount of gui actions you can do within a tick. With TASmod you can do infinite actions which is not vanilla. Therefore, I should limit the amount of events that can be generated with TASmod.

[!NOTE] TASmod has some filtering built in, reducing the amount of events when recording guis in Tickrate 0

PancakeTAS commented 4 months ago

i'm not sure how you're gonna implement this.. because of subticks. some inputs have the 50-limit per frame and some per tick..

ScribbleTAS commented 4 months ago

i'm not sure how you're gonna implement this.. because of subticks. some inputs have the 50-limit per frame and some per tick..

The 50 input limit is always per tick and never per frame I think... Of course it's different in 1.16 where there is no limit iirc, but in 1.12 lwjgls buffer is filled in a tick and only emptied at the end of the tick... TASmod also still works this way, the subticks also only get processed at the end of a tick, which generates a queue of inputevents: https://github.com/MinecraftTAS/TASmod/blob/develop/src/main/java/com/minecrafttas/tasmod/virtual/VirtualInput.java#L196

I think I can limit the capacity of this queue and then a similar effect will occur...

ScribbleTAS commented 4 months ago

Well there is the issue that TASmod might generate more input events than subticks

Going from W,LCONTROL to unpressed will generate 2 events for one subtick, and character input might also create more events than in vanilla... So you'll never know if the subticks get ignored or executed if it comes down to it...