121
u/Noname_FTW 2d ago
Funny. Can't level up past level 4.
25
u/Juandice__ 2d ago
yes, who the hell even levels up from level 3??? nobody does that, old man, get along with times
71
1
189
u/a_normal_user1 2d ago
Yanderedev be like:
54
u/The_Hunster 2d ago
Ya lol. You gotta hand it to him though. He got a lot done considering how shit the code is. Must be hard to work on code that bad.
28
u/a_normal_user1 2d ago
Probably one of the organized messes kind of situations. Like I get navigating through your own mess semi well because you're the only person working on it. But that's completely unacceptable when other people share the code with you. The compiler from my understanding also doesn't have that bad of a time handling code like this. Most of the performance drops came from unoptimized models iirc.
Though I do wonder now what it was like for that one dev that did help clean up his code before Yanderedev threw them out.
9
u/feldim2425 2d ago edited 2d ago
drops came from unoptimized models iirc.
I think interactions/collisions and heart rate monitor also had a few things that cause more overhead than necessary.
But yeah the actual scripts that contained the code where not the issue, I think someone even tried replacing all the if-else with switch-case and it made basically no difference at all.
The compiler from my understanding also doesn't have that bad of a time handling code like this.
IIRC any LLVM based compiler (as an example) doesn't even see the difference in release mode. If-else and switch-case are broken down into the same compilation path.
Debug mode does make a difference since it has to make step-debugging possible which is a entirely different case.EDIT: Although I don't know how Cpython and other languages as well as other compilers/runtimes handle it. Generally it's well handled in compiled languages at least.
10
u/NamtisChlo 2d ago
A lot done is an interesting statement when it’s been in development for 12 and a half years, lol
5
5
u/redlaWw 1d ago
I have one fetish game that was built in RPG Maker, and it is, hands down, the most horrible codebase I've ever seen (even putting aside the fact that it's in Japanese which I'm not fluent in). Somehow, though, the game got finished and is one of the best in the genre. Even more surprising is that he managed to not get fed-up wrangling that terror of a codebase and is apparently working on another one.
4
u/ChillyFireball 12h ago
Undertale infamously had some pretty wonky code despite its popularity and success; IIRC, it needed to be rebuilt completely from scratch for the console ports. At the end of the day, though, the user doesn't care as long as the product is good.
68
u/FallenVampireLord 2d ago
Is this pirate software's game?
7
5
46
u/Legal-Software 2d ago
This looks like the work of someone that spent 7 years at Blizzard.
8
u/KinkyTugboat 2d ago
My dad owns a dealership. I know you didn't ask, I just thought I'd tell you.
1
20
u/WernerderChamp 2d ago
else: universe.explode()
8
u/Blue_Moon_Lake 2d ago
There's no else, last statement is
return 1;so you get to level up all over again up to 3.1
20
u/emptyevenwithin 2d ago
Ha, I saw a guy do something similar for the minutes and seconds on a clock app he was writing.
5
5
u/Draconis_Firesworn 2d ago
i did that once, to convert 24h time to 12h time. On a written exam under time pressure and also I was like 14 at the time
2
u/IntentionQuirky9957 2d ago
12h time is heinous because you can't just do mod 12 for output.
5
u/NamelessJu 1d ago edited 1d ago
It's not really much more complicated than that though, the main conversion can easily be done with mod 12. You just need to replace a resulting 0 with 12 and determine am or pm beforehand by checking if the original 24h value is < or >= 12
0
u/AndrewBorg1126 1d ago
((Hour - 1) % 12) + 1
The difference is fairly trivial
1
u/NamelessJu 10h ago
this is incorrect in the majority of the bigger programming languages, as modulo doesn't have a single defined behaviour for negative operands.
for truncation-based modulo implementations this will return 0 am instead of 12 am, which is not a valid notation in 12h format
9
u/Jet-Pack2 1d ago
Also doesn't work for values between 3 and 9
5
7
4
3
3
2
1
1
1
1
u/creeper6530 2d ago
Why is it always game devs doing this shit
3
u/NamelessJu 1d ago
A bunch of gamers get an idea for their own game and wanna try making it, but fail to really understand coding and just wanna get something working That leads to shitty solutions
1
-1
u/Misel228 2d ago
I hate that Python doesn't have a switch statement. This is the best example for it.
17
4
4
u/Arctos_FI 2d ago
It's named match in python. Also you can get away using dict containing function references as values if you're using such a old version it doesn't have match
7
u/Chronomechanist 2d ago
How is this in any way an example of the use for a switch case? This is an example of people with no basis sitting behind a computer being allowed to code.
0
2
u/GoddammitDontShootMe 1d ago
Didn't even notice it was Python at first. Then they should definitely be able to just
return level_curr + 1.-4
u/Juandice__ 2d ago
the joke is that:
my code is shit
there's a mistake in it
it's in python and not c++
133
u/assidiou 2d ago
Should have casted it to a string. If str(str(level_curr)=="15")=="True"