Scribble
He/Him
Joined: 5/15/2022
Posts: 4
Location: Germany
Greetings! I am the main developer for the Minecraft TAS Tool "TASmod", a mod that aims to bring input playback functionality and more tools to the game. I've been working on and off on this mod for roughly 5 years and my plan for this mod was a full set of tools, savestates, slowdown/frameadvance and RNG Manipulation. Due to Minecraft being a very actively modded game and Mojang being very open to modding, I decided to write a mod that hooks into the input logic from inside the game, without the need for external tools. Looking at the history of TASes on this site, this led me to question my decision on writing internal tools for the game at first, but I thought: If I keep modifications to a minimum and keep it open source, then I may be able to get away with it. But during my years of working on the mod I found more and more major issues with the game that require some major modification to make the tools not desync. The main point is RNG. If you have ever played Minecraft before, you know how RNG heavy can be. This leads me to believe, that it is impossible to run a TAS via an external tool, without Minecraft desyncing. You can get away with parkour game modes, where there is practically no RNG involved, but even taking fall damage runs the risk of desyncing. I have recently read through the Hollow Knight TASing experience with libTAS and I feel that this could be happening again with external tools. And so here is a small overview of the changes:
  • Syncing game-tickrate between client and server (Minecraft starts an integrated server in singleplayer on a seperate thread, usually runs distinct from each other creating desyncs)
  • Patching ~2000 instances of RNG (Some are not modified but still listed) to be replayable and manipulatable.
Optional features to make TASing easier:
  • Slowdown and frame advance or more like "tick advance"
  • In-Game Savestates
The advantages I see with this:
  • Easier installation: It is installed like any other mod and it's widely known how
  • Multiplayer support: Mod can be installed on servers
  • Modding support: Other mods can interact with the tools
As a result I was able to create a Minecraft TAS with reproducable results and manipulated RNG: https://youtu.be/VkSM779W3LY?si=YGh5iDNIhRj7V_wX Now I would love to hear your opinions on that matter. Go for an "as pure as possible" approach, removing savestating, slowdown and/or RNG pathcing or take the opportunity of being allowed to modify the game and make a pleasant TASing experience?
I add "._." to sentences out of habit... Writing TAS tools for Minecraft 1.12.2: https://github.com/MinecraftTAS/TASmod
Judge, Moderator, Player (195)
Joined: 7/15/2021
Posts: 110
Location: United States
What libTAS does is patch all calls to the system RNG function. I would imagine that Minecraft uses system RNG and thus an external tool could get away with fewer patches needed for RNG.
Scribble
He/Him
Joined: 5/15/2022
Posts: 4
Location: Germany
InfoTeddy wrote:
What libTAS does is patch all calls to the system RNG function. I would imagine that Minecraft uses system RNG and thus an external tool could get away with fewer patches needed for RNG.
Minecraft uses Java.Random, it's not the system random
I add "._." to sentences out of habit... Writing TAS tools for Minecraft 1.12.2: https://github.com/MinecraftTAS/TASmod
Emulator Coder, Judge, Experienced player (609)
Joined: 2/26/2020
Posts: 698
Location: California
Docs on Java.Random seem to just indicate it's just some PRNG. I could imagine that it itself is deterministic. However, if the game were to use it with multiple threads (which probably isn't deterministic) or if the initial seeding itself was done in some non-deterministic manner (e.g. it was just say done by querying system time, or whatever other way to get an initial seed). Assuming it's not some threading screwing up results, it's probable you could easily patch away anything non-deterministic with RNG.
Scribble
He/Him
Joined: 5/15/2022
Posts: 4
Location: Germany
initial seeding itself was done in some non-deterministic manner e.g. it was just say done by querying system time
It's exactly that... The game also uses multiple rng variables:
  • Each entity has their own RNG that they call
  • A "World" RNG that is responsible for chunk generation as well as block RNG
The world RNG is somewhat tricky as you have to watch out to not disturb world generation, but make block RNG deterministic... But the main thing I am getting is that I should rethink my RNG patching, which I will gladly do... Besides that, does anyone feel negatively about in game tools vs. external tools?
I add "._." to sentences out of habit... Writing TAS tools for Minecraft 1.12.2: https://github.com/MinecraftTAS/TASmod
Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11274
Location: RU
Scribble wrote:
Go for an "as pure as possible" approach, removing savestating, slowdown and/or RNG pathcing
How would you TAS it then? Or do you mean sync compatibility with an untasable version of the game? So then again, how do you ensure sync?
Scribble wrote:
or take the opportunity of being allowed to modify the game and make a pleasant TASing experience?
Pleasant TASing experience is the most important thing, because it attracts more people and incentivizes better works. And guaranteeing sync is a part of that. But we also don't want it to be a hell to maintain for the developer, so we don't demand anything unsustainable (at least not anymore). Accuracy and authenticity are nice to have, but not at the expense of devs and TASers. In other words, we always sacrificed accuracy for determinism.
Scribble wrote:
The game also uses multiple rng variables:
  • Each entity has their own RNG that they call
  • A "World" RNG that is responsible for chunk generation as well as block RNG
The world RNG is somewhat tricky as you have to watch out to not disturb world generation, but make block RNG deterministic... But the main thing I am getting is that I should rethink my RNG patching, which I will gladly do...
Is it possible to change what system time the game reads whenever it decides to roll RNG? libTAS controls that and it's quite robust, unless games do non-deterministic crap in other threads.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Scribble
He/Him
Joined: 5/15/2022
Posts: 4
Location: Germany
How would you TAS it then? Or do you mean sync compatibility with an untasable version of the game? So then again, how do you ensure sync?
I should have specified that it's only the bare minimum to make it functional... That was at least an idea that came up in a discussion with a fellow dev
Pleasant TASing experience is the most important thing, because it attracts more people and incentivizes better works.
I agree with that. Nobody wants to use tools that are too complicated
Accuracy and authenticity are nice to have, but not at the expense of devs and TASers.
But sometimes you want to know how far you can make it sync before it breaks...
Is it possible to change what system time the game reads whenever it decides to roll RNG? libTAS controls that and it's quite robust, unless games do non-deterministic crap in other threads.
Interesting... The client-server relationship is the most non-deterministic crap you can get, having networking packets communicating inbetween on another thread is even more crap... But maybe with some in game magic, I can try my hand on hacking the system time like libTAS... Maybe worth checking out
I add "._." to sentences out of habit... Writing TAS tools for Minecraft 1.12.2: https://github.com/MinecraftTAS/TASmod