Hello! not sure if this is necessairly the correct place for this, but i thought i'd share my progress and my general idea for this project.
What's the goal?
Finding a way to crack the seed generation so we can accurately predict / generate ourselves the next seed.
Which in this case, seems to be using a screenshot of the game, and a precise timestamp of when the screenshot was taken, compared to when the game started, to be able to generate the exact seed, without needing to inject or modify the actual game's code.
The Theory / Why crack this way?
It's simply because the seed for the game is calculated using these 3 values, which we can calculate from a screenshot:
G.CONTROLLER.cursor_hover.T.x, the X value of the "cursor hover"G.CONTROLLER.cursor_hover.T.Ythe Y value of the "cursor hover"G.CONTROLLER.cursor_hover.time- the amount of time in seconds of the "cursor hover"
I'm using 1.01f version of balatro recently, so maybe other versions use a different formula, but for the most part it should be the same.
You can see these values as the paramaters in misc.functions.lua in the generate_starting_seed method. There's some if statement of if the stake is above 8 then it adds some extra number? but i couldn't quite understand how that works yet, and for 99% of the time it never executes anyway.
Now, the X & Y values are not actually the screen coordinates 1:1, but are scaled according to your screen resolution, and some other constants, which you can see in controller.lua in the set_cursor_hover method, which sets the "cursor hover" X & Y's as the same of the cursor coordinates, which are scaled from the screen position to the local position in set_cursor_positionmethod.
NOTE: G.TILESCALE in the code shows up to start with some value, but that value does change whenever you resize it, as can be seen in main.lua on the love.resize function.
