i need to performance test my code parser on spaghetti
does anyone have a link to yandere sim's source code?
I need to performance test my code parser on spaghetti
Other urls found in this thread:
pastebin.com
youtu.be
twitter.com
I heard him talk about how bad his code was but shit this is like pajeet/woman tier
here is his 2500 line update function for EACH student
pastebin.com
I actually popped a rage boner
thanks senpai
>this this this this this this this this this this this this this this this this this this this this this this
Is it meant to be this way?
Not a programmer. Explain why this is bad?
a simple way to put it is the problem 6 times 5
a non stupid person would do 6*5=30
he would do 6+6+6+6+6
>my jobs is to write shit code that works!
fuck yourself yandere-dev youre just a faggot who learned how to market an idea
Nawh it's be more like
(1+1+1+1+1+1)+(1+1+1+1+1+1)+(1+1+1+1+1+1)+(1+1+1+1+1+1)+(1+1+1+1+1+1)+(1+1+1+1+1+1)
>passes statuses as a string
>has a clear hirachy where some stats get endings as a priority
>didnt think to just use a fucking array
>or have attributes which it checks for
turns literally a 4 fork if statement (which is still not ideally designed imo into 12 odd+ fucking choices
Why
12 year olds could write better code than this
the virgin datastructure vs the chad sting if chain
>ctrl+f for (
>no matches
>ctrl+f if (
>830 matches
how
int num8 = 0;
int num9 = num8;
Vector3 vector350 = this.transform.position;
Vector3 vector351 = vector350;
float single63 = (float)num9;
float single64 = single63;
vector351.y = single63;
Vector3 vector352 = vector351;
Vector3 vector353 = vector352;
this.transform.position = vector352;
Really gets the noggin joggin.............
He didn't even bother to make one of the boobs bigger than the other to simulate NATURE
if (Input.GetKey("."))
{
this.BreastSize = this.BreastSize + Time.deltaTime;
if (this.BreastSize > (float)2)
{
this.BreastSize = (float)2;
}
this.RightBreast.localScale = new Vector3(this.BreastSize, this.BreastSize, this.BreastSize);
this.LeftBreast.localScale = new Vector3(this.BreastSize, this.BreastSize, this.BreastSize);
}
he writes it like a guy that wants job security
and that is just retardation
Likely a result of reflecting the c# out of the compiled executable, not his actual coding style.
i-if im reading this right
it could be one line of
this.transform.position = 0
i-i think he needs help
hi evaxephon
I think a better way to explain is to show the redundancy.
on a different note I don't really dabble in code as much as I should, but wouldn't something along the lines of this be a lot better?
if (!this.Witnessed == "Insanity")
{
this.Subtitle.UpdateLabel("TeachInsanityReact")
this.GameOverCause = "Insanity";
}
But knowing me I would probably just do nested if/elses for the variables because I only know some javascript like a pleb.
>comparing strings for this
>a lot better
lol
sorry, I know diddly about code, to be honest. I just tried to figure something out.
>this.DumpTimer = (float)0;
nobody writes code like this, not even retards
AND THAT'S WHERE YOU'RE WRONG KIDDO
youtu.be
I assume that's the guy whose code this is. I'm not saying his style is good or anything, just that those specific complaints aren't really warranted.
The explicit "this" is required to avoid potential naming conflicts. And locally scoped variables in methods cannot have their names reflected back out in c#. Pic related, a snippet I just reflected out of terraria.exe. Note the similar naming conventions.
Sup Forums please go
>41:26
>Teachers[1]
>Teachers[2]
>etc.
why
Newfags please go
Using strings in ifs like that is generally cancer. It can be simplified to an enum and bit flag, and even simpler if you're willing to sacrifice readability.
Also, notice how many times you see the same information being set to UpdateLabel and GameOverCause. It is largely redundant, not to mention the amount of strings being destroyed and created each time this is called.
>bullying someone for decompiled code
Decompiled code would contain function headers and instruction labels, not the raw source.
strings literals are pooled so their ”destruction” and re-use is kind of a non-issue
you should use enums though because they are easier to rename and refactor and will make comparisons faster
So all the Sup Forums posters? Cause they only came for the donald
Except my post has nothing to do with/pol/
Nah, it'd be
transform.position = new Vector3(transform.position.x, 0, transform.position.z);
But still. He doesn't even need to use all those this-es
it literally does tho
But no, it's talking about Yandere-Devs shitty coding please go back to R*ddit
>acting like Sup Forums posters and reddit posters are mutually exclusive
fuck off back to /r/the_donald lmao
>Back to
But I'm from Sup Forums?
Can you not handle another thought?
Why are you defending bad coding?
Is this a coping mechanism for your bad coding?
>Can you not handle another thought?
>Why are you defending bad coding?
>Is this a coping mechanism for your bad coding?
lmao you sound exactly like you're from Sup Forums and /r/the_donald.
Lol ok bro
no u
OH NO NO NO NO
hey, if it works, it works
Hey, if I'm too much of a garbage codemonkey that I write absolutely unmaintainable drool that I have to team up with another with another company so more competent people have to rewrite my so shitty basically pseudo code in a language that matter because I'm also retarded that I wrote the whole game in Javascript, it works
Please leave.
anyone has examples on what the "good" code should look like?
what are most common beginner mistakes or just how to do stuff the right way
i always see these examples and i know they are bad
but i rarely see how it should be done
Why is he always writing (float)10, (float)100, ...?
Wouldnt 10.0 be better if he wanted floats?
If you find yourself writing a shitload of sequential if statements that check one piece of data (in this case this.WitnessedCorpse), you are far better off having a data structure (hash, custom class) which you can key off of to retrieve the values desired.
Here's a way of rewriting it using a hash that is lot easier to read and maintain. I'm not going to implement every case but this will give you an idea of a better way of doing it. I'm going to write this in JS for brevity but doing it in C# or any other language wouldn't take much work.
// List of game over states that can occur.
// firstSetting & secondSetting are placeholders since it's not clear what those parameters do in his code...
const gameOverStates = [
{
witnessed: "Weapon and Blood and Insanity",
label: { text: "Teacher Insanity Reaction", firstSetting: 1, secondSetting: 6 },
cause: "Insanity"
},
{
witnessed: "Weapon and Blood",
label: { text: "Teacher Weapon Reaction", firstSetting: 1, secondSetting: 6 },
cause: "Weapon"
},
{
witnessed: "Weapon and Insanity",
label: { text: "Teacher Insanity Reaction", firstSetting: 1, secondSetting: 6 },
cause: "Insanity"
},
{
witnessed: "Trespassing",
label: { text: "Teacher Insanity Reaction", firstSetting: this.Concern, secondSetting: 6 },
cause: "Insanity"
},
// .. and others
]
// Now we only have 1 conditional.
if(this.Teacher && !this.WitnessedCorpse) {
// Instead of a shitload of if statements that are hard to maintain, we just pull out the data we want
// from our gameOverStates hash and then plug it into the subtitle & game over cause UI.
const settings = gameOverStates[this.Witnessed];
this.Subtitle.UpdateLabel(settings.label.text, settings.label.firstSetting, settings.label.secondSetting);
this.GameOverCause = settings.cause;
}
>16:55
Those excuses are painful.
Why would someone write like this? It doesn't make any sense.
even then this can probably be refactored even more
why have literally every combination of weapon, blood, and insanity combined when you could instead just have all 3 individually be appended to some gameOverState object?
All this code is the exact reason that one should learn to program in a college instead of from "online resources".
so what are 5 things you should never ever do in code?
Yep. I didn't want to go much further because then I was worrying I'd stray too far from the source material and potential confuse newbies. But there are absolutely more ways of improving it here.
What novices should take away from my code are the following:
- It's easier to read
- It's easier to maintain
- No needless conditional checks
- Hash lookups have a O(1) runtime so it's performant
Even as someone who has been programming for 20 years, I still have to give Yandere Dev credit for having a game that runs, spaghetti code or not. It's a hell of a lot of work to get as far as he has in developing a game mostly by himself, and it's something worth giving respect to. But his code really is bad. And I'm pretty sure he knows it.
True. Would you expect a project with something like that to have zero bugs? Yet it only needed one update, which slightly tuned colors for color-blind people
...
HU TOT U HOW TO KOED
Toby was like 19 when he started making Undertale. My code took a huge leap forward from the age of 20-21 and has gotten even far better since. He finished a great game, I don't really care about how bad his code is honestly.
That's the point. As long as it works.