Balatro (fun card vidya game) had it's source code leaked and it's all if/else statements lmao (EDIT: it's actually packaged with since it's written in Love2D :marseysigh: )

https://old.reddit.com/r/balatro/comments/1bt7agy/exploit_balatros_source_code_is_exposed_easy_to/?sort=controversial

hello~ idk if this has been discussed in the community yet, but there's a really easy exploit to cheat in balatro --- you can right-click the .exe file, go to "Open Archive", and modify the source code directly. i made a video so you can see how it works:

i'm bringing it up because if the editor is smart, there's no way to tell if a game has been modified or not --- you can, for example, increase the droprate of powerful jokers or legendaries and cheat in a speedrun category

i've sent a message in the speedrunning groomercord that they should probably modify the rules so that runners have to verify their game files on Steam before they submit a run. and more generally, i think ppl should be aware that this exists so they can call out suspect videos and runs

i almost didn't want to publicize this because the more well-known this gets, the easier it will be for ppl to cheat in speedruns and tournaments and stuff, but at the end of the day i think it's better if more ppl know and can establish rules to stop it when it matters

63
Jump in the discussion.

No email address required.

It never leaked, it's literally just written in Love2D so they have to package the source code with the thing so it can be interpreted

Jump in the discussion.

No email address required.

:marseyshook:

Jump in the discussion.

No email address required.

It'd be like saying a python script leaked or something. Anyway if I recall, while the meme about yandev tier if/elses came about because of his massive ifelse's, they're not actually inefficient or nonoptimal in lua, because lua doesn't have switch statements in the first place. Even for the yandev it wasn't the fact he had a chain of if/else, either, it was the fact that he was making his code harder to read for no reason and also rendering everything at the same time, even things that're meant to be offscreen. But naturally this was easier to push as the meme.

Jump in the discussion.

No email address required.

It's not about performance lmao. Switch statements that aren't on tightly-packed integers (like enums) are implemented as if-else cascades in virtually all programming languages anyways (some will use a hash table but that's often not the best in all scenarios so it's uncommon). And switch statements in "fancy" languages with pattern matching and destructuring syntax are also implemented as if-else cascades.

It's just that writing spaghetti code like this makes it so much more difficult to change, refactor, or debug your code. It's also a good measuring stick for incompetence because it typically comes about because the programmer isn't good enough to come up with a better way of implementing whatever feature.

Jump in the discussion.

No email address required.

Yeah but I already said this part

Jump in the discussion.

No email address required.

generally if you have massive if/else chains, there's a far better (and sane) way of doing it.

Which is 100% the case with yandaredev lol Unity has LOADS of way to properly structure shit like that.


Give me your money and I'll annoy people with it :space: https://i.rdrama.net/images/16965516366194396.webp

Jump in the discussion.

No email address required.

Also the entire game was a single gigantic script that called various functions

Homie didn't break anything up. Instead of the game controller calling different game files, which unity handles natively and really well, he just added functions to a gigantic script.

So a single error causes insane cascades of faults that were almost impossible to find because ofc it was not designed w/debugging in mind

The error logs are legitimately like a parody because he's fighting against unity to do things wrong

Jump in the discussion.

No email address required.

https://i.rdrama.net/images/17139276893848178.webp

Jump in the discussion.

No email address required.

My meme post is ruined now :marseygiveup:

Jump in the discussion.

No email address required.

You can stick all your function pointers in a table and then just index into that

This guy isn't even using else statements tho, he's checking the ability string a million times more even after he finds a match

Jump in the discussion.

No email address required.

He probably didn't see a point in doing else statements since he probably thought that players might somehow use two abilities at once. So he went the 400 independent if statement route. Because he's a game developer and they're taught to do r-slurred shit like this since they don't actually know how to program.

Jump in the discussion.

No email address required.

ill tell you where else you can stick your function pointers

Jump in the discussion.

No email address required.

Lua limitations it seems.

Also:

you can, for example, increase the droprate of powerful jokers or legendaries and cheat in a speedrun category

Lmao speedrunning is a joke, no game should make accommodations for speedrunners at the expensive of anything else.

Jump in the discussion.

No email address required.

Speedrunning a game that's pure RNG like Balatro is extreme :autism:

Jump in the discussion.

No email address required.

Aren't you curious who the luckiest person on Earth is?

Jump in the discussion.

No email address required.

Dream!

Jump in the discussion.

No email address required.

Acommodating for speedrunners is shit on par with adding arachnophobia settings and/or other shit that only affects 1% of the population

Jump in the discussion.

No email address required.

The lethal company arachnophobia setting is at least kinda funny to have the word 'spider' chase you around. :marseyspider:

Jump in the discussion.

No email address required.

I want an arachnophobia toggle that replaces spiders with gore:anarchy: but doesn't hint at that until it's enabled

Jump in the discussion.

No email address required.

Same ngl like it just makes everything more fricked up instead of less

Jump in the discussion.

No email address required.

That stuff is usually optional at least. However accommodating speedruns makes the games actively worse for others. See Minecraft as an example.

Jump in the discussion.

No email address required.

https://i.rdrama.net/images/1713922690927729.webp

Jump in the discussion.

No email address required.

at most a timer, but even that should mostly be for encouraging casuals to race their friends


Give me your money and I'll annoy people with it :space: https://i.rdrama.net/images/16965516366194396.webp

Jump in the discussion.

No email address required.

Make a game where levels are on a timer, and if the timer runs out the game starts strobing your screen with colours to kill epileptics

Jump in the discussion.

No email address required.

i was able to run it really well on my old machine without hyperthreading. i wouldn't have guessed it was this poorly optimized

i've heard people say its because compilers are really good now but i dont code so idk if thats accurate :marseyshrug:

Jump in the discussion.

No email address required.

At the end of the day, it's a 2D card game. It's going to fly through whatever code you write in a manner of nanoseconds. Using more efficient data flows will provide only marginal improvements that users will never notice.

Lua is a scripting language, so compiler optimization is a moot point on this particular game. On stuff like Factorio that's compiled in C++, sure, the compiler will do magic.

Jump in the discussion.

No email address required.

It isn't even compiled lol. (Well, the game code that isn't Love2d)

It just doesn't run on bloated shit like unity.

Jump in the discussion.

No email address required.

Technically it uses a JIT so it is compiled.

Jump in the discussion.

No email address required.

there's literally nothing wrong with using if else statements.

Jump in the discussion.

No email address required.

But I learned it in programming 101 and now i make 6 figures so it must be r-slur shit!

Jump in the discussion.

No email address required.

>its all if/else statements

It always was

Jump in the discussion.

No email address required.

This is wheres D meta programming would've come in handy, they could've replaced that entire if else chain with 2 lists and a static for each!

Jump in the discussion.

No email address required.

2 lists and a static for each

Do you mean a dictionary?

Jump in the discussion.

No email address required.

but then you wouldn't need the metaprogramming

Jump in the discussion.

No email address required.

Are you that r-slur that needs a compiler to tell him he's r-slurred?

Jump in the discussion.

No email address required.

I don't need it, i just like it

Jump in the discussion.

No email address required.

you are the rdrama version of hackernews walterbright , you just step in to any random discussion to gloat about the language d ( which you probably noone ever shipped anything in :marseysmug3: )

Jump in the discussion.

No email address required.

I think you can already do this in lua, it's just that it's somewhat more convoluted than writing an if statement.

Jump in the discussion.

No email address required.

Can any of this tell me what I'm doing wrong and why I can't get past 7 ante

Jump in the discussion.

No email address required.

Try and get 1 joker that gives bonus chips, at least 1 or 2 for Mult, another 1 or 2 for X Mult, also have 1 gold generator joker if possible. Organize your Jokers in this order so the X Mults are at the right most end of the chain. This order also counts for the hand you play if it has stuff like polychrome. Try and trim your deck down (unless the Jokers you have incentivise a big deck), don't add too many cards to your deck and keep it at 52 cards and less if possible. Try and get an economy going with Interest. You get 1 additional gold at the end of a round for every 5 gold up to 25. This is super important.

Good luck beating ante 8 mate :marseywink: :marseytrollclown:

Jump in the discussion.

No email address required.

Do you have to decide to focus on a singular hand and spam modifiers for it?

Jump in the discussion.

No email address required.

It's advisable not to focus specifically on a single hand type since you can get screwed by the boss modifiers. Like if you focus exclusively on hearts for flushes and then the boss has the modifier that nerfs hearts you're fricked lol. Though there are ways to bypass/reroll the boss modifier like vouchers and the luchador joker.

Jump in the discussion.

No email address required.

I think I've gone the furthest with doing almost exclusively full houses but it seems counter intuitive to just do one thing each time but then I don't know what you're even supposed to decide to do from the getgo

Jump in the discussion.

No email address required.

Usually you pivot into a couple good hands when you get a decent joker. For example getting the "Four Fingers" joker which makes your flushes and straights require 1 less card is run defining. My advise is to keep your options open until around ante 3/4, after that you usually pivot into a specific strategy. At the start you should be more worried about getting a Chips and/or Multi joker to help you survive the initial rounds and ideally finish them with 1 hand only so you can build a nice economy.

Ante 1-3 focus on getting good enough jokers that can help you breeze through the early rounds so you can build your interest up to 25g. The sinful jokers that give bonus to a particular suit like Greedy Joker and Lusty Joker are quite great for this. Then say you get the Scary Face joker which makes face cards give +30 chips when scored and it can easily get you to ante 3 without much effort.

Ante 4-6 is usually where you're pivoting into a particular strategy/hand and it's where you usually start rerolling for jokers that enable your strat. It's also usually where you're gonna be using planet/tarot cards to improve your hands and thin out/focus your deck towards a particular strat.

Ante 7-8 is all about squeezing as much score as possible from X Multi and other powerful jokers you can find on the store.

Jump in the discussion.

No email address required.

Good shit. I'm gonna go for it.

Jump in the discussion.

No email address required.

Are you feeling okay bud?

Jump in the discussion.

No email address required.

Balatro is a fun game, and if you cheat at vidyagams you are weird.

Jump in the discussion.

No email address required.

Balatro is boring :marseyyawn:

Jump in the discussion.

No email address required.

Should have used dictionaries to store the abilities :marseyboardcode:

Jump in the discussion.

No email address required.

>i'm bringing it up because if the editor is smart, there's no way to tell if a game has been modified or not --- you can, for example, increase the droprate of powerful jokers or legendaries and cheat in a speedrun category

????

You can just do the run with the same seed and repeat the actions and it will quickly become apparent it's been tampered with

Jump in the discussion.

No email address required.

Fun game but very embarrassing.


:#marseytwerking:

:marseycoin::marseycoin::marseycoin:
Jump in the discussion.

No email address required.

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.