One of the biggest recent indie hits, Balatro, was made in Löve!

I really like it, the developer experience is so smooth for beginners, just drag a zip onto the exe and it starts. And the APIs are simple enough to memorize while allowing pretty cool rendering stuff.

Balatro ships with the entire unobfuscated Lua source by the way.

I once checked if the odds stated on a card were implemented wrong. Turns out no, the code checks out, I'm just that unlucky.

too bad universe doesn't ship with unobfuscated source so that you could see whether you're unlucky, or just skill issue

The source is right there, you just have to grok it.

Good news: the universe is written in LISP. Bad news: with no comments.

> the universe is written in LISP

Ostensibly. Honestly most of it was hacked together with Perl.

https://xkcd.com/224/

I like to imagine perl was bootstrapped from forth and used to build a lisp

You can ask AI to comment an entire code base now in as much detail as you need.

Comments explaining what the code does, which is what an LLM could answer, are basically useless comments. Comments that describes why the code is how it is, is a bit more valuable, but also something LLMs cannot really reliably infer by just looking at the code.

[deleted]

Well, it's kind of a machine code for a self-modifying compiler, so there's that.

The source is not just dna - that's just one type of architecture that exists. There might be others that operate on different instruction sets.

The real source is mathematics. But some might say it's incomplete.

Mathematics is the FORTRAN of the real source. Closer to a real source is probably "real" things like atoms and other universal things.

If I remember correctly, Stargate-SG1 at one point had some ideas about this sort of universal language, that multiple species could use for communication, as any sufficiently intelligent specie probably been able to see atoms and so on, but may have completely other way of doing "math-like" stuff.

I'm still waiting for the slackers at CERN to finish decompiling it.

that's great, could read the source code on how to unify gravity and quantum mechanics for all energy levels? vibeing to a nobel price will be cool...

I don't have to check the source code to know that for me it's a skill issue :/

hahaha, I did the exact same thing after the game came out to see if wheel of fortune was really a 1/4 chance

lol, love seeing that I'm not the only one who did this. Being suspicious of WoF was the first and last time I peeked at the Balatro source.

Game developers sometimes make the “randomness” favor the player, because of how we perceive randomness and chance.

For example in Sid Meier’s Memoir, this is mentioned.

Quoting from a review of said book:

> People hate randomness: To placate people's busted sense of randomness and overdeveloped sense of fairness, Civ Revolutions had to implement some interesting decisions: any 3:1 battle in favor of human became a guaranteed win. Too many randomly bad outcomes in a row were mitigated.

https://smus.com/books/sid-meiers-memoir/

Some threads on randomness and perceived fairness in video games can be found here on HN too, for example https://news.ycombinator.com/item?id=19399044

The original link being discussed in that thread is 404 now, but archived copies of the original link exist such as for example https://archive.is/8eVqt

I used to get so many comments about how the computer opponent in a tile-based board game of mine cheats and got all the high numbers while they always got low numbers, and I'd be like "that's mathematically impossible. I divide the number of spaces on the board in half, generate a deck of tiles to go into a 'bag', and then give a copy of those same tiles to the other player.

So over the course of the game you'll get the exact same tiles, just in a different random order.

Now to be fair, I didn't make that clear to the player that's what was happening, they were just seeing numbers come up, but it was still amazing to see how they perceived themselves as getting lower numbers overall compared to the opponent all the time.

Meanwhile on the base game difficulty I was beating the computer opponent pretty much every game because it had such basic A.I. where it was placing its tiles almost totally at random (basically I built an array of all possible moves where it would increase its score, and it would pick one at random from all those possibilities, not the best possibility out of those).

My Dad used to play a lot of online poker, and he used to complain when other players got lucky with their hands, be like 'I know the chances are like 5% of them getting that! They shouldn't have gotten that!' and it always reminded me of those people.

The better option would be to just increase the flat odds. DQM: The Dark Prince is brutal with it's odds, but fair. A 45% chance is 45%.

In games like Civ/EU/Stellaris/Sins/etc It makes sense that a 3:1 battle wouldn't scale linearly, especially if you have higher morale/tech/etc. Bullets have a miss ratio, 3x as many bullets at the same target narrows that gap and gives the larger side an advantage at more quickly destroying the other side. So just give it an oversized ratio to scale the base (1:1) odds at.

That keeps "losing" realistic...a once in an occasion happenstance of luck/bad tactics/etc but also a generally very favorable and reliable outcome for your side.

I worked on a game where we added a "fairness" factor to randomness. If you were unlucky in one battle, you were lucky in the next, and vice versa. Mathematically you ended up completely fair. (The game designer hated it, though, and it wasn't shipped like that)

Games like Battle for Wesnoth which have it implemented right, you’ll look at a 90-10 scenario with 2 attacks and end up with the 1% scenario. Enough to make a man rage. I have degrees in Mathematics, I am aware of statistics, and all that. And yet when I played that game I would still have an instant “wait what, that’s super unlikely” before I had to mentally control for the fact that so many battles happen in a single map.

Was good because it identified a personal mental flaw.

Dispatch too. If your odds are above a certain threshold, the mission is a gimme.

I think XCOM does this as well.

The 8-ball joker is even more BS. I think I’ve only seen it trigger once ever.

I've read the source a few years back. It's all implemented fairly as it says on the tin.

I've long been suspicious of the RNG/seed implementation.. but not curious enough to automate testing of it, though.

It's been done, it's a valid RNG. It's somewhere on Reddit if you want to try and search for it.

I figured it had been tested by someone more motivated than me, haha, thanks! Will look for it when I'm back at a computer.

Neat example of cognitive bias, the brain perceives the Nope as being much more prevalent than it actually is!

For a small while I've had the idea of a [game engine/fantasy console/Scratch clone?] that comes packed with a bunch of example games. The example games should be good enough that people download it just to play them, but they are also encouraged to peek into their source code. I'd hope for it to be a sneaky gateway into programming.

For that, I'll keep this in mind: "Unlucky players may look at the source code of a chance-based effect to check if the odds are actually as stated."

I didn't know I could check but after losing like 20 times in a row I just stopped taking WoF. Never saw the good outcome.

I’ve 100%’d Balatro and wheel of fortune is quite strong. It’s never worth taking before you’re at max interest though.

I'm sure it's strong if you hit it, I never did so to me it was a waste of chips.

Not on steam does it? I can only see the exe and dlls.

extract the exe like a zip file, that's how love packages itself. last i looked at the source myself it had comments in still from the dev

I'm really curious how they do version control.

The Steam version was created by one guy, but the platform ports have a couple different authors. The Google Play and Xbox PC versions, for instance, have divergences.

I wonder how the ports influence the upstream and each other. How do they keep the codebases in sync, while also accounting for platform differences?

Can't say for sure how Balatro did it, but typically you do one shared core and any platforms basically use that core in their own suitable way. Considering it's lua, would feel very natural and be relatively simple for Balatro to do it this way too. Not much to keep in sync, just ensuring the core remains reusable in the ways the platforms need it.

The Android and Xbox PC versions look more like forks for a shared codebase. Most of the platform-specific code is abstracted to a bridge, but even the bridges aren't consistent across the codebases. (Android's save system uses different methods than Xbox 's.)

yep that works

come on you can blame whatever the program is using for randomness still

I know which card. We were all there. Are the odds wrong? "Nope!"

In case you're curious, here's a Nix derivation to make Balatro for any other system playable on Linux:

https://github.com/NixOS/nixpkgs/tree/master/pkgs/by-name/ba...

I wrote half a blog post when I did the derivation. One day, I should finish it and post it here.

That's awesome!

> One of the biggest recent indie hits, Balatro, was made in Löve!

Moonring[1] is another one that that is written in Löve (apparently by the co-creator of XBox's Fable series). The base game is even available for free. I had lots of fun playing it.

[1] https://store.steampowered.com/app/2373630/Moonring/

A lot of indie devs actually are fine with decompiling/viewing source. Even the STS2 devs have no issue with this. I think it is great and helps the indie dev community. Seeing this has actually made me excited about game dev to the point where I'm beginning to dig in myself.

Haven't used it in almost 10 years but at least back then one sticky point was that unlike unity and the like, opening the exe didn't open an IDE. Just kind of a dummy window. Also building for Mac from Windows was a nightmare since my end user was not technically literate and it didn't just run on their end. But that's likely just a Mac issue