-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial test on Balatro+ (App Store and Apple Arcade edition) #86
Comments
Does the balatro .app have a |
@WilsontheWolf No In the meantime, I've made a little more progress since my first message. I'm following the path of using the supplied The
I tried copying the
... which is weird, since there's definitely a Note that when invoking |
Okay. In that case, you can probably extract the game.love and stick it into a regular macos build of balatro, and then you should be able to use lovely |
... and minutes later, some actual success: The problem seems to be that the
... and it booted up fine, and showed the altered strings. Even better, it loaded my saved game profile as normal. So I'm thinking that a modding process that copies the source over and runs the lua transformations on the copied version may be enough here? |
@WilsontheWolf Yep, either keeping it unzipped or compressing to a |
So the reason why it cant see files outside of the Balatro.app folder is because of App Sandbox. It can access files in the .app and Also the app has |
Also the Apple Arcade version on the Mac is not the same as the non Apple Arcade version since the non Apple Arcade version is iOS only. |
Just tested what you did earlier and having it in |
bump to see y'alls progress |
Another thing to know. The binary file in Balatro.app is FairPlay encrypted so doing stuff with the binary is most likely a dead end. It won't be easy to mod the Apple Arcade version without just manually patching the game files. |
If anyone's thinking of adding support for the Mac App Store version of Balatro, and the Apple Arcade ("Balatro+") release, here's some initial information from a couple of hours playing around with it. Caveats: I have very little lua experience and even less rust, nor am I an iOS/macOS developer, so consider everything here vague at best and unverified. I haven't even bought Balatro on Steam, so all my experience is with the AA version on iPadOS and macOS.
All the exploration below is with the macOS version of Balatro+, though I'm guessing the packages for the other Apple OSes have very few differences: the source includes the logic for iOS/iPadOS and tvOS. Similarly, it would surprise me if there's any major difference between the non-Arcade App Store package and the Apple Arcade Balatro+ package.
The Balatro+ (Apple Arcade version) package includes:
the game's (updated for Apple OSes and APIs) lua source and assets in
Contents/Resources/game/
a custom binary launcher:
Contents/MacOS/Balatro
a
license.txt
which specifies:Clockwork Valley ("Licensor") grants LocalThunk, inc ("Licensee") a non-exclusive, non-transferable, revocable license to access and use the software solely for the purpose of assisting in the development of Balatro Arcade.
(According to the file, Clockwork Valley is Maarten de Meyer. The file also lists these open source components: LOVE, ENet, FreeType, GLAD, glslang, Kepler Project's lua-compat-5.3, lua-enet, LuaJIT, Lua's UTF-8 module, LuaSocket, LZ4, LodePNG, TinyEXR, UTF8-CPP, xxHash, dr_flac, stb_image, libmpg123, OpenAL Soft.)
My guess is that the
Balatro
binary is basicallylove
but with extra logic compiled in for exposing Core Data, CloudKit, GameKit, and other Apple APIs, all gathered into alove.platform
table.Fascinatingly – and wonderfully – most if not all of the new logic that uses those APIs seems to be out in the relative open in the included lua source, rather than more hidden in that custom binary. You can, for example, see lots of specific handling for tvOS.
So that's the good news. Now for some bad news:
Balatro
binary appears to be closed off to the dyld hijacking trick that the macOS version of lovely uses. (I tried compiling and using the much simpler tool on that page, and verified that it worked on the standardlove
binary.)At this point I need to stress that I am not an experienced C or macOS hacker, and I may well have missed some major windows that are still open. More importantly, the
Balatro
binary could have been written with command line arguments that allow for custom logic injection, even though the standardlove
command doesn't have any. (Maybe we should just ask Maarten de Meyer.)Talking of the standard
love
command, what happens when you point a normal love2d build at Balatro+'sgame
folder? It actually gets pretty far: it produces a nice big window, loads them6x11plus.ttf
font, and uses it to display the traceback showing that it got about three lines intomain.lua
'slove.load
event before hitting a call tolove.platform.earlyInit
- which, of course, doesn't exist in the standard love2d API.But that's far enough to show that those new APIs are what's getting in the way, and fortunately all the interaction points are clear in the lua code. Some of those methods are easily stubbed/faked, but others have been moved in as the primary load-bearing I/O points for loading and saving the player's profile and progress.
The main issue I hit with
lovely
: currently, on macOS, it demands thatlove
exist within a.app
folder - why? I was using a homebrew-installed binary and ended up commenting those lines out and rebuilding. (Yes, I could have faked it, but I was in the source anyway.)I'm leaving this here for now. I'm happy to answer questions and try things out, but please don't expect me to do much more work on this. Others who have more experience will likely get much further, faster.
The text was updated successfully, but these errors were encountered: