libTAS icon indicating copy to clipboard operation
libTAS copied to clipboard

Does LibTAS Support Minecraft?

Open ACrowIAm opened this issue 7 years ago • 18 comments
trafficstars

Does LibTAS Support Minecraft? if not will it ever?

ACrowIAm avatar May 20 '18 06:05 ACrowIAm

That is not an issue. You can test it yourself. If it does not work you can post here details of what is happening.

clementgallet avatar May 22 '18 09:05 clementgallet

I couldn't even figure out how to run it with libtas cause java wasn't working

ACrowIAm avatar May 25 '18 01:05 ACrowIAm

Could this be re-opened? I've tested this myself (specifically 1.6.4 as it's used for glitchless/set seed) and there are some issues.

To run the game: first open the game normally, then copy the java command used to run the game (I found this using ps -eF > ps_out + cat ps_out). Search for -Djava.library.path and copy the specified folder to a new directory, then change the argument to point to your new folder. Nothing else needs to be changed about the command, but I'd recommend replacing instances of .minecraft with a new folder (after copying over necessary files) so you don't break your saves. Now you can simply copy the command over to libTAS and it should run.

Now, for the issues:

  • Game hangs when trying to load the title screen on default settings. gettimeofday() on the main thread (iirc) helps it advance a frame or two more, but clock_gettime() for the secondary thread allows the game to run. However, this timing option for some reason makes 1 frame equal to several seconds.

  • Using clock_gettime() or Uncontrolled Time will allow you to create/load a world, but you will not be able to escape the pause menu. I presume this is because the game thinks it is out of focus, but it's not.

  • Using Native Events does let you escape the pause menu but results in an immediate crash. Crash log seems to indicate that this is caused by a failure to grab the mouse.

qixils avatar Dec 01 '18 16:12 qixils

Any update on this?

InfamousKnight avatar Dec 31 '18 03:12 InfamousKnight

I just tested the last demo version of Minecraft. Indeed, the time management of the game seems messy, I'm not sure how it could be solved. I didn't have the pause menu problem. Controls worked fine except that the mouse does not move the camera (mouse works in menus though). Maybe a problem about mouse grabbing like you said.

clementgallet avatar Dec 31 '18 12:12 clementgallet

@noellekiq what version is that crash log for? I do some modding stuff and I'd like to figure out which classes those are in the stacktrace

cittyinthecloud avatar Jun 06 '19 23:06 cittyinthecloud

that was 1.6.4, been meaning to try on latest but haven't gotten the time yet

qixils avatar Jun 06 '19 23:06 qixils

still seeing a crash whenever it tries to grab the mouse on java 8 & minecraft 1.14.2. tried other versions of java incase it was a specific issue (i got java 10 to kinda load once but it crashed at the end of the loading bar, java 11 crashes before even creating a window)

qixils avatar Jun 07 '19 01:06 qixils

It looks like it's actually crashing in the superflat preset menu, unless MCPBot_Reborn is lying to me. I'll look into 1.14.2 when I get a chance to, and maybe I'll try running it with Forge to get SRG names in the error message to help narrow down the problem call

cittyinthecloud avatar Jun 08 '19 14:06 cittyinthecloud

...a superflat crash doesn't make sense when it was happening after unpausing the game in a survival world, and the crash logs mention the most likely culprit: org.lwjgl.input.Mouse.setGrabbed

i realised the game was crashing when trying to create a world seemingly (although that could've just been some of the random crashes that happen, ive tried other times and didnt get past 0% in generation but maybe im not patient enough). so i tried pregenerating a world which was able to get it to load, but the game crashed at 100%. unfortunately i havent been able to extract a crash report as it seems to be java-level crashes(?), but this would either be when trying to render (seems kinda unlikely since everything else worked fine) or grabbing the mouse still maybe?

overall, even with uncontrolled time and native events, the game randomly crashes even just on the title screen so i imagine even if whatever issue causing this was fixed, it still wouldn't be very easy to TAS. (might want to try an older version again though)

qixils avatar Jun 08 '19 18:06 qixils

update: with uncontrolled time and native events 1.12.2 works, successfully generates and loads into a map, and is playable. more information to come as i try to make this work without debug options.

qixils avatar Jun 08 '19 19:06 qixils

clock, SDL_GetTicks, & SDL_GetPerformanceCounter load into the game then hang on the title screen. clock_gettime on all threads gets into the game (with the same high FPS issue as before) but crashes when loading a world. this doesn't seem to be a timing issue however as it crashes with uncontrolled time (but not native events). unsure of how to test this further without further fixes to libtas.

qixils avatar Jun 08 '19 19:06 qixils

oh, i forgot to try recycle threads. turning that off allows it to get into the game with the clock_gettime on all threads but crashes soon after loading. uncontrolled time also allows entry, however the game still believe it doesn't has focus and so it won't let you exit the pause menu. turning off this functionality beforehand (F3+P ingame) will prevent it from pausing but the mouse movement does not work, probably for the same reason. clicks work though. (kinda, i couldnt hold left click but that might be timing issues.)

(i'm done spamming this thread now :D)

qixils avatar Jun 08 '19 19:06 qixils

Has anyone thought of asking for help from the minecraft community? Not sure if that would be a good idea.

InfamousKnight avatar Jul 18 '19 00:07 InfamousKnight

asking for... what, exactly? (and from who, specifically?) it's a series of complicated libtas problems (or just unimplemented functions) causing the issues. specifically the game believe it is out of focus and therefore ignores some inputs, however timing issues prevent you from even getting this far. (and i think Kilaye is too busy with wine and other games he actually owns to take a look)

qixils avatar Jul 18 '19 01:07 qixils

The main issues are probably related to wrestling with Java itself and not Minecraft.

chungy avatar Jul 18 '19 03:07 chungy

This game falls under the multithreading problem (regarding timing and determinism), which mainly comes from too many layers (java, java graphical toolkit, game). I don't have any good solution to propose.

clementgallet avatar Jul 18 '19 10:07 clementgallet

Garbage collection in Java is nondeterministic and stalls the main thread, so i see little chance at getting a run to sync.

Zettymaster avatar Feb 04 '20 18:02 Zettymaster