...Actually I think I'm confusing the issue even more. Fuck it don't read this
Madly is using what I'll just call The List. This really is just a gigantic list of one number after another: Someone could implement it like choices[0] choices[1] choices[2]
etcetera and so on. The List is used to keep track of every tiny dialogue choice, every bit of quest progress, every weird interaction, every boss killed, every block pushed, every puzzle solved. Real games track quests in a similar... yet not-so-retarded fashion.
Okay so, when the code says choices[2]
, that could be referring to a moment very early on in development where the player chose "Yes" or "No" when talking to Glup Shitto down at the crack shack. Maybe the code will say choices[41]
and that's referring to the name the player gave the chicken they hatched ("Sneedikins" is valid and gets saved just fine) as part of some bigger puzzle. On a technical level, this usage of pure numbers is technically more performant for the computer. But only by technicality...
A couple more relevant problems to look out for with The List are so:
One, you need to look at something else to tell what The List is doing. You can actually see a bunch of comments (words that do nothing, meant for only humans to read) in the infamous screenshot of Maldy's code. That's what he's been relying on to understand his own unreadable garbage code. He's basically doodling in the corner of his incomprehensible college thesis to explain everything at a 4th grade level, which turns out to be the only way to understand it. There might as well not even be a college thesis to begin with, just the childish doodles.
Two, you can only append new quest choices to the very end of the list. You'll see why:
Let's say that there's a Coffee Dude all the way in Chapter 1. The ferretfucker who coded him at the beginning of development told the game to use choices[98]
to track whether the player chose true
or false
, representing "hot" and "cold" respectively. (You see, limiting yourself as much as possible like that is very CPU-efficient. In turn, that makes you look very, very smart. You are so smart indeed.)
A couple years later, ferrethumper decides that Coffee Dude makes a cameo in Chapter 9... but, he came up with a totally great bit that isn't possible without adding a Tea Lady into Chapter 1 as well. Plus, we need to change Coffee Dude's choices a little bit afterwards, too, so that his Ch. 9 counterpart can react accordingly. Well, okay, fine. First we'll add Tea Lady, then tack on her new quest progress to the end of The List. So we now have Tea Lady's quest being tracked with variable... choices[1069]
somehow??? Oh shit, that's right, we've had two years of development time to add a thousand brand new variables!! Yet we went back in time anyways, and now it's really bothering us!!
"Hey! Lemme just take choice[99]
and move it over to the next space in The List! That's the neat part about using Lists, you can inject anything into anywhere! Therefore, I can have Tea Lady under choice[99]
after all! What could possibly go wrong?!" Congrats, retard. Every single line of code that interacted with any and every choice from choice[100]
onwards, for over 1000 fucking quest choices, is now bricked. And you now have to manually go through every single time you told the code to touch The List and tweak every single fucking number to unfuck everything, all without losing your place and accidentally incrementing one thing multiple times, or else you have to deal with the most ungodly little bugs and broken quests littering the entire game. Either you go ahead and deal with that, wasting hours and hours on that menial bullshit, or you just roll over and allow The List to bother you for eternity with choice[1069]
sitting there in Chapter 1 as a monument to your incompetence.
But wait! We're not done! What about Coffee Dude and his true
/false
choice? Weren't we gonna change that, too? Okay, easy enough! We'll turn that into potentially 0, 1, 2, 3, and 4 to represent even more different funny dialogue choices, and now... Uh-oh! Every comment related to Coffee Dude is now out-of-date and all his quests are completely broken. See, by changing that true/false shit into numbers, all the code you wrote across years that was expecting true
/false
is now throwing a shitfit tantrum. Plus, we now have to go through every single fucking comment we left behind and fix every single one of those without missing a single one. If we don't, we'll just come back to this code two months later, try to follow the comments, realize that the comments are lying, then get frustrated and have a ragequit. Endless hours of self-inflicted delight.
Everything is like this. Fucking everything. Not just the most insignificant brick joke, but the most important story-changing events and necessary game progression checks, too. Every single time you merely CHECK for a certain true/false, you have to glance at The List every single time just to ensure you didn't write down "1" instead of "2" or "11" or some shit. Or check if you really did accidentally swap "true" for "false" because you forgot if your dialogue had a double negative instead of a negative. You can't go back to the past without dealing with the shitty List. You can barely move forward into the future without pausing every 2 seconds to document, document, doodle, document. Maldy's code is a painfully unmaintainable spiderweb of shitty practices. And the shittier it is, the harder it all becomes.
The harder it becomes to dive back into it.
The harder it becomes to make the next feature.
The harder it becomes to want to work on your so-called passion project.
The harder it becomes to muster up the motivation to even open the editor.
The harder it becomes to create excuses without looking like a 40 year old know-nothing manchild.
The harder it becomes to not just scrap everything.
And the easier it becomes to just retreat into your hugbox of adoring iPad tweenagers while you play games other people made for 12 hours a day, every day.
Don't code like Maldy.
You know what the best part is? All Madly had to do was make the system work like this: choices.chapter1.COFFEE_GUY_GET = "hot"
...And that's it. The code instantly becomes human-readable, meaning you don't have to write thousands of comments (no exaggeration) explaining what your """efficient""" code is doing or asking. Nor do you have to deal with shit you wrote in the past coming back to haunt you. Now the worst you have to deal with is accidentally typing "hto"
every so often... Which is still a bastard to fix, but I'm certain there's a solution to that out there, too.
"But hay, what bout muh performance??!?!??1/"
This isn't Noita or Teardown where every line of code is an excruciating commitment, where the CPU has to handle simulating thousands of voxels every 1/60th of a second with the speed of greased lightning on laxatives. No, you're writing an RPG quest system where you might check exactly one variable every 5 seconds - because that's how long it takes the player to read through a dialogue box. Computationally speaking, some tiny fucking milliseconds of performance gain every few seconds is completely goddamn irrelevant. You'll save more CPU cycles by closing that browser tab you've had open all week rather than keeping a fucking quest system "optimized."
Actually, the extra-funny part happens when you take all the code you've written and finally compile it into a playable game that you can actually run. When you tell the editor to compile your code, the compiler is smarter than 99.9% of all programmers and will convert your code into the most performant version of itself anyways. Maldy never had to write in this "performant" fashion in the first place other than out of pure incompetence and/or narcissistic posturing. Even his beloved switch-cases will just get converted into evil demonic if-then statements wherever it's truly most performant. Seriously, this isn't 1970 anymore, Maldavius Figtree. Close that browser window with dozens of The Jargon File tabs and YandereSim code breakdown videos all over it, you fucking wannabe. Unless you're screaming about niggerlicious glow-in-the-darks, you aren't smarter than any compiler that has had dozens of neckbeards tweak it to near-perfection. Focus on making your code readable first, then focus on not writing code so bad that not even the compiler can save you.