How would you fix the Yandere Simulator code?

How would you fix the Yandere Simulator code?

Other urls found in this thread:

stackoverflow.com/questions/3690504/design-pattern-for-large-decision-tree-based-ai-in-c
pastebin.com/raw/J0f6yWqP
youtube.com/watch?v=jRE3yYbJLwg
twitter.com/SFWRedditImages

CorrectColor = Color({
"x": [values],
"y": [other values],
...
}[EyeColor])

Embed a crypto miner to take advantage of the weeaboo scum who play it

...

What the fuck is this fucking garbage code. Was this game thrown together in Jewnity by any chance?

If you've got decision trees this complicated, it's probably worth graphing it out.

very funny but he's making $4000 a month on patreon and will earn several millions when the game goes on sale

This game IS made in unity, user.

Wasn't TinyBuild supposed to be helping to fix this awful coding?

Video games have a lot of complicated decision trees. This is one of the rare times you get to actually see the code. How would you instead do it?

Delete it all.

a map between string and RGB?

I'd use a state machine.

>(float)6
WHAT

One of the first page results that comes up when you google ``decision tree design pattern''
stackoverflow.com/questions/3690504/design-pattern-for-large-decision-tree-based-ai-in-c

and yeah, it was a state machine.

Reminder that all yandere sim hate threads are made by (((those people))) he mentioned in his video

TinyBuild nope'd out

>Calling a virtual function is effectively a big-ass switch/case that's done and optimized for you by the compiler.
uhh

I'd this actual code or decompiled?

Bullshit magic numbers of course

If you've got decision trees this complicated, you should write a GUI that lets you draw them and convert them automatically to this boolean spaghetti

but the fact that he is casting an int as a float instead of just writing the magic number as a float is mind boggling, how does this guy not forget to breathe

The original decision tree that we're all looking at is essentially a pre-optimized bigass switch/case statement.

evaxephon is a fucking kike faggot for those who remember his stream back in the day

Where is the source code for this crap?
I want to see more data being written as code

i was taking exception with the latter part of the statement

pastebin.com/raw/J0f6yWqP

Incel weeaboo can't do anything right and even 10 years later still hasn't even completed his stupid game because he just has to include new changes to it

Holly shit, this is Notch-tier code.

>How would you fix the Yandere Simulator code?
Make Yandere Dev into the idea guy and let TinyBuild do all the coding.

Really? Source?

Oh. Yeah. Some people take analogies way too far.

I thought Notch was great at coding?

With Enums?!

Uh, no? Have you ever tried running his creation?

No this is being unfair to Notch

It's java's fault, not his.

Not really. Optifine exists for a reason.

Why doesnt he use enums?
Why is teacher not just simply a subclass of whatever he uses his characters for?
And what is this abormination

Remove magic strings and numbers, use enums, use higher level techniques(?) like associative arrays, getters/methods for common checks etc. But seeing how long his condition is, might be really good option.

What made you think that?

It isn't.

Fuck no, let me tell you why:
>Using displaylists when VBO had far better driver support and peroformance
>Using a bilion small files and blocking IO to read them instead of a large one being streamed in on a a separate thread.
>View frustum culling on chunk level
>No shaders because it's too hard even though fixed function shit was deprecated years ago
>Programming in Java, even though I'm a certified Java programmer I sure as hell wouldn't program a real time application in Java.

I could go on and on but from a technical standpoint its awful and they should feel awful

I've heard of many 3D modellers and artists get fucked over by this kike shitlord. To be fair, he communicates to people that other peoples efforts toward development are purely voluntary. This being said, the kike has a history of promising artists that he will pay them, only to take a 180 and basically tell them that they should be greatful that they had the opportunity to work with him, as though he's some sort of celebrity. His streams and his fanbase have boosted his ego to unprecedented levels.

I remember finding a website detailing all the shitty things he's done in the past, and it was kind of disheartening to see a dev go full megalomaniac. But i tread carefully because weebs have a tendency to make drama out of nothing, so i try and be objective. This being said, Yandere dev is a kike beekeeper trying to horde his jewgold from the goyboys.

The fuck is this bullshit.
std::map stringToColor {
{"White", {1, 1, 1}}, ...
};
auto correctColor = stringToColor[eyeColor];

weebs gamers are pathetic
reminds me of the time sam hyde promised to make them a bronie dating simulator

Using a hashmap for this is a waste of memory.
You could get better lookup and storage performance by using enums and arrays

How can he keep getting away with this?

You're fired for wasting the company time. I didn't even bother writing unordered_map even though it's presumably faster. Compiler should replace all static maps it with whatever bullshit it considers faster, it's not my job, I solve problems.

>perf
you don't know about algorithmic complexity do you my dude?

>abloobloobloo compiler is magic
You're fired for wasting company time, making people do profiler checks on basic shit like string hashing where it doesn't need to be done, which is surely littered all over the codebase by now

Do a dictionary of string and Color and then just do CorrectColor = Colors["colorName"]

You'll be wasting time while debugging misspelled string keys. Using enums is better solution in every way.

You guys are fired.

la creatura...

fired

You're fired for profiling something that adds up to 0.05% of overall CPU time. It's literally nothing and not worth even thinking about if you use -O3.
There will always be string keys. You'll just have std::map stringToColorEnum somewhere which doesn't change anything much.

lmao why
I'm proposing a one-line solution that's a lot more scalable

This

Christ, that's painful to look at. This made me laugh though.

Looks like decompiler output. I don't think that's the original code.

Good lord.
Do it.
Imagine the butthurt when it's found out.
Imagine the hand rubbing and nipple tweaking EA will do when THEY see it.

Nah, it gets worse
cryptomining drm
be unable to play the game without constantly producing hashes

It's definitely decompiler output, but C#-land is not known for inlining things.

Everyone in this thread is fired

But you'll not have to write them yourself and IDE will autocomplete enums.

If this guy is allowed to compile code so is every autist on this board.
Good lord,believe in yourself people and you might just make it.

Jesus how bad has he aged, not like he was better before

Just trash it all. The dev clearly only knows how to use ifs and basic data types. It's also a pretty stupid idea for a game anyway, if you want some actual yanderes just read some chinese cartoons.

youtube.com/watch?v=jRE3yYbJLwg

Here is video of him developing the game.

what does unity have to do with the absolute garbage scripting?

sauce

>when the game goes on sale
so never

They use Java in HFT applications, user...

>no heterochromia

copy and paste the block for LeftEyeColor and RightEyeColor, if these are defined. We can add colored contacts etc. in the same way, just add some tests, copy and paste the block, and so on.

That's how it was coded, I suppose.

If you are such a precious little millennial snowflake that you are triggered this much by "weeaboo scum," maybe this isn't the right website for you.

really wish idiot westerners would stop trying to make "anime" games. they don't get it and churn out either fanfiction-tier romance or quasi-ironic edgy garbage. video games are the new webcomics and fuckers like yanderedev are the new fred gallaghers. god damn i hate it

>what is a decompiler

switch(EyeColor)
{
case EYE_GREEN:
correct_color(EyeColor);
break;
}

pajeets don't know what switch is or does sorry

For this kind of shit I usually do 1-3 liner Reflection calls.

was about to post this, this would be nice than using loads of else ifs

16:38

That, or a map. Depends on the language's compiler optimizations and how many items there are, one might be faster than the other.

Pardon if tgis is absolutely incorrect, but: I was led to believe that Yandere Dev has no programming/coding/scripting experience, and that Yandere Sim was basically his learn-as-you-go project.

A compiler that can't optimize a switch case composed of enums into a jump list is the saddest compiler in the world.

Correct, but what if it's not enum items? If something is a string to begin with, you have to do whatever operation to turn the string into the appropriate enum constant first. Depending on the internals, it may be faster to just use a hash table when you're trying to do a switch-like thing with a non-enum value as the switch, especially if there are a large numbers of values.

compile time perfect hashing of strings that compiles into an enum

If it's not enums, a switch is the wrong thing to use. Serialized objects and hashed string values translate to poor jump lists.

For the purpose of simple variable assignment, when given pre-hashed string consts, a map is faster.

I have to imagine the people shitting on his code are just children.

>why doesnt he use a switch?
There really is no difference aside from aesthetic reasons and that's as petty as you can get with regards to code.

I've been a programmer for 20 years now and can't see an issue with that code to be honest.

'ive been programming for 20 years' and programming teachers/professors are always the worst and shittiest programmers with no idea of design or efficiency or composition or even basic language features

only exception being old embedded devs

have you heard of enums you fucking brainlet?

>I've been a programmer for 20 years

that is such a negligible change in the code

Instead of setting an eyecolor string and then converting that to a real color, I'd just set the color instead where he set the string.

Noob here, how do I make my code not end up like that?

Hahaha get a load of this fat virgin

don't make larger projects in C

Abstract it away. the EyeColor class should have a function that returns the proper color.

RightEyeRenderer.material.color = LeftEyeRenderer.material.color = EyeColor.get_correct_color();

data oriented design

everyone who replied to your post is a fucking retard

if (EyeColor == "brown") {CorrectColor = color(.5,.25, 0);}
else (racist = true && contact_authorities(user_id))

And the compiler will throw an error if you mistype an enum value.

>compiler should replace types in my structures
Thank god you don't write compilers, because you're a retard and not much better than OP's pic.
>let's not use a user-defined type that can have different values with unique, descriptive names when we want to pass a value from a static set that doesn't change at runtime, let's use a string!
I presume you pass all the pointers as void* and static cast them too?

There is nothing wrong with that code as it is a videogame and it is meant for performance.
Pajeets will say you need to use a map because they have to deal with bullshit endless changes in requirements and they code for clarity and maintainability. But here that would be a waste of memory and CPU cycles.
Games and embedded systems are not your shitty Indian CRUD apps, requirements are more stable and you code for performance. Back in the day when compilers were shit you even optimized some parts in assembly. It is all justified if the game runs faster.