Yandere Simulator Complete Source Code Analysis - Code Review

1,789,371
0
Published 2020-07-09
Deranged, insane, mouth-breathing gremlin reviews Yandere Simulator's code for 57 whole minutes.

The purpose of this video is to let everyone learn from one man's mistakes, from a mostly objective point of view, focusing ONLY on the code and resolving any and all misconceptions and myths. I've learned a great deal about the internals of this game, Unity, and C#. Hopefully, you'll walk away knowing something you didn't know before.

00:00 Introduction
01:22 Exploratory Benchmarks
03:48 Profiling
20:46 Actual Performance Concerns
21:40 Current Architecture
24:34 Hypothetical Architecture
28:52 Implementation Details
49:33 The Little Things
53:08 Style
54:26 Conclusion
55:48 Outro

Outro music by Nick Seeth: soundcloud.com/user-604826460-609762924
I made all the other music: soundcloud.com/rollthedyc3/sets/yandere-sim-code-r…

Edited by Clock Man:    / @clockmanoffical  

----------------------------------

Watch me live on twitch: twitch.tv/rollthedyc3
Follow me on twitter: twitter.com/rollthedyc3
Check out my projects: github.com/dyc3

Watch this video with your friends: opentogethertube.com/quickroom?service=youtube&id=…

All Comments (21)
  • @rollthedyc3
    CORRECTION: The sqrt instruction does not take 1 clock cycle. More like 20-60. It's still pretty fast though, and we don't have to check for distances often enough that this matters. CORRECTION: Combining meshes does not necessarily reduce draw calls. I think Unity does it to improve load times. SO WHY IS THE GAME SLOW? See: youtube.com/post/UgwqYKf598HtLsnKV314AaABCQ I'm sorry for all the mic popping. :( Tried to fix it in post as much as possible, but we couldn't get all of it. About drawcalls: Unfortunately, Unity's frame debugger does not work on linux. However, pointing the camera at all the students causes the game to render about 2 million triangles, and looking away makes the game render about 200k triangles. Don't need the frame debugger to deduce the problem here. Apparently there is a lot I don't know about graphics engineering. Sounds like a good topic for another video.... UPDATE: I took a very brief look at the frame debugger on windows, and it pretty clearly explains why looking at students decreases the framerate so much. Here's a summary of what I found: - Students are drawn twice, using 2 different shaders, one without the toon outline, and one with the toon outline. - The student's irises have their own draw calls. Some irises have little shines in them, which are on another iris mesh, with their own draw call. - Each modular part of each student has it's own draw call. I've been working with Yandere Dev to optimize the game and bring the framerate up.
  • @billvolk4236
    I find it hilarious that the biggest file in the game is a model of a toothbrush that he just bought from an asset store and never noticed that it has polygons for every individual bristle.
  • @loft1543
    My man be lookin like coraline's dad.
  • @MoeMoeStudio
    Yandere's code can turn out to have educational value. His code should be on exams or homeworks and ask students to identify the problems
  • @RandomPianoMan
    "Inconsistent use of tabs and spaces" "F-ing pick one" I felt that
  • @DarthOmix
    "If he spent another hour on [this], it would have potentially saved him a couple years of grief." That's it, that's the game in a nutshell.
  • @owl1095
    Me who doesn't know anything about coding: "Yeah, you're perfectly right."
  • @HydratedBeans
    I’m a senior software engineer, so I feel qualified to say this video is very, very good. It really scratches the itch I have for technical deep dives that are actually entertaining. This video has the quality of video essayists with millions of subs and the code review quality is better than anything I’ve seen in a professional environment. I’ll be sticking around even if I have to wait months between videos.
  • @skedlkej
    “don’t decompile my code” “Ok, I’ll do it while you don’t watch
  • @skywolfie8573
    'sort of implied that he didn't want me to do it' 'so I did it anyway' You mad lad
  • @saniancreations
    I can not stop laughing over the irony that one of the reasons people complain about framerate..... is that yanderedev implemented the framerate display so poorly that it displays lower frames than it actually has. (48:50)
  • @soranuareane
    "The compiler is smarter than you." As an experienced software architect with decades of experience in this, you are 100% correct. I've only met a small number of people who could confidently claim to be smarter than a modern compiler (the compiler design professor at University, for one), but even he touts that modern compilers are so advanced that these minute optimizations are unnecessary. Make it work. Make it fast. In that order.
  • This guy turned up, made a single million view video, then left. Absolute fucking hero.
  • @valumtimes
    I don't understand 80% of what you're saying, but I deeply appreciate the polished visuals and editing, your natural charisma and calming voice, and how comprehensive I have to assume all of this is. I didn't even realize I had watched the entire thing until it was nearly done.
  • @amenokagaseo
    "a dark magic ritual known only to the compiler gods" so like building any cmake project
  • @TinBryn
    I liked your take on how everyone suggests converting the else ifs into switch statements. The problem isn't the style of large conditional statements, the problem is large conditional statements.
  • @esentries
    "The compiler is smarter than you." Completely valid statement.
  • @Wiizl
    Finally a real analysis of the whole thing! Not just "IF-ELSE bad, SWITCH good!!!"
  • @ethanyeung6216
    yo your music slaps, didn't realize you made all of it yourself
  • @-ja
    Holy shit where did you COME FROM!? An hour of A1 editing, incredibly understandable concept presentation, insane amounts of knowledge/info on both Unity and computer science in general. This is crazy. This video has like several years worth of game dev knowledge/analytics shoved into it. You have under 100k subs, 2 videos, like what the hellll?!?! Your transition materials and songs are fucking well-found too. I don't understand where you came from bro, this is nuts.