Yandere Simulator Complete Source Code Analysis - Code Review

Поделиться
HTML-код
  • Опубликовано: 1 июн 2024
  • 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: / user-604826460-609762924
    I made all the other music: / yandere-sim-code-review
    Edited by Clock Man: / @az3epic
    ----------------------------------
    Watch me live on twitch: / rollthedyc3
    Follow me on twitter: / rollthedyc3
    Check out my projects: github.com/dyc3
    Watch this video with your friends: opentogethertube.com/quickroo...
  • НаукаНаука

Комментарии • 4,3 тыс.

  • @rollthedyc3
    @rollthedyc3  3 года назад +7336

    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: ruclips.net/user/postUgwqYKf598HtLsnKV314AaABCQ
    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.

    • @ScottE-2
      @ScottE-2 3 года назад +107

      At least it went well from the early and midway portions. Though as it reached after that, it started to become more noticeable.

    • @jeromevv4165
      @jeromevv4165 3 года назад +44

      you are a god.

    • @gamingbud926
      @gamingbud926 3 года назад +22

      Didn't even notice :)

    • @CirkusBolgen
      @CirkusBolgen 3 года назад +143

      Put the mic on your chin. Leads to constant distance from your mouth. Leads to constant volume. If popping too much: Plosive filter. Can be DIY-ed. Also: Don't swallow the ends of your sentences. And put more effort into annunciation
      -
      Structure of video: Put more time into it
      -
      Transitions: Use consistent ones, with backgrounds that are less distracting
      -
      Text: You put up much more of it than is needed, leading viewers to have to pause often, and search for the difference. Simplify.
      -
      Thank you for making this video

    • @sashaenglebert5932
      @sashaenglebert5932 3 года назад +83

      @MJ you mean the 31 year old coder who linked this video on his wordpress and thanked this dude's help?

  • @billvolk4236
    @billvolk4236 3 года назад +24287

    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.

    • @kittycat344
      @kittycat344 3 года назад +1539

      where/when does a toothbrush even appear in the game ????

    • @TeknoJackal
      @TeknoJackal 3 года назад +3789

      @Bill Volk When I was in art school (like three years ago exactly), I had a part of a 3D animated shot where I had to build a bathroom scene. I couldn’t be damned to figure out how to make a toothbrush (because I was trying to model it hair by hair along the brush) so I went the easy and efficient route of getting a toothbrush asset.
      I watch this video and when he shows the toothbrush, it was the EXACT one I tried using in my project. The model shown was one of the results that showed it had tons of downloads by other users, which told me that tons of people found this model reliable, in specs, it said it was game-ready/animation file type, on top of that it was FREE, so I thought of course I would use it.
      When I loaded the model in, it was bigger than the character model (which are big models when loaded into scene/work environment) which I found strange, so I tried shrinking it.
      It slowed the program frame rate to a freeze for 3 seconds, for a model that has no animation rig, that said to me this is a REALLY hefty model polygons wise. My teacher saw what I was kerfuffling with and told me to delete the model from the project and we made one with less polygons and it took five minutes, she then told me that models like this are used for commercials, with CGI rendering and good for shots where you have a close up toothbrush and stuff for B-roll; shots where a camera encircles like a helicopter over a giant fucking toothbrush all cool and shit. She told me if I used this model it would take 10-15 minutes to quick compile (basically make a .mov file without rendering textures and stuff, which usually takes 2-3 minutes for a 10 second shot at the LONGEST).

    • @TeknoJackal
      @TeknoJackal 3 года назад +1026

      @Bill Volk I just wanted to talk about a fun story coincidentally involving the same toothbrush model shown, but for TL;DR
      -The toothbrush shown is one I used myself and it was free, but meant for cgi commercials, meaning the problem of accidentally putting this in your project is more likely than you may think, from my personal experience

    • @Roboshi2007
      @Roboshi2007 3 года назад +229

      @@kittycat344 protags bedroom I believe.

    • @fluffybun713
      @fluffybun713 3 года назад +601

      @@kittycat344 it appears when you enter ayanos room its in senpais "shrine" which consist of shit she stole from him or things he threw away

  • @DarthOmix
    @DarthOmix 3 года назад +14440

    "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.

    • @ccbf1091
      @ccbf1091 3 года назад +657

      That reminds me of the situation with tinybuild, since he stopped working with them simply because he wouldn't have been able to update the game for a few months, even though it would've surely helped him a lot

    • @vraolet
      @vraolet 3 года назад +636

      @@ccbf1091 I'm pretty sure that's his excuse and the real reason is that he would have had to learn to code in order to work with a proper developer and he didn't like that.
      Also, TinyBuild was pretty clear about removing the lewd mechanics because they didn't want that on their brand.

    • @hitwoman5650
      @hitwoman5650 3 года назад +458

      @@vraolet i mean it's understandable. _Young_ _girls_ with lewdity is not something I'd want with my company. and yeah, I agree with that first part

    • @lewdowo8067
      @lewdowo8067 2 года назад +162

      He actively sabotaged the games progress in every way he could. Just imagine him not getting his patreon money which was purely for finishing the game. Even today he still gets 1.6 k monthly

    • @demonking86420
      @demonking86420 2 года назад +66

      @@vraolet also he didnt like the other dev/s "changing his code"

  • @MoeMoeStudio
    @MoeMoeStudio 3 года назад +13345

    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
    @RandomPianoMan 3 года назад +3617

    "Inconsistent use of tabs and spaces"
    "F-ing pick one"
    I felt that

    • @TimeTravelingFetus
      @TimeTravelingFetus 2 года назад +196

      I'm inclined to believe that's because he just copypasted code from different people, but if he did that the code would probably be good so I don't even know

    • @intelchip_x86
      @intelchip_x86 2 года назад

      what the fuck is wrong with him?

    • @rayhimmel7167
      @rayhimmel7167 Год назад +113

      @@TimeTravelingFetus maybe he was copying the code from stack overflow but, you know, from the questions

    • @mariocamspam72
      @mariocamspam72 10 месяцев назад +30

      ​@@rayhimmel7167Mainstream C# IDEs run silent formatting passes when pasting code, so it's even more perplexing how he managed that.

    • @Mabra51
      @Mabra51 8 месяцев назад

      fucking*

  • @loft1543
    @loft1543 3 года назад +11756

    My man be lookin like coraline's dad.

    • @ethanwinters1469
      @ethanwinters1469 3 года назад +622

      Ya winning dad?

    • @narriee8098
      @narriee8098 3 года назад +621

      Are ya coding Dad?

    • @SeymourDisapproves
      @SeymourDisapproves 3 года назад +154

      No bullying >:(
      /j

    • @varundeva1931
      @varundeva1931 3 года назад +105

      If you're watching this video you probably already look like coraline's dad :(

    • @sazsha
      @sazsha 3 года назад +5

      Prince of hell Elmo Floorgang gang

  • @owl1095
    @owl1095 3 года назад +7959

    Me who doesn't know anything about coding: "Yeah, you're perfectly right."

    • @ona512
      @ona512 3 года назад +380

      Me who knows only a very minimal amount of coding, and only with java and nothing for Unity: "I guess you have a point, huh?"

    • @ferociousmaliciousghost
      @ferociousmaliciousghost 3 года назад +229

      Me who learned how to code python and a little bit of java in an online class in grade school but completely forgot everything: "I see, that is indeed correct!"

    • @jake_dev1046
      @jake_dev1046 3 года назад +102

      print (“Yandere Sim will never be finished.”)
      else
      end
      end
      end)

    • @jake_dev1046
      @jake_dev1046 3 года назад +11

      @envy lua language has end

    • @jake_dev1046
      @jake_dev1046 3 года назад +7

      @envy i mostly code in lua

  • @HydratedBeans
    @HydratedBeans 3 года назад +7697

    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.

    • @HydratedBeans
      @HydratedBeans 3 года назад +49

      @Saitama Baldy thankfully no. Never really had acne except for at age 13.

    • @brtomassampaio
      @brtomassampaio 3 года назад +4

      @@HydratedBeans soooooo, do you know animes and the concept of Yandere?

    • @HydratedBeans
      @HydratedBeans 3 года назад +31

      @@brtomassampaio yeah, but just the basics.

    • @eschcal1619
      @eschcal1619 3 года назад +8

      I only use tools like UAE/UABE/DnSPY to create my own mods or have some fun editing values and seeing what the games do, but I never really got into the actual dev tools to create, just to edit. Even I was able to understand a large portion of this fellas breakdown, which I consider amazing, and I even learned a thing or two.

    • @sandraswan9008
      @sandraswan9008 3 года назад +1

      @Saitama Baldy uhhhhh

  • @soranuareane
    @soranuareane 11 месяцев назад +1353

    "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.

    • @oliver_twistor
      @oliver_twistor 6 месяцев назад +28

      Sometimes people's attempts to outsmart the compiler can trip up the compiler so the code runs even _slower_ than "unoptimised" code would do.

    • @turbochargedfilms
      @turbochargedfilms 6 месяцев назад +16

      "Trust the compiler" is to software what "never trust the autorouter" is to hardware

    • @originalcomment4818
      @originalcomment4818 6 месяцев назад +10

      Make it understandable, but also make it efficient. At some point, a compiler can't turn shitty code into good code.

    • @thewhitefalcon8539
      @thewhitefalcon8539 5 месяцев назад +7

      "The compiler is smarter than you." means you don't need to always try to outsmart the compiler every moment of your programming. People used to write

    • @KayOScode
      @KayOScode 5 месяцев назад +3

      Sometimes I can write code in assembly that executes faster than the equivalent optimized c code. But I don’t do it often because it takes too long. Also I can almost always massage the underlying c or c++ to help the compiler make it more than fast enough

  • @skywolfie8573
    @skywolfie8573 3 года назад +4982

    'sort of implied that he didn't want me to do it'
    'so I did it anyway'
    You mad lad

  • @Rycluse
    @Rycluse 3 года назад +3725

    Is this... good faith criticism? Coming from knowledge and experience instead of guesswork? That exists?

    • @MelonDev04
      @MelonDev04 3 года назад +38

      Rycluse Yes it does exist

    • @nonamezgamez4041
      @nonamezgamez4041 3 года назад +9

      Boi i think it is what you say it is.

    • @ootdega
      @ootdega 3 года назад +122

      That's what happens when you're an actual professional, not a manchild joining in a circlejerk.

    • @HydratedBeans
      @HydratedBeans 3 года назад +194

      Yeah people pay tens of thousands of dollars for deep dive reviews like this. Hopefully the dev will take the constructive criticism because he just got a free gold mine.

    • @thesammurairat700
      @thesammurairat700 3 года назад +15

      I mean he does work for YanDev so why would he shame him over Miss Information?

  • @skedlkej
    @skedlkej 3 года назад +271

    “don’t decompile my code”
    “Ok, I’ll do it while you don’t watch

  • @-ja
    @-ja 3 года назад +1797

    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.

    • @michaelmartiarena625
      @michaelmartiarena625 2 года назад +48

      i think he has got 2 vids because he's more of a streamer, but i agree, the quality is dope and he deserves more subs.

  • @saniancreations
    @saniancreations 3 года назад +9503

    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)

    • @etam8099
      @etam8099 3 года назад +599

      LMAO is that fr?!!?

    • @imbadatusernames3304
      @imbadatusernames3304 3 года назад +841

      @@etam8099 ig he was trying to predict how slow it would be, thats funny

    • @420eater
      @420eater 3 года назад +80

      LMFAO

    • @keychain3554
      @keychain3554 3 года назад +189

      Ok let’s get to the bottom of this I’m going to run msi afterburner

    • @ThatDude-qw1sg
      @ThatDude-qw1sg 3 года назад +76

      He gonna cook this dudes code

  • @valumtimes
    @valumtimes 3 года назад +5770

    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.

    • @computer_toucher
      @computer_toucher 3 года назад +117

      Same on the polished visuals; the presentation is top notch. Fun thing for me is it made realize I understand more about the hardcore concepts and details about programming than I thought. Like I thought it was a given that people knew about compilers optimizing conditional statements...
      Apparently I can humblebrag to myself that I am on the right side of Dunning-Kruger...

    • @Strawberrypersonoffixial
      @Strawberrypersonoffixial 3 года назад +3

      Me

    • @Dystopie173
      @Dystopie173 3 года назад +6

      @@computer_toucher l actually had the exact same thought after this video.

    • @hrhcrab
      @hrhcrab 3 года назад +12

      I don't know how much of it I understand (I'm a novice programmer), and I have no interest whatsoever in Yandere (whatever the fuck that is), C#, the unity engine or game development, but I found this to be an excellent and compelling technical presentation.

    • @TheHadMatters
      @TheHadMatters 3 года назад +2

      He's like a polished male version of Caroline Konstnar with a skill.

  • @rorysparshott4223
    @rorysparshott4223 7 месяцев назад +113

    This guy turned up, made a single million view video, then left. Absolute fucking hero.

  • @TinBryn
    @TinBryn 2 года назад +750

    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.

    • @kylek.3689
      @kylek.3689 2 года назад +72

      Exactly! And if you refer to Microsoft's documentation, switch statements are effectively syntactical sugar for if/else if/else chains!
      *A switch statement executes the statement list in the first switch section whose case pattern matches a match expression and whose case guard, if present, evaluates to true. A switch statement evaluates case patterns in text order from top to bottom.*
      -- Selection statements (C# reference)

    • @BarioIDL
      @BarioIDL 2 года назад +8

      @@kylek.3689 if else is great if you need to compare stuffs too

    • @yourbiggestfan395
      @yourbiggestfan395 11 месяцев назад

      you made me laugh a lot, thank you.

    • @skvader4187
      @skvader4187 11 месяцев назад +32

      Most people saying that else If statements are bad, are people who are not game devs or programmers.

    • @toxicitzi357
      @toxicitzi357 9 месяцев назад +8

      ​@@skvader4187they probably are, but they're also so pretentious that I want to believe they only exist in hobbyist places and outside of workplaces in general..

  •  3 года назад +2197

    The fact that this is the first "YandDev code review" that doesnt start with "I'm not a programmer/I don't use C-Sharp/I havent used Unity" its quite telling on most of the discourse on his code.

    • @proxy1035
      @proxy1035 3 года назад +143

      ​@@weakspirit_ compilers are literal magic and can optimize things you never thought about. but they can't fix everything, as seen in the video...
      and it's still better to try and write "good" code, not because it would run much faster but because it would make more readable and easier to work with.
      even if you just write something by yourself, if you choose stupid variable names, format stuff shitty, and don't add useful comments, you're not gonna know what is going on in your code if you stopped working on it for some time.

    • @a.n.l.aantineoliberalismas4504
      @a.n.l.aantineoliberalismas4504 3 года назад +8

      @@weakspirit_ yha most if the drama around him is also bs

    • @skeleyold5991
      @skeleyold5991 3 года назад +64

      I mean it doesn't change the fact that the game runs like trash

    • @harrylane4
      @harrylane4 3 года назад +76

      @@a.n.l.aantineoliberalismas4504 no. No it's not. Dudes a dick.

    • @bonelesscommunism4031
      @bonelesscommunism4031 3 года назад +29

      DawnPraiser optimizing code doesn’t really help when it’s structure is god awful so awful no one can read it besides Yandere dev

  • @Wiizl
    @Wiizl 3 года назад +6775

    Finally a real analysis of the whole thing! Not just "IF-ELSE bad, SWITCH good!!!"

    • @nitesy381
      @nitesy381 3 года назад +287

      Yay someone mentions how compilers can fix everything

    • @Drizzle52693
      @Drizzle52693 3 года назад +118

      He’s wrong tho. The compiler can optimize if there’s less than 5 if else statements. If he did the experiment with 5+ If elses then the results would be much different

    • @neociber24
      @neociber24 3 года назад +405

      @@Drizzle52693 Sure, but that will save how much? 1ms?
      Most of the problems of fps are in the render updates not in a bunch of if statements and bad coding practices

    • @keiskay
      @keiskay 3 года назад +175

      @@neociber24 most of the fps drops come from his god awful ai pathing, if you disable the ai pathing your fps will jump up by a huge amount.

    • @RaskaTheFurry
      @RaskaTheFurry 3 года назад +88

      @@neociber24 even if it were 1 ms, 1 ms every frame is huge.

  • @esentries
    @esentries Год назад +375

    "The compiler is smarter than you."
    Completely valid statement.

  • @Thornskade
    @Thornskade 3 года назад +77

    51:20 "The ritual used to pull this standard out of some poor engineer's ass" - Engineer dies in background
    That must be the most obscure TF2 reference ever, even I barely noticed it and had to rewind.

  • @amenokagaseo
    @amenokagaseo 3 года назад +1283

    "a dark magic ritual known only to the compiler gods"
    so like building any cmake project

    • @maxinealexander9709
      @maxinealexander9709 3 года назад +8

      pfffff, yeahhhhh

    • @jacobbau8328
      @jacobbau8328 3 года назад +1

      Soo... like blast beating in drumming? Cause that’s essentially a ritual in itself.

    • @DFE-wu9lq
      @DFE-wu9lq 3 года назад +6

      Till this day. I am not sure how did I manage to build llvm from source.

    • @whiteclaws6882
      @whiteclaws6882 3 года назад +16

      nah bro, that's easy, you call 'cmake .' and cry if it fails before finishing.

    • @nagitokomaeda3237
      @nagitokomaeda3237 3 года назад

      this.

  • @RUdigitized
    @RUdigitized 3 года назад +2779

    This guy has professnals offering to work on his game for free and says no. No wonder he’s in the pickle he’s in

    • @WolfrostWasTaken
      @WolfrostWasTaken 3 года назад +149

      This ^^^^
      THIS ^^^^^^^^

    • @Pred.
      @Pred. 3 года назад +341

      Also the fact he's a massive pedophile and creep

    • @PebelWasTaken
      @PebelWasTaken 3 года назад +29

      @@Pred. he's a pedo?

    • @alf_url
      @alf_url 3 года назад +223

      His backstories for the characters are quite, let's say, disturbing.

    • @swindlesmccoop
      @swindlesmccoop 3 года назад +107

      Pred is that true? or is it just something you've heard with no evidence and you want to believe because you want to jump on the anti-yanderedev propaganda train full of lies and hate and like taking in all the drama, thinking youre actually contributing to something?

  • @PhoenixLive_YT
    @PhoenixLive_YT 2 года назад +501

    As someone holding a degree in coding i knew since the beginning that most people are just shitting on Yan dev for the sake of shitting on him without any understanding of code optimization and differences.
    IF statements are not the reason why his game is slow, but people doesn't care about fact checking when they want to cancel someone.
    ..
    NOTE:
    i still Think Yan dev deserves most of the hate due to how childish he handled the drama

    • @lartts7483
      @lartts7483 2 года назад +124

      Most people hate YandereDev because of his actions and toxic behaviour, not his coding. The "shitting on his code" part is usually to make fun of him, fyi I don't exaggeratedly shit on his code as other people do.

    • @imarchello
      @imarchello 2 года назад +5

      Imaging caring about someone you have never met and never will.

    • @ammyvl1
      @ammyvl1 2 года назад +9

      to be fair, they didn't really have access to the profiler

    • @strych9ines
      @strych9ines 2 года назад +1

      Yandere dev isn’t gonna fuck you dude

    • @demonking86420
      @demonking86420 2 года назад +15

      @@lartts7483 yeah the whole segment this dude did on the "elseif criticism" is cringe

  • @YTPrule
    @YTPrule 3 года назад +45

    As someone who codes, I always found the "If-Else" meme stupid for years. Replacing it with switch statements? The code he showed needed better code structure so he wouldn't need so many if statements in the first place. I told off people who suggested using cases rather than negating the need for so many in the first place. BlackWasp did a test where a billion iterations were done to test the speed difference between if-else and switch on C# and it amounted to about 5 seconds of difference. Thanks for concisely saying what I've been trying to tell people since that dumb meme was a thing. By the time changes like that need to be made, their code better be so beautiful that it ups the world's divorce rates. I better see people leaving their wives because of how beautiful the code is. And I've seen groups that believe if-else statements simply look better therefore keep them just for readability's sake.

  • @ethanyeung6216
    @ethanyeung6216 3 года назад +2145

    yo your music slaps, didn't realize you made all of it yourself

    • @aquarius5264
      @aquarius5264 3 года назад +40

      i've seen other creators use their own music because of demonetization

    • @mightypurplelicious3209
      @mightypurplelicious3209 3 года назад +4

      Oh dang

    • @HollowVize
      @HollowVize 3 года назад +61

      wait WHAT? He made all the music in the video himself? Wow...

  • @personettelabs
    @personettelabs 3 года назад +1796

    "Painstakingly converted every if statement I could to a switch statement". You absolute mad lad.

    • @thorham1346
      @thorham1346 3 года назад +19

      A total waste of time.

    • @prithyachan333
      @prithyachan333 3 года назад +1

      @@thorham1346 Why do you think so?

    • @thorham1346
      @thorham1346 3 года назад +115

      @@prithyachan333 Because you can save yourself a lot of time, effort, and headaches by just starting over from scratch completely and implementing everything properly.
      If you would actually clean up that source code entirely and properly there wouldn't be any of it left anyway.

    • @prithyachan333
      @prithyachan333 3 года назад +157

      @@thorham1346 I see. But they did that only to clear up some misconceptions. So I think they did a pretty good job.

    • @demonking86420
      @demonking86420 2 года назад +36

      @@prithyachan333 to be honest the whole "misconceptions about the code" bit seemed cringe, it seems like he was offended abut the elseif screeching when the vitriol against yanderedev primarily hinges on the abysmal development speed, his creepy behaviour, and his inability to take criticism
      The elseif screeching was nothing but decorative icing on the cake

  • @dmj271095
    @dmj271095 8 месяцев назад +55

    Are we allowed to bully now?

    • @holyboiamethin2790
      @holyboiamethin2790 7 месяцев назад +3

      That's what I wanted to comment 😂. Glad we have the same thoughts

    • @_WalterWhite
      @_WalterWhite 7 месяцев назад +8

      yes i give you permission 😄😄🙌🙌

    • @BarioIDL
      @BarioIDL 7 месяцев назад

      yes

    • @MYLAR.
      @MYLAR. 7 месяцев назад +10

      oh we’ve always been allowed to bully the Moment he put panty shot currency in the game

    • @Kreze202
      @Kreze202 4 месяца назад

      What happened? I'm not exactly up to date with YanDev lore

  • @thaumaticpig
    @thaumaticpig Год назад +165

    There's an interesting comparison to be had between Yandere Simulator and Wintergarten's Marble Machine X. Both projects have incurred massive amounts of Technical Debt over the years of their development, but while YandereDev holds onto his precious game code, Wintergarten (essentially) threw away the MMX that he spent years on so he can instead use the knowledge he gained from the first two machines to create a new, better one without the burden of his previous designs. Another interesting thing is that both creators are also the biggest critics of their own projects. YanDev could have done his fabled Kickstarter years ago (and it'd likely be wildly successful), but he doesn't feel like the game is close enough to his vision for that; and Wintergarten could've toured with the MMX and almost no-one would notice a few dropped marbles. Ultimately, I hope both projects come to fruition, but we'll have to wait at least a few more years for that.

  • @siangchengpang772
    @siangchengpang772 3 года назад +2141

    Just gonna say, as a coder myself this is probably one of the best video about programming I've seen on RUclips, it's mind bogging that you don't have more content

    • @ErrorNameNotFound123
      @ErrorNameNotFound123 3 года назад +5

      I feel the same dogsong

    • @firstname4337
      @firstname4337 3 года назад +2

      considering the way he looks I'm surprised he has any viewers at all

    • @SuperColdLemonade
      @SuperColdLemonade 3 года назад +57

      @@firstname4337 considering the way you write, it is hard to believe you can write at all. Is this even a comment ? nice nick btw.

    • @XGreySkyX
      @XGreySkyX 3 года назад +6

      I'd take quality over quantity everytime. 😊 Keep up the informative work!

    • @PorthoGamesBR
      @PorthoGamesBR 3 года назад +12

      It actually made me more confident about my own game. My code has lots of if else and switches and i was a litle bit scared of having bad performance. But now i undesrtand that this is something more of architechture than actually performance

  • @DartzSoryu
    @DartzSoryu 3 года назад +6454

    I'm learning to code specifically for video games, and this video, despite expecting to see a well detailed criticism to YandereSims code, it ended to have a very high educational value for me, it helped me to understand many concepts and "why's" of things that I have only seen in paper, your visual editing adds a lot to understand it better. Thank you so much for this.

    • @ljhoser5842
      @ljhoser5842 3 года назад +40

      same bro

    • @manuelsoares4343
      @manuelsoares4343 3 года назад +26

      @Olli Rolli other people made the mistake first so you don't have to do it too, you won't even get a prize for it just a headche

    • @yj9729
      @yj9729 3 года назад +21

      Same to me...I clicked this video for entertaining, but it ended up educating me. It taught me that why the things that I did not fully understand in sample codes are used.

    • @thesammurairat700
      @thesammurairat700 3 года назад

      Same, but it turns out dyc3 works for yandev so its ok

    • @deliciousnoodles5505
      @deliciousnoodles5505 3 года назад +6

      Yup, also don't listen to the other RUclipsrs who claimed framerates are affected by too many if else statements

  • @yusuf3728
    @yusuf3728 2 года назад +66

    I was waiting a 10 min critisism instead I found a highly educational 1 hour video. I learned A LOT. Thank you and do more of this thing

  • @Spellweaver5
    @Spellweaver5 2 года назад +19

    You know, I really appreciate you pointing out the real problems with the code.
    It bothered me to hear people saying nonsense like "the code runs poorly because of elseif statements".
    I actually wrote the comment before I saw you address this specific point, and I really want to thank you again. As someone who works with code, I hate blind micro-optimisations. It's not the milliseconds of performance that should be chased when refactoring, but hours of development time.

  • @LordBumwaggle
    @LordBumwaggle 3 года назад +1149

    I never knew that this was what I've been missing in my life. I went fullscreen on this badboy, lay back in my chair and watched this shit like a nature documentary.

    • @nonamezgamez4041
      @nonamezgamez4041 3 года назад +75

      Dude same. like, we finally get an UNBIASED look into whats really happening. Thank god i stumbled in this.

  • @kanamea5786
    @kanamea5786 3 года назад +1823

    THANK YOU!
    This is by far the most informed analysis for yandere simulator's code I've seen. I was getting tired of people barking at the wrong tree (like if-else vs switch) and ignoring the glaringly obvious architectural issues. I never looked at the full source code myself, but the snippets I've seen people criticized seemed like it's something that can just be written better elsewhere to make it more generalized/abstract because of constant reinvention of wheel and copy paste. You're the only person I've seen tackle this code from this perspective and it's really refreshing.
    I also appreciate the rundown on things like asset optimization because I'm not familiar with this department. It makes sense that the underlying performance issues lies heavily on those part rather than his badly written scripts. I've always felt like his scripts are more maintenance/development issue rather than performance issue, massively slowing down the development progress.

    • @ErgonomicChair
      @ErgonomicChair 3 года назад +10

      Well, he's not really correct, though. There are a lot of actual trash practices in his code that is slowing it down, and I am developing a game that has more content and more systems running at once than Yandere Simulator. Price for freedom Avarice. I know for a fact that his programming is shit, and the game chugs for a reason.
      Measuring via ReLive and Fraps, no, actually, the FPS does make dips
      down to 17 on my system despite having an RX 580 and Ryzen 2600x.
      Let's not ignore that within a month another project just popped up that
      runs better and smoother, and is more complex. WNM was also one of
      these, Lovesick, etc. Yandere Simulator chugs. It chugs. HARD.
      Constantly. Despite being so simple it is embarassing.
      It only
      simplifies if-else statements if it is SIMPLE by the way. I don't know
      how dyc3 got that his huge fucking complex if else chains will simplfiy
      in their current state. THey won't. It won't go into a switch if there
      is no switch in IL either.

    • @kanamea5786
      @kanamea5786 3 года назад +44

      @@ErgonomicChair I never said his coding isn't bad, I just don't believe that it's the bottleneck or the major cause for performance issue, more of a readability/maintainability issue.
      I never really looked at the full source code, can you give some examples of bad coding practices that impacts the performance in a meaningful way? I can see them do stuff like calling some drawing or state calculation logic more than necessary outside of scripts, but honestly I don't think this guy's 20 layers of if statement really impact the performance all that much despite being a terrible code.

    • @scottmichaud
      @scottmichaud 3 года назад +15

      @@ErgonomicChair An RX 580 with a Ryzen 2600x should get ~80-120 FPS with shadows disabled (we know about the issue with shadows) and when the students aren't all in the camera's view frustum (because the game uses the single-threaded Legacy Animation System instead of the multi-threaded Mecanim). We know about a few bottlenecks, but, apart from shadows and lower detail 3D for integrated GPUs, it's in the realm of okay... and the bottlenecks that do exist *are not the code*. There are now two people who have profiled it, dyce and myself, who says it's not the code. Listen to us.
      And I mean it should make sense. If you see a massive performance increase by going to Unity 2019.3, which did not change the scripts, then it should tell you that the code was not the bottleneck. In fact, the game got way over a 2x speed-up between January 2019 and July 2020 for gaming machines without the code changing. Over half of all computation time disappeared, but YandereDev's code didn't change. That's definitive proof that people who blamed the code back in January 2019 were completely wrong.

    • @MattRogan28
      @MattRogan28 3 года назад +2

      My PC ran Yandere simulator with max setting with shadows on and get 55-64 FPS and ever beyond that
      The only issue I have is that has long load time but beside my PC ran the game fine
      Edit:correction when I have shadows on is drop A bit but stay over 30 FPS

    • @maddie-xk2uv
      @maddie-xk2uv 3 года назад +4

      P-peko?!

  • @laurencisewski7859
    @laurencisewski7859 3 года назад +78

    hey! just wanted to return to this old video to say it’s truly amazing. i can tell you really know what you’re talking about and also really have a passion for it. your humor is totally great but still doesn’t impede on the technicality, which is really commendable. keep it up, man :-)

  • @Jaminux
    @Jaminux 3 года назад +203

    i honestly adore when youtubers have nice, calming videos like these, but then they slip in subtle things like 38:38. has a nice flavor to it

  • @snicklefritzal
    @snicklefritzal 3 года назад +377

    Every programmer should have "the compiler is smarter than you" as their desktop background :p

    • @gileee
      @gileee 3 года назад +34

      Exactly. The only thing we understand that the compiler doesn't is the underlying logic of the algorithm itself and that is what we're supposed to optimize.

    • @0x00Fyou
      @0x00Fyou 3 года назад +9

      Fuck it. Ryzen 4K logo to remind Intel fanboys that i spend less money for equal, sometimes more performance
      lol

    • @PeterG00000
      @PeterG00000 3 года назад +3

      It seems as though this game creator is just dragging ass until his devoted fans crowdsource the game into completion for him. Maybe the guy knows more now, but he doesn't seem to have known enough at the game's inception.
      However, the controversy is more interesting than the game itself, so maybe I shouldn't complain.

    • @JosephAgrane
      @JosephAgrane 3 года назад +4

      The compiler can actually be a pain in the ass leading to incorrect optimisation that breaks code. You then have to dig through the code and tell the compiler not to optimise certain things and stop breaking your code.

    • @0x00Fyou
      @0x00Fyou 3 года назад +1

      @@PeterG00000 1,2 million dollars in crowdfunding, 400 dollars spent on a sex doll and dressed it as a student in the game , a generous 3,5K monthly as his salary. Shit coding

  • @Tacticalgamer2011
    @Tacticalgamer2011 3 года назад +399

    As a Unity noob, this was more helpful as a tutorial than many actual tutorials out there

    • @saulgoodman5662
      @saulgoodman5662 3 года назад +2

      lol

    • @tinhead_junk
      @tinhead_junk 3 года назад +26

      As a Unity noob, I have no clue what is even happening.

    • @doopy
      @doopy 3 года назад +10

      @SpyInTheBasement as a unity noob, what's unity?

    • @manman-fq4zw
      @manman-fq4zw 3 года назад +2

      as a Unity noob, I killed my entire family and am on the run

    • @AstralSpectre
      @AstralSpectre 3 года назад +6

      As a unity Noob, I have commited arson

  • @TheBoxyBear
    @TheBoxyBear 3 года назад +44

    Instead of having complex inheritance and a class for each student, you could also have a single Student class that stors its personality as fields. Then have its functions like "ReactToMurder" call an instance delegate whose value is assigned in the constructor depending on the personality. The two main benefits are
    1: You only have one class to maintain and using delegates removes the need to read the personality every time the student has to do something.
    2: You can modify the personality of student at runtime by turning the fields into properties with a setter that also reassigns the delegates.
    To avoid having every student keeping a seperate copy of its code, you could also define static delegates that act as defaults then assign the instance ones to the static ones.

    • @ahall9839
      @ahall9839 11 месяцев назад +1

      So inheritance, but with extra steps to make it technically not inheritance. And I have no idea what you think "complex inheritance" is or how any of this qualifies as "complex inheritance". Unless you think "any inheritance whatsoever" is "complex inheritance".
      "1: You only have one class to maintain..."
      Okay, so you just don't know what inheritance is. One of the main points is to reduce maintenance of exactly this type of thing. And I feel like you have not only never coded anything in your life, but possibly have never opened Notepad before.

    • @2minuss
      @2minuss 8 месяцев назад +18

      ​@@ahall9839Ahh, good old "condescending RUclips commenter making baseless assumptions for no reason".

  • @loop_zoop
    @loop_zoop 3 года назад +51

    This is one of the most quality code analysis videos I've ever seen. Really hoping you do more of these type of videos.
    Also a suggestion that would be interesting is Celeste's movement code where there are 5400 lines of code in one file.

  • @roserocksrapidly
    @roserocksrapidly 3 года назад +421

    95% of this went directly over my head, but I was still strangely entertained for an hour lol

    • @Crazylom
      @Crazylom 3 года назад +4

      That is what i call true intertainment

    • @jayive34
      @jayive34 3 года назад +5

      Same. If I understood that shit. I wouldn't be a mall cop.

    • @8015908
      @8015908 3 года назад +1

      I'm a programmer, and am still entertained. This guy has a good presentation.

    • @monicaraybrandt
      @monicaraybrandt 3 года назад

      i'm just here like "i made a website in notepad once"

  • @cryptidcoven7143
    @cryptidcoven7143 3 года назад +625

    Trained game artist here, retopping the entire game, although a big job, wouldn't take as long as you might think. With a game that's not that detailed, this job wouldn't make a display difference really. I must admit, when you showed the polys on the models walking i just about had a fit. Unfortunately, Yanderedev doesn't pay and gives no credit so i doubt he'll get hold of someone able to retop these models to a decent degree.

    • @harrylane4
      @harrylane4 3 года назад +46

      It's not just retopping these models. Iirc, entirely new ones need to be made, because these ones are from the unity store.

    • @bonelesscommunism4031
      @bonelesscommunism4031 3 года назад +16

      Harrison Lane not really?? Most of them are made by some high school/college kid doing the models not knowing what in the candy fuck they’re doing and they optimize them super poorly like someone got ahold of some of the models and they had some baffling design decisions made

    • @cnof00
      @cnof00 3 года назад +24

      @@bonelesscommunism4031 The majority of the models still are from the unity store.

    • @solidshark91493
      @solidshark91493 3 года назад +2

      @Yeah Itsme There are hundreds on the subject. Just search Model retopology.

    • @trashdoge1217
      @trashdoge1217 3 года назад +9

      @@bonelesscommunism4031 No most of them especially surroundings are just unity store bought assets.

  • @jupiterjaeden9163
    @jupiterjaeden9163 3 года назад +67

    The production value on this video for such a small and new channel is insanely high. I expected to scroll down and see a channel with hundreds of thousands of subscribers (at least!). Great video, you definitely deserve more recognition.

  • @GoldphishAnimation
    @GoldphishAnimation Год назад +48

    Went into this with the common "if switch" belief, but showing the tests you did very clearly and speaking unbiasedly, you really have changed my mind. Well done, love the teardown and honest discussion. 10\10

  • @GibusWearingMann
    @GibusWearingMann 3 года назад +165

    the autocaptions don't know what a "yandere" is and it's very funny to watch them struggle with this word

    • @anon-jp6kx
      @anon-jp6kx 3 года назад +9

      40:38 when the automation gets it right

  • @ButtslammerBob
    @ButtslammerBob 3 года назад +366

    "these save files are super big"
    *cries in modded skyrim save files that always inevitably break*

    • @MelonDev04
      @MelonDev04 3 года назад +3

      The Save file is bigger than the Maus

    • @InterestEPC
      @InterestEPC 3 года назад

      Rimworld save file sizes would like a word too.

    • @happydemon3038
      @happydemon3038 3 года назад

      I dunno, that save file size seems rather small for modern systems.
      Even if the game only took 1 GB of space, to double it's space with save files, you'd have to make at least 1 024 saves.
      Compare that to world files in Minecraft, which can become truly massive.

    • @ButtslammerBob
      @ButtslammerBob 3 года назад

      @@InterestEPC And CK2, and some Total War, and Warband, but these don't habitually break because they've gotten too big

    • @thesammurairat700
      @thesammurairat700 3 года назад

      Why tf would yu b using mods if the save breaks with them

  • @BunnLilah
    @BunnLilah 3 года назад +31

    I'm really new to programming so I didn't understand a lot of the stuff in this video but it's really great to see someone knowledgeable explain it and tell people who don't code why it isn't as easy as what a lot of these people suggest all the time. I imagine if these people got to see the source code of some of the biggest games in recent years, they'd be surprised by how "sloppy" it is. It's probably structured better but I guarantee there's some really embarrassing code in many of the games we all play.

  • @Gr13fM4ch1n3
    @Gr13fM4ch1n3 10 месяцев назад +9

    I have no clue what you said, but I listened to every second of it.

  • @Lilacuity
    @Lilacuity 3 года назад +209

    Pointing out flaws in his game rendering times and then helping him opitimize them?? You're a true hero

  • @mrldbsz
    @mrldbsz 3 года назад +356

    As a software engineer, I must congratulate you on your amazing work on this video, I stumbled across it by accident and it just felt extremely good to see someone, who actually understands how coding works, talk about all the yandere dev bad code drama. Oh and I loved when you said: "The compiler is smarter than you", that is not only true but it is something more people should now about, as it appears that a lot of people forget that to run modern programming languages there are extremely robust compilers, with years of development behind them and that these compilers are engineered and designed not only to be smarter than average level programmers but to also be fool proof(well we know nothing can be 100% fool proof)

    • @superscatboy
      @superscatboy 3 года назад +6

      Yeah, it can't be overstated how smart compilers these days really are. To a certain extent they even have literal theorem provers in them. The best advice these days is to write your code in a way that's easy to understand and easy to modify, and let the compiler worry about the rest.

    • @doliague2590
      @doliague2590 3 года назад

      Karen Pfp uwu

    • @frank-michaeljaeschke4798
      @frank-michaeljaeschke4798 3 года назад +2

      Citing Martin Fowler: Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

    • @47Mortuus
      @47Mortuus 3 года назад

      Decades* of development
      And additionally, the actual development that's being done on them is work being done by mathematicians AND computer scientists (being a mathematician does not necessarily help you understand computer performance)
      I attempted to write "clever" SIMD code for some commonly used (by me) but unusual/arbitrary modulo operations. None of them were even 75% as fast as simply typing "x % y" and letting the compiler do all the work for me...
      The compiler is actually, IMO, the real reason behind so many experienced programmers feeling like impostors:D

    • @DFPercush
      @DFPercush 3 года назад

      @47Mortus the channel javidx9 recently did a video about simd code and crunching the mandelbrot set, he looks through a few examples of where the compiler can optimize it for you and where it can't. Pretty enlightening. It basically comes down to whether there are any conditions inside your loop.

  • @SmileytheSmile
    @SmileytheSmile Год назад +9

    For some reason I keep coming back to this video once in a while. Wish you did more code reviews like this one, dude.

  • @TheAnonLee
    @TheAnonLee 3 года назад +42

    As someone learning to code this was a great resource to me. Glad to see someone actually probably taking it all apart and seeing what’s wrong rather than just pointing out if else statements.

  • @axcel8896
    @axcel8896 3 года назад +809

    Me as a non coder: Haha lines go 🅱︎🆁︎🆁︎🆁︎🆁︎🆁︎🆁︎

    • @Cc99XYT
      @Cc99XYT 3 года назад +23

      Me, a normie: Haha FBI go 🅱︎🆁︎🆁︎🆁︎🆁︎🆁︎🆁︎

    • @axcel8896
      @axcel8896 3 года назад +21

      @@Cc99XYT My man you gotta unsub to yandev bro it's not worth it to follow him anymore

    • @okie9025
      @okie9025 3 года назад +9

      Me, a coder: Oh, that's strange! What you'll find here is££&(-) -) /'/%%%%%@%@%###]]©¥

    • @Epsellis
      @Epsellis 3 года назад +9

      Me as a game artist trying to understand this smart people wizardry
      "Oh yeah polygons i get polygons, haha funny fence amirite? haha, yeah, wait... floating poi- what? nopenopenopenope"
      I'M NOT STUPID! I CAN COLOR INSIDE THE CIRCLES OKAY?!?

    • @Cc99XYT
      @Cc99XYT 3 года назад

      @@axcel8896 I sub, only to watch him fall.

  • @abbeycase143
    @abbeycase143 3 года назад +278

    His voice is a mix of ASMR and the nerd in class who only speaks when he's spitting facts

    • @amandaschmitt5019
      @amandaschmitt5019 3 года назад +14

      As someone who takes classes with him, you're entirely correct

    • @Intikus
      @Intikus 3 года назад +3

      @@amandaschmitt5019 Prove it

  • @justinlua4848
    @justinlua4848 3 года назад +19

    Thank you for the else if vs case presentation. People (including myself when I was younger) get waaaaay too wrapped up in micro-optimizing things to save microseconds.
    There's nothing wrong with using the massive computing power we have to run high level "unoptimized" code if your program works well for what you're trying to do.

  • @viktortarko9344
    @viktortarko9344 3 года назад +35

    Me, who never even attempted to make a 3d game: "hmm, yes"

  • @wisemage0
    @wisemage0 3 года назад +761

    Someone actually reverse-engineered the game to retrieve this man's Unity project. How suave.
    This video is better than the drama, and that is saying something!

    • @BreakTheBeat852
      @BreakTheBeat852 3 года назад +28

      It's not really reverse engineering, it's just decompiled code

    • @wisemage0
      @wisemage0 3 года назад +12

      @@BreakTheBeat852 Close enough. 😎

    • @thesammurairat700
      @thesammurairat700 3 года назад +1

      Doesn’t really say something because the drama far from that

    • @fungo6631
      @fungo6631 3 года назад +1

      Wasn't the source code leaked?

    • @thesammurairat700
      @thesammurairat700 3 года назад +6

      @@fungo6631 Not really, its misinformed... The leaked code that is

  • @aj7842
    @aj7842 3 года назад +1417

    me watching as if i know about anything he’s talking about: 👁👄👁

  • @JourneysADRIFT
    @JourneysADRIFT 3 года назад +9

    Been working with unity for a few years now on content experienced by tens of thousands of people and this one video is by far the most information packed single video regarding Unity optimization I've ever seen over the years. I wish I had this video when I started my Unity journey. A+ man.

  • @manthrax69
    @manthrax69 3 года назад +11

    This is a great investigation/roundup. Im not a "yandere" player, but I'm an old game dev (30 yrs) , and the information you're throwing out here is a great roadmap for avoiding some performance pitfalls in Unity.

  • @KnucklesNCS
    @KnucklesNCS 3 года назад +547

    In regards to the IF vs SWITCH argument, this argument was the wrong thing to look at to begin with.
    It should never have been IF vs SWITCH, but why do you need so many IFs to begin with.
    Most of the time, you can completely remove long IF ELSE scenarios by using inheritance or programming patterns (like the component pattern).
    But that would require YanDev to know what classes are, and from looking at his students script, he does not.
    Thus, an architectural problem does become a performance problem, as "perform a check" is always more costly than if you need to do nothing at all. (That said, I'm not sure how much it would affect the actual performance if most of the long IF ELSE blocks were gone, but it would still speed up the game, even if only marginally.)
    Great video all around! It was fun and interesting listening to everything you highlighted.

    • @TheEpicnesscontained
      @TheEpicnesscontained 3 года назад +89

      This! A large reason why people always bash on elseif is to not tell yandev to use switch but to use other patterns and code that negates the need to have 50 elseif statements per student at all.
      You can SEE that the script for this game is taking up alot of the processing time if you go onto the game itself and turn on debug mode actively killing all of the background students besides the main character. The frame rate jumps up to 60fps and higher consistently. This is because the program doesn't have to constantly be doing those else if checks for each of the 100s of student per frame.

    • @pranavkarmarkar
      @pranavkarmarkar 3 года назад +28

      Agreed! Multiple nested if-else statements also lead to some DEEP indentations which also messes up code readability that much.

    • @pacman_pol_pl_polska
      @pacman_pol_pl_polska 3 года назад +1

      Is there any video/tutorial/infographic that would explain how to escape the IF ELSE IF IF IF IF ELSE IF IF ELSE hell?

    • @TheDXPower
      @TheDXPower 3 года назад +19

      Using inheritance just moves the if-else somewhere else. It moves it to the vtable lookup, which *cannot* be optimized or predicted like an if statement can.
      A switch to inheritance can have benefits if and only if you are comparing the same state variables way more than necessary. If you use inheritance, the code will already "know" its intended behavior and thus won't have to check for what to do.
      Now for something like YandereSim, I think that yeah, inheritance would probably be the right option. But not necessarily for performance reasons. Architecturally, having a lot of different behaviors represented by just a few base functions is the perfect fit for inheritance. I don't think Components are a good choice here, because I don't see the possibility of modelling students' behavior using a component model. You would have to constantly check what components you have, which would create the convoluted if statements you were trying to avoid to begin with. Component models work best when you have lots of completely unrelated behaviors and data you want to join together.

    • @WolfrostWasTaken
      @WolfrostWasTaken 3 года назад +45

      The problem here (and it's a very huge problem) is purely ARCHITECTURAL. If you write code like that, implementing new features and fixing bugs is going to become a NIGHTMARE, and a really time consuming one at that. YandereDev clearly doesn't know design patterns, he just writes code because "lul I want to see this work!!!!". That's his mentality since he was fucking 15, and he never grew up. Seriously. This is a problem in a game of this scale. This is a problem.

  • @invix3447
    @invix3447 3 года назад +197

    You got me hooked in the first minute lol.
    “But before we begin, I want to make it clear - because the last time _it didn't get through your fucking skulls_ - NO BULLYING.”

  • @ArcRayven
    @ArcRayven 2 года назад +1

    Great job going over this. It was nice to hear your thought on the problems, identify what they had, why they might have done it that way and review potential solutions or theoretical ways. I had fun listening to this

  • @emilie5501
    @emilie5501 3 года назад +9

    thank you for like... ACTUALLY explaining everything in a very coherent way? i came into this video knowing NOTHING about game coding/coding in general, and came out of it with a better grasp on what gaming coding/coding actually is (and helped me understand what was ACTUALLY going on w yandere simulator) , thank u!

  • @tistitistiyeaya199
    @tistitistiyeaya199 3 года назад +616

    Coding level at the start of the video: 0
    Coding level at the end of the video: 0

    • @caidenbond1988
      @caidenbond1988 3 года назад +49

      Coding level forever: 0

    • @jmanpolo5611
      @jmanpolo5611 3 года назад +101

      @@caidenbond1988 Congrats you guys set variables! CodingLevelAtStart = 0 , CodingLevelForever = 0, CodingLevelAtEnd = 0 !!! Budding programmers already! You should now be at CodingLevel = 1!

    • @pitiponk1
      @pitiponk1 3 года назад +48

      @@jmanpolo5611 it's not the god of code status that's important, it's the semicolons we forgot to write along the way.

    • @TheDwarvenDefender
      @TheDwarvenDefender 3 года назад +31

      if (codingLevel == 1) {
      console.log("Looks like you've still got a ways to go.");
      }

    • @user-sb8cs3le2j
      @user-sb8cs3le2j 3 года назад +22

      @@TheDwarvenDefender nah do it in python
      codingLevel = 1
      if codingLevel == 1:
      print("ya did it!")

  • @secretcactus4717
    @secretcactus4717 3 года назад +1681

    Excellent video. A solid in-depth look to this game.

    • @rollthedyc3
      @rollthedyc3  3 года назад +130

      Much appreciated!

    • @G_Ryuji
      @G_Ryuji 3 года назад +35

      You mean, mess. It's not even a game, it's just a walk and kill sim with a ton of messy assets everywhere.

    • @marrowyoutube
      @marrowyoutube 3 года назад +9

      @@G_Ryuji true

    • @firstname4337
      @firstname4337 3 года назад

      a shit video

    • @ryzhik9608
      @ryzhik9608 3 года назад +6

      @@G_Ryuji No you are talking about Lovesick now. We are talking about yansim, kiddo

  • @pablorepetto2759
    @pablorepetto2759 3 года назад +13

    After 2 months of working with a terribly mismanaged codebase, I have to say: you sir, are an absolute legend, and I thank you for your service to coders everywhere.

  • @alzanari1274
    @alzanari1274 3 года назад +1

    one hell of a video to watch !! great work and please make more, i don't mind a long wait for videos of this quality!!

  • @Smugg
    @Smugg 3 года назад +879

    Thanks for making this, dyc3. I’m a Sr. Software Engineer and all these people pointing at various small refactorings that wouldn’t even be mentioned in a rejected code review was making me frustrated. Sometimes in a production system you need to find the perfect performance to make your code fast enough, but over 90% of code most people write just doesn’t need all of the performance optimizations people were talking about. It’s almost as if they had never written a line of code for a real world software project with specs and deadlines. Sometimes these things just aren’t perfect but are still perfectly acceptable since they work well enough to get the code shipped. Given the amount of time he had, I’d expect things to be a bit better, though... but perhaps YandereDev either was an immature programmer or didn’t actually put a full 6 years worth of full time work into it (I suspect the latter but I don’t want to assume anything.)
    Anyway. Thanks again for making this. It was really interesting learning more about video game code optimizations in unity.

    • @Benjy52
      @Benjy52 3 года назад +35

      He spends most of his time streaming video games on Twitch.

    • @ryzhik9608
      @ryzhik9608 3 года назад +4

      @@Benjy52 wrong.

    • @Smugg
      @Smugg 3 года назад +32

      @Paul Kerrigan Yes, 100%. They do have a point that nested ifs and a ton of ifs everywhere is harder to read, but that's not really the point they make in the various videos. They act like it impacts performance when in the real world nobody cares that much unless it an idealistic thing where they're trying to save every cpu cycle for some strange reason. Like, I wouldn't tell someone it's best practice to not care about how you use your ifs vs switches, but it doesn't affect performance the way they're making it seem like it does.

    • @yourbiggestfan395
      @yourbiggestfan395 11 месяцев назад

      It's a useful tool, but when used entirely by itself it's fucking nonsensical

    • @elobiretv
      @elobiretv 6 месяцев назад +1

      Yeah it's easy for bedroom programmers to sit there and criticise code not being written perfectly for performance meanwhile in the real world it rarely matters and moving on to implement the next feature is more important.

  • @UngodlyDev
    @UngodlyDev 3 года назад +659

    Sorry i didnt see this video sooner. I hope you see this comment dyc3; Im a professionally trained 3D artist and i fux wit da unity.
    You missed some optimization techniques that i think are super important:
    Unity only culls occlusion outside of the cameras view. So behind the camera. If theres objects behind some objects within the camera cone of view those are not automatically culled out by unity. For that you need a plugin.
    Some optimizations you didnt mention, and please research:
    Sectors and portals: effectively unload all assets that are not in your current room or in any of the hallways connected to your room. Thats better than just occlusion culling because occlusion culling checks for mesh object visibility every frame. Sectors and portals disable those objects and their components so they dont have to report every frame. Also disabling colliders, physics objects, skinned meshes, animation controllers and audio sources, which otherwise wouldnt have been culled unless theyre attached to a mesh renderer component, which can make them stutter and create unpredictable bugs.
    Gpu instancing: unity has a default setting for this but i use a plugin, anyways you can render identical mesh objects with less draw calls using the gpu. It can allow you use just absurd numbers of similar objects on screen without hitting the frames per second.
    Theres also gpu instancing for skinned meshes (animated characters) which you need a plugin for.
    Imposters: replace a very far away object like an LOD would, but with a normal mapped super low poly plane which is still light interactive and you can strife the camera in circles around the object and it will still report accurately, updating the billboard as you move, at the full resolution of the mesh with it's shaders no less.
    Lightmap baking: you only need a few runtime lights at any given time and you can switch off the far away ones. That saves an assload of light calculations, static lights on static objects can be baked which looks just like a real time light except WAY WAY BETTER. and way more preformant. You can still have runtime lights and they'll be even more beautiful also.
    FixedUpdate(): is better if something can be called from a fixed update rather than an update, youll save a lot of performance because its running each physics frame which called much less frequently than render frames.
    I've been following all these yandere sim youtube critiques (but not the pedo fuel game itself) and ive been consistently impressed with the content I've seen from the game and its critiques.
    Unfortunately right now i have to work a real job so i can afford upgrades to my life, but when i get back to making games, i wanna hire you to review my code before release pwease and tank u.

    • @rollthedyc3
      @rollthedyc3  3 года назад +174

      Wow! Thanks for writing this big long comment. I made it a point to *only* talk about optimizations that would help *this game in particular*. The only thing I didn't talk about in the video was draw calls, because the frame debugger doesn't work on the linux editor.
      I thought Unity did frustum culling before occlusion culling. Is this not the case? It doesn't make sense to do occlusion culling for anything outside of the frustum.
      Occlusion portals are pretty heavily used already so I didn't mention it in the video.
      Gpu Instancing: Very cool, would probably be extremely helpful. I found out yesterday that the students are being drawn twice, and there's a seperate draw call for every modular part of the student (hair, iris, hair pins, etc.).
      Imposters: Also sounds useful, but I'm not exactly sure how practical it is to implement now. This also sounds like it would interfere with mesh combining.
      Lightmap baking: As far as I can tell, lighting is baked, and while there are 14 instances of UnityEngine.Light, I don't think most of them are enabled, because I can't find them in game.
      FixedUpdate(): You have to be *really* careful about using fixedupdate because if the framerate is low enough, the frequency of fixedupdate is actually *higher* than update. Not good for fps. According to the Unity documentation, Fixedupdate is made for adding forces to rigidbodies and such, which is not really how Yandere sim's code works.
      Feel free to DM me on twitter: twitter.com/rollthedyc3

    • @scottmichaud
      @scottmichaud 3 года назад +59

      @@rollthedyc3 Btw: I help YandereDev with optimizing the game. The game already does GPU Instancing and Static Batching. It used to do Dynamic Batching but I disabled it when switching from DX9 to DX11 because it was measurably slower. (I didn't try turning it back on after we jumped to Unity 2019.3, though. Maybe it's faster now. Testing that was one of my small items on the backlog.)
      There are some times when GPU Instancing breaks, though.
      Sometimes YandereDev adds a new material and forgets to check the GPU Instancing flag. Sometimes the object has a negative scaling, which forced Unity to disable batching and instancing (which I'm assuming is due to the winding order but Unity doesn't say)... but sometimes is big things like per-tree wind. I can fix that by writing a vertex shader instead of using the built-in wind system, but it's one of those "I need to stop YandereDev to implement it, and it needs to be at a time when I'm not helping other projects".
      But yeah... every dozen trees is 12 trees x 2 materials x 4 shadow cascades (basically cameras for shadow casters) = 96 draw calls... which should be 8 (or 4 if your toon leaves are opaque and just clipped with Alpha To Coverage or something). Lots of room to play in this space... including a low-quality shadow setting that sets shadows down from 4 to 1 cascade. There's a bunch of things that can be tried but it's a time thing... especially things that take a lot of time... especially things that take a lot of time and touch data files that YandereDev will also touch (like SchoolScene and StudentChan)... which means that he'd need to stop working on anything I'd change.
      Also, most of my tests with standalone builds shows rendering is not dominant (except if shadows are enabled of course). Not really sure why it's hitting you so hard.
      Also, lighting *is not* baked. That said, it's one directional light and an ambient fill, so it's not any slower than baked lighting. Toon is all about flat lighting because it's emulating an animator filling in a color, so flat, ambient fill makes sense. The extra lights are in the bathrooms, and they have a small range. They're there because Unity doesn't allow you to subtract lighting below the ambient (and you still can't, even in URP and HDRP)... so YandereDev drops the exposure and pushes the point light to compensate... which is why the bathrooms look weird.

    • @scottmichaud
      @scottmichaud 3 года назад +32

      @Robin Hoole -- dyc3 is correct. Unity does frustum culling, and then does occlusion culling after that (if you set it up by setting objects to static occluder/static ocludee and then bake the occlusion voxels). Unity licensed it from a company called Umbra back in the Unity 3 days. Unfortunately, it's also kind-of slow and awkward, so there are some assets to replace it.

    • @cursling
      @cursling 3 года назад +1

      Is your native language English because the grammar is not the best (just asking)

    • @kloa4219
      @kloa4219 3 года назад +3

      @@cursling I'm impressed

  • @edvardpotapenko
    @edvardpotapenko 3 года назад +2

    Great video. It's really cool that you've invested so much time not to only explain all of this, but help to fix it.

  • @ShreddedNerd
    @ShreddedNerd Год назад +5

    Enjoyed this video. It was better than most I've seen on this subject. Your knowledge was really apparent.

  • @PASTRAMIKick
    @PASTRAMIKick 3 года назад +397

    Finally, someone that does know what he's talking about, I've been coding embedded C and assembly for some time now and people didn't seem to understand that some "best practices" things are for code readability not much for performance, since in the end it all gets converted to assembly (in C), and a similar thing happens in programming languages like C# and Java it gets turned into bytecode and something that can be executed by the JVM or C# equivalent.

    • @Yotanido
      @Yotanido 3 года назад +51

      @Jonathan Gomez Why do people keep saying that Java is slow?
      Yes, it is far slower than C, C++, and Rust. Sure.
      But in the grand scheme of things, it's pretty fast. Much much faster than languages like Python, Ruby, PHP, etc. Which are all used professionally.
      -
      Java is not a slow language by any means, it's just not a super fast one, either.
      (Oh, and also, Java can be compiled ahead of time, which would put it on par with C++. Nobody does that, though)

    • @theshermantanker7043
      @theshermantanker7043 3 года назад +6

      @@Yotanido I would even go so far as to say Java is the fastest non AOT language to exist in fact

    • @freelanceart1019
      @freelanceart1019 3 года назад +2

      @@Yotanido JavaScript is Amazing its a highly versatile language used in Buildbox 3 and Construct 3.

    • @DP-jt6xx
      @DP-jt6xx 3 года назад +26

      @@freelanceart1019 java and JavaScript are 2 different things

    • @MadsterV
      @MadsterV 3 года назад +1

      Sure, Java is not slow if you compare it to other slow languages... and systems being in use "professionaly" says little about their performance. The things you see in the field....
      Compiling Java does not put it on par with C++ though. The runtime does a lot of runtime checking, and this goes into the build, while C++ does none of that nonsense and just slaps you with an exception when you do something you shouldn't. Java (the JVM actually) also has some greedy resource usage patterns, so it can hide it's low performance, while C++ can be very lean if you don't do anything silly, while still performing properly.
      On another topic, js is only verbose if you're doing it wrong. It's problem (or what most people starting in it struggle with) is not verbosity, it's the unusual object model (and shooting your own foot with all that type freedom).

  • @barmetler
    @barmetler 3 года назад +253

    The reason people cling onto that if/else stuff is, in my opinion, because it's the easiest to understand for a layman. The broad audience of criticism channels don't know much of anything about coding, but like to have an opinion and feel like they know something.

    • @nates9778
      @nates9778 3 года назад +22

      "BUT THE IF AND THE ELSE ISNT CLEAN LIKE THE BIG PRO CODERS DO IT. LIKE, I KNOW THERES CLEANER CODE THAN THIS, I DONT EVER SAW IT, BUT IT THERE AND THIS NOT CLEAN CODE!!!"

    • @PyroFTB
      @PyroFTB 3 года назад +54

      @@nates9778 it is a valid reason tho, it's important to keep your code clean if you want to update/modify it.

    • @Obyvvatel
      @Obyvvatel 3 года назад +12

      I mean, it just looks plain nightmarish to read. It's hard to fuck up performance with compilers that are smart, unless it's some sort of ground level thing, like loops within loops within loops doing something.

    • @barmetler
      @barmetler 3 года назад +25

      @@Obyvvatel Yeah, It is really important to keep things readable. I personally am kind of a perfectionist when it comes to this, and love making things more efficient even if the compiler already does it. I basically treat programming like an art form, even if that might sound kind of pretentious, but I find it a lot of fun.
      However, in this situation, the bad code wasn't the problem when it comes to why the game runs like shit...

    • @glens2019
      @glens2019 3 года назад +5

      It's a tip of the iceberg type thing. If you make an elementary level mistake like this, who knows what you've done with more advanced functions.

  • @AlejandroCab98
    @AlejandroCab98 3 года назад +2

    Good shit brother, I used to study computer science in college and switched to law when I realized that I was unhappy staying up till 4am in the library every time I had to submit a project but I massively respect the craft and those willing to grind it out. I watched the entire video thinking you were some big time youtuber and after finding out the amount of attention you get I think you deserve more! Beautiful editing and concise explanations of a complex topic like this is rare in small channels, guess I found a gem lol

  • @ShadeStarMC
    @ShadeStarMC 3 года назад +345

    Finally a review that isn't just "he's allergic to arrays" and "too many if statements" nice and in depth, sexy video

    • @jammiejammed
      @jammiejammed 3 года назад +25

      i agree with all, but i agree with the sexy part the most

    • @ShadeStarMC
      @ShadeStarMC 3 года назад +2

      @@jammiejammed ayyy you get it :)

    • @wisemage0
      @wisemage0 3 года назад +8

      Funny thing is, the game is crammed full of automatically generated arrays because of all the Drag'n'Drop.

  • @Xhez2slash
    @Xhez2slash 3 года назад +1

    This is a very informative video! Even though I didn't really understand most of the technical details, it was pretty dope to see everything at a high level. Thanks for the time you put into this video!!!

  • @RyanCGames
    @RyanCGames 3 года назад +11

    For a small channel, this was a great, well put together video! I enjoyed it even though I never really got deep into programming (just basic Java and some MATLAB).

  • @Alesan99
    @Alesan99 3 года назад +778

    Finally a video that doesn't blame the performance issues on if-else statements.

    • @einarengvoll
      @einarengvoll 3 года назад +3

      Are those bad?

    • @LowestofheDead
      @LowestofheDead 3 года назад +50

      @@einarengvoll Compilers usually optimize them, so the supposed 'disadvantages' aren't a big deal anyway

    • @Alesan99
      @Alesan99 3 года назад +117

      @@einarengvoll using a lot of if-else statements makes the code look long and ugly (which is why people made fun of it) but it doesn't really make the game slower.

    • @gentaisurge8133
      @gentaisurge8133 3 года назад +13

      What I got from it is that yan dev doesnt know how to work with phiscal game asets and bones thus making the game slower, and the disorganisation making him take long on simpler tasks

    • @gayusschwulius8490
      @gayusschwulius8490 3 года назад +28

      @@Alesan99 this, so much this! It annoys the hell out of me that people who aren't even programmers keep beating that dead horse.

  • @Hot18Shot
    @Hot18Shot 3 года назад +244

    As someone who has never coded in his whole life, this whole video sounded alien to me but was quite interesting. I think I might have learned at least one small thing.

    • @DFPercush
      @DFPercush 3 года назад +1

      I don't know how many times I've found it useful to write a little 10 line program to do some stupid little thing I needed. It's a nice skill to have, even at a very basic level. Think about it. Python is a good starting language these days.

    • @halinaqi2194
      @halinaqi2194 3 года назад

      Yikes, just start with c ++. I am going to game Development and I hate python, so glad I never went back to it.

    • @DFPercush
      @DFPercush 3 года назад +1

      @@halinaqi2194 well, yes, python is not for games, but if you're a lay person who wants to dabble for simple scripting purposes, the learning curve is not as steep as C++. If you want to learn serious programming C++ is probably the best language because you can basically go from it to anything.

    • @jodazague8333
      @jodazague8333 3 года назад

      @@halinaqi2194 I wouldn't recommend c++ as your first programming language. Java or Python are better candidates

  • @netscayped
    @netscayped 3 года назад +2

    please make more 🥺 this is so much more engaging than most of my programming classes were

  • @jasperzanjani
    @jasperzanjani 3 года назад

    you are a very smart guy. I know from trying to do these tech/tutorial-themed videos that it is a ton of work, but luckily you're building on a solid base of technical expertise. I look forward to seeing more from you

  • @MadhatClemens
    @MadhatClemens 3 года назад +88

    Let me preface this by saying I have absolutely zero love for Yanderedev. I don't mean that in a bullying way, and I'm sorry if it is interpreted as such. I also have zero knowledge of coding. I may not be able to fully grasp the level of detail that you go into with your analysis, but I think you've done an amazing job, and I think it's great that you are demystifying these myths that are likely made by people that have become sick and tired of Yanderedev, or people with their own beliefs and opinions on coding habits. This does not absolve him of (nor validate) everything, but it is wholly unfair to condemn him on points that are based on misinformation or untruth. Excellent job.

    • @nerveinz6453
      @nerveinz6453 3 года назад +2

      But 6 years of eating free money from patreon, yeah. He should be in peison right now

  • @manuillo94
    @manuillo94 3 года назад +367

    ur an unity wizard, my 7 years developing in the engine now feels like child's play

    • @freelanceart1019
      @freelanceart1019 3 года назад +29

      Unity is pretty hard for beginners considering so many option and version interations to choose from. Amazing but stability wise overwhelming.

    • @nursultannazarov8379
      @nursultannazarov8379 3 года назад +3

      @@freelanceart1019 what a weakling. Unity is peace of cake compared to Unreal Engine

    • @phitc4242
      @phitc4242 3 года назад +26

      @@nursultannazarov8379 ha! what engine? I only know C, you weakling

    • @ramster4459
      @ramster4459 3 года назад +48

      @@phitc4242 shame on you, i write everything from scratch in binary. Imagine using pre-cooked languages, pathetic

    • @phitc4242
      @phitc4242 3 года назад +15

      @@ramster4459 okay okay... my comeback:
      I designed my own cpu & cpu architecture MUWHAHA

  • @EGIMSL
    @EGIMSL 3 года назад +11

    dude wtf not only are you a very talented programmer but also incredibly talented music producer if you really made all that stuff from scratch. Lowkey I'd love to see a video of some of your production projects, your go to instruments / plugins, and other music production stuff...

  • @maxifernandez1760
    @maxifernandez1760 8 месяцев назад +9

    The argument that "the code is so badly written that it causes huge performance issues" is one of the worst becuase it's just calculations and are very little compared to what usually tanks performance, which is rendering related most of the time. Even if this is some of the worst code I've ever seen, Spaghetti code has existed in many games (although not as bad as Yandere Sim's code) and can be present in some of the greatest games. IIRC Halo 2 is one of these examples, according to youtuber InfernoPlus when talking about modding in Halo 2: "this game engine is held together by duct tape and popscile sticks".

  • @Violent_Wolfen
    @Violent_Wolfen 3 года назад +811

    So apparently the dude linked this video so I watched it out of curiosity. Now, I know jackshit about coding, but one thing I've learned is that a lot of people that bitched about the code didn't fully know what they were talking about and just spewed out what other people said regardless if it was true or not.
    I actually learned something this morning and I thank you for that.

    • @zamidare9038
      @zamidare9038 3 года назад +16

      Well in my opinion seeing lots of if statements in an update function in a single unity script file is hard to read and it really can't be skipped if it is a bunch of if statements (unlike with if else statement that will skip the rest once a condition is true in the code block). The aim is to have a simple flow and structure by taking advantage of using object oriented concepts so that others can read it, easily know what things does which. In Jason Weimann's youtube video, I learned of a story he encountered where a game feature is (probably) 10k lines of code made by one guy for inventory system but their team took months to study it of what's causing the problem and it is just so brittle (one small thing changed can make it go fail) so it is simpler to just start from the ground up and divide things to conquer them. (The vid is titled "Why I switched from Unreal to Unity & wont go back"). I'm still new to unity even though I know other simple programming but learning is fun.

    • @FF18Cloud
      @FF18Cloud 3 года назад +22

      @@zamidare9038 like, the code definitely isn't easily human maintainable
      That's definitely a problem
      Stuff like that leads to human error and well, bugs.
      But like, if you try to compare it on runtimes, yeh, an if statement is like, O(1) runtime, this isn't a loop where, you can get something like o(n)
      1 means straight through (means pretty fast)
      o(n) means runs n number if times
      I mean, every character is running this giant script, sure, but I think as this guy put it, unity has a pretty good game loop to run all this stuff on the update part of the loop
      Man, like, all these things yandere dev has issues with, architecture wise, these were all things I didn't learn in college, more so got my head bashed in by my project lead when I started my first job, lol.
      Like, I don't ever really have any motivation to play yandere simulator or lovesick, but ¯\_(ツ)_/¯ honestly it just sounds like the guy got into this without ever working with anyone on coding a game.
      Architecture stuff is something that would be worked out from a team environment when people start complaining that they can't work with all this stuff too coupled together to add new features
      I mean, at this point, he probably doesn't want to work on the game anymore considering all the stuff, I don't really care, just, :/ eyeah ¯\_(ツ)_/¯

    • @franst3909
      @franst3909 3 года назад +13

      @@zamidare9038 Same I'm relatively new to coding on Unity. I created a base project to test my code before doing my actual project. It was fun going back and reworking things to look as nice and neat as possible, the objective was to make it as easy as possible to add new content. Now I barely have to code anything when adding on to my game.
      Yeah, a lot of problems Yanderedev has can be assumed to be caused by bad organization, it works and frame rates will be good. However, it takes really long to add new content. Which can be a reason why his major updates are so slow. A RUclipsr by the name of k gon looked through the assets in yanderesimulator, many unused models and the names were confusing, hard to match texture to model.
      I believe if Yanderedev restarts the project from scratch in the long run his progress might actually be faster, (I don't think he will). Organization is also potentially why Lovesick may progress quicker than Yansim/ how it took them so fast.
      Neat code may not improve gameplay but it goes a long way in helping yourself and adding new content.

    • @zamidare9038
      @zamidare9038 3 года назад

      @@FF18Cloud Reading the code of others and being able to know how hard it is to work in a team can only be encountered first hand in a group work (which is the case for me) where we have this guy in a java project in college who don't know what to do (but he can do things, just don't know what or how to contribute) so I just told him to do small things we can do easily and faster but he is a little bit of a bottleneck. While another guy is like brainstorming with me what we can do, add and how we divide the work then combine it later. Even though we're 3 only 2 can do nicely. Maybe if I placed the first guy into debugging instead that might helped more than giving him work to do in smaller easy things. The unfortunate thing is group work in code is probably only common to software engineering students in our university back then. But really in my opinion we've reached an initial point where we prefer faster coding than shorter code blocks for a faster prototype where execution speed wasn't placed into consideration yet which is fine.

    • @zamidare9038
      @zamidare9038 3 года назад

      @@franst3909 Well if you can barely have to code when adding to your game then that's nice. If it's me I can definitely see myself able to write a single main script that's a long lines of code in unity while the other supporting scripts are short utilities or managers but what I'm envious about from others is their natural capability to divide the working functions into different scripts or modules that will receive / process parameters passed and each will do one clear thing. That's why it's a bit hard since I'm mostly comfortable with C (and the old days of assembly, basic stamp, arduino, visual basic) where multitasking isn't really a main thing while C++ and java dives you into this flexibility of classes which means reusing code and then in C# they're in the form of scripts representing modules. As for your point of restarting the project from scratch in my opinion it is easy to think and reasonably so that that will help in the long run but there are things to consider. We won't know for sure if rewriting the original is faster unless it is tried and compared. Working from a clean state with the aim of converting original code will still need time and effort. Though I know what you mean. The thing that's going to become faster is the addition of new elements.

  • @sartouhou8349
    @sartouhou8349 3 года назад +387

    FINALLY BRO someone who actually knows what they're talking about

    • @sartouhou8349
      @sartouhou8349 3 года назад +11

      @@RitsuAbyssgard Yeah but "any other person with basic knowledge of coding" only knows about the if-else argument, and only knows about it because they've just read about it somewhere

    • @CH3LS3A
      @CH3LS3A 3 года назад +18

      @@RitsuAbyssgard who said anything about appearance? plus, he showed us his thorough knowledge and experience, which is much more than basic knowledge, and much more than most of the "if else xdddd" circlejerkers.

    • @nesy3634
      @nesy3634 3 года назад +3

      @@CH3LS3A
      Not gonna lie, that strawman made me laugh from this Anime lad. This person who responded seems like a total blimp in the head.

    • @Dan_Kanerva
      @Dan_Kanerva 3 года назад +5

      @@RitsuAbyssgard you are the reason people hate weeaboos

  • @zokalyx
    @zokalyx 3 года назад +2

    Bro this is so high quality content. 10/10 would watch again somewhen in the future.

  • @GiovannT300
    @GiovannT300 3 года назад +1

    Marking this on favorites just for the code explaination, you're really good at this!!!!!!

  • @legendarymiles4643
    @legendarymiles4643 3 года назад +34

    So you know in the sims 4 when your sim is reading a skill book that is to advanced, they get tense and say that they didn't understand a single thing... yeah thats me right now

  • @Bradafer
    @Bradafer 3 года назад +80

    As a gamedev it really bothered me watching RUclipsrs that don't know much about dev critiquing "if else vs switch" and saying that was the reason the game was slow and "this is programming 101 stuff blah blah"
    This video is really really well done. Great work!!!

    • @gunswinger3110
      @gunswinger3110 3 года назад +10

      I'm just glad the big, highly edited videos focus more on yandev's behavior as well as the actual game design. Game's still problems, just that the coding isn't the real smoking gun.

    • @harrylane4
      @harrylane4 3 года назад

      @@gunswinger3110 you're right. It's the stolen assets and endorsement of pedophilia that are the problem with the game.

    • @ITR
      @ITR 3 года назад

      I was bothered more by the "this." complaining when most of the early complaints about that was purely due to the decompiler adding them.

  • @Red_Phantom64
    @Red_Phantom64 8 месяцев назад +12

    Welp, now I'm getting recommendations of Yan Dev since his allegations came out, oof

  • @MirkoCrafter
    @MirkoCrafter 3 года назад +21

    Talks about Occlusion Culling.
    Shows an image of Frustum Culling.
    *laughs in nerd*

  • @viks2ndaccount478
    @viks2ndaccount478 3 года назад +274

    about optimizing character models: the way you optimize them is by knowing how to prioritize polygons and use as few as possible without hurting the visuals, the character should be deisgned in a way where basic body parts that dont move (like forearms, thighs etc) have the least polygons while joints and features (elbows, knees, faces, maybe hair or some highlights on clothes) have more polygons to give more realistic animation for bends, twists and turns. They should also be constructed with a clear understanding of edge loops and how to effectively split features apart without "stitching" so it looks natural for arms to bend or strech or expressions to not interfere with other features or look half-baked. there are also several tricks that you can use to artificially make characters look better with textures, normal maps/height maps and shaders togheter with some other neat tricks, most of which can be seen in a+start's low poly series.
    of course im no proffesional or expert on this, i can be wrong about some things or using the wrong terminology, but its enough to get the point acorss. Making a model for a game is not as simple as making a model, slap some textures and a rig on and call it a day as long as it looks good enough.

    • @matejpesl6442
      @matejpesl6442 3 года назад +2

      And that's why I want to avoid game development as much as possible. It's hard man. And to me also boring.

    • @victornecromancer
      @victornecromancer 3 года назад +3

      @@matejpesl6442 don't give up pal, there's no need to do everything in your game, just call some friends or hire someone that nails it for you

    • @matejpesl6442
      @matejpesl6442 3 года назад +5

      @@victornecromancer I change my comment: it's hard to do it *right. It's easy to do *something** in unity, but it's a very different thing to do it right.
      Also thank you, but I as I said I don't want to make games :D It's boring to me and my creativity isn't the best either. I'll stick to good ol' desktop, web or Android development.

    • @victornecromancer
      @victornecromancer 3 года назад +2

      @@matejpesl6442 in the end, when you delegate functions to other people, you can focus on what you're good at. Anyway, i understand you

    • @matejpesl6442
      @matejpesl6442 3 года назад +1

      @@victornecromancer wtf are you talking about

  • @filly291
    @filly291 3 года назад +302

    I'm glad I found this video, I had enough of people screaming about the code and not explain g what is actualy wrong with it. Also, I know nothing about coding, but you explained it so I could understand as well. Nice job! Very well made video.

  • @JoyDavidson
    @JoyDavidson 2 месяца назад +1

    What's so cool is that I'm able to understand everything you are talking about. Been going to school for computer science and it's paying off with all the knowledge I have learned.

  • @myx555
    @myx555 3 месяца назад

    Loved the video! This feels more like a game optimisation lecture instead of that particular game's code review.

  • @luxraider5384
    @luxraider5384 3 года назад +167

    This video really sounds like "common mistakes in game developpement" and for me as a beginner programmer it was really instructive