understanding the code that sparked anger in valve's programmers

Поділитися
Вставка
  • Опубліковано 21 лис 2024

КОМЕНТАРІ • 2,6 тис.

  • @shounic
    @shounic  4 роки тому +5717

    hey! i appreciate that so many of you enjoy my last video :) but i have to make it clear - this is likely the last video i'll make about general-ish coding stuff. i'm probably going to make a billion videos about digging through weird shit in the tf2 code but if you subscribed specifically for coding memes or whatever you should reconsider your subscription! not that i'm ungrateful but i would feel worse about spamming your sub box with random tf2 stuff you don't want. if you decide to stick around to see if any of my future stuff interest you, thanks for giving it a chance :)
    FAQ:
    Q: Why didn’t you include X?
    I read through the code for the comments that seemed the most interesting first. After getting through a few of them the script for the video already grew super long so if I do cover anymore / the rest it’ll be in a part 2. There wasn’t a decision made to deliberately exclude something, only actions as a result of practical reasons ie no time or video getting too too long.
    Q: X part is technically wrong!
    Frankly I haven’t made videos about code like this before so I wasn’t sure how to balance simplifying things versus being accurate. I decided to favor improving understandability and digestibility, but hopefully the script writing wasn’t too awful.
    as a reward for making it to the bottom - sorry for taking so long to put this together! this video was tough to make ;__; script writing took 4 days and putting the visuals together took another 4 days. it's been rough ;_______; for reference most of my videos take literally half that time.
    oh also my friend made this to demonstrate how the paint colors function work :) drive.google.com/open?id=1FhFg7xIRBskwQkUhhQ4Ax22vKBDr8Wz3

    • @rbarua3368
      @rbarua3368 4 роки тому +3

      Thanks

    • @liminal111
      @liminal111 4 роки тому +4

      Hell yeah, good luck in future videos!

    • @smb_64youtube5
      @smb_64youtube5 4 роки тому +35

      So no more code memes like this will be maded.... To Bad!

    • @The-64th-Gamer
      @The-64th-Gamer 4 роки тому +2

      Good luck with things! Excited to learn more about how TF2 was coded from the source leak

    • @twelvethousandths1698
      @twelvethousandths1698 4 роки тому +1

      I think you make the most interesting and entertaining tf2 videos.
      It's different, and that's Great!

  • @grandwizardautismo
    @grandwizardautismo 4 роки тому +8837

    I will never look at my team spirit painted items the same again

    • @stardustriver
      @stardustriver 4 роки тому +64

      wow

    • @wojtekpolska1013
      @wojtekpolska1013 4 роки тому +987

      Just think about how much pain went into making of these. Too bad!

    • @9frames590
      @9frames590 4 роки тому +7

      Same.

    • @Timeward76
      @Timeward76 4 роки тому +547

      I was in physical pain watching the explanation for the team spirit paint. That one diagonal line was someone's day at work. It hurt my soul to watch it unfold.

    • @noskalborg723
      @noskalborg723 4 роки тому +17

      @@Timeward76 fluffing their hours much?
      Sheesh. JUST DRAW IT!

  • @mrhomard609
    @mrhomard609 4 роки тому +14497

    "This machine. I hate this machine. Because it does exactly what I tell it to do, and not what I want to do."
    Some guy learning computer science in the 60's in Oxford

    • @faye_isc
      @faye_isc 4 роки тому +126

      🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣😅😅 im ded

    • @lanague6890
      @lanague6890 4 роки тому +793

      well we forget, but until relatively recently the computers did NOT always do what you wanted, you needed to mitigate errors coming from the hardware. Its not even spoken about at all in most comp sci classes anymore.
      Recently this popped up again with quantum computing.

    • @manasmahanand732
      @manasmahanand732 4 роки тому +592

      @@lanague6890 oh yes, I am a programmer, I would can't begin to imagine the pain of figuring out whether it is a runtime error, logical error, syntax error or something related to the hardware.
      But at the same time, softwares back then did comparitively simpler things (except the Apolo mission, that is magic IMO).

    • @averagegeek3957
      @averagegeek3957 4 роки тому +25

      Did you make up the quote or is it a real one? I tried googling but I wasn't able to find anything.

    • @mrhomard609
      @mrhomard609 4 роки тому +82

      @@averagegeek3957 maybe it's not exactly the original one, but I definitely remember something like that from a Matlab forum post where the person said it originated from Oxford last century

  • @Speederzzz
    @Speederzzz 3 роки тому +8227

    "This code supports an infinite amount of colours!"
    "Our game is based around two colours fighting"

    • @SirDavid290
      @SirDavid290 3 роки тому +349

      TF2 classic : Hold on a minute !

    • @JonatasAdoM
      @JonatasAdoM 3 роки тому +135

      Got to think about rainbow skins these days.

    • @grandmagunsales2125
      @grandmagunsales2125 3 роки тому +48

      And then there were 4 colors fighting

    • @Tekdruid
      @Tekdruid 2 роки тому +89

      Thing is, it's about as hard to account for 2 as it is for (n+1) instead of 1.

    • @RabbitKiwi
      @RabbitKiwi 2 роки тому +120

      @@Tekdruid to be fair, it could've been hard coded for 2 colours only and would waste less time to over engineer the solution for 2 or more colours

  • @LordJoey999
    @LordJoey999 4 роки тому +3743

    I use to code once, I now work with animals. Everything is now nice.

    • @damiengates7581
      @damiengates7581 4 роки тому +26

      lmao, funny

    • @antonioazulamarillo7579
      @antonioazulamarillo7579 4 роки тому +19

      Ha ha ha. I laugh

    • @maerosss
      @maerosss 4 роки тому +98

      Exactly. Currently creating websites. Hopefully will not go nuts before I find a better, manual job in nature or something :D

    • @mr.d00m37
      @mr.d00m37 4 роки тому +1

      same

    • @AlPootis
      @AlPootis 4 роки тому +25

      I wanna do some nature related jobs to when I'm old enough.
      I'd also like to learn good pixel painting and programming!

  • @marinenukem
    @marinenukem 4 роки тому +1965

    To the programmer who went above and beyond with designing the team spirit paint icon, I salute you.

    • @Aoredon
      @Aoredon Рік тому +37

      Shame that if you had enough colours like you can see near the end, some of them wouldn't be visible due to the size of the paint texture

    • @sgwaic
      @sgwaic Рік тому +22

      @@Aoredon i would assume it can be easily fixed by defining the "0" and "1" bounds closer to the paint itself, and the algorithm automatically scales from 0 to 1

    • @RubenKelevra
      @RubenKelevra 11 місяців тому +7

      I don't get it. Just make a vertical line and split it x times. Create a line on each split point, flip the gradient's algebraic sign, and ask a lib for geometries where the line intersects the rectangle.
      That's so much simpler than what they did there.

    • @dabqu
      @dabqu 11 місяців тому +3

      everyone's GPU is slightly hotter because of this, bad design tbh

    • @Idiomatick
      @Idiomatick 11 місяців тому +4

      @@RubenKelevra there is definitely some built in graphics handling functions to do this without any custom math

  • @arandomday3530
    @arandomday3530 4 роки тому +4141

    I really love the diagrams you created for this video. They’re clean, colorful, easy to understand, and fun to look at. Fantastic design. I really admire your effort and attention to detail.

    • @papercotton
      @papercotton 4 роки тому +15

      i wonder how he made them. probably premiere?

    • @_Wombat
      @_Wombat 4 роки тому +16

      I second this notion. It makes the video a lot more approachable

    • @501ststormtrooper9
      @501ststormtrooper9 4 роки тому +4

      Unlike the math at school as well.

    • @sasdagreat8052
      @sasdagreat8052 4 роки тому +18

      "Clean", "colourful", and "fun to look at" does not describe your profile picture, however. What is that abomination?

    • @pierreo33
      @pierreo33 4 роки тому +1

      @@sasdagreat8052 Sanic

  • @kelpocereal5077
    @kelpocereal5077 4 роки тому +3344

    Imagine the amount of angry text over the localization files

    • @lordjaraxxus5418
      @lordjaraxxus5418 4 роки тому +549

      //why are we still here? just to suffer?

    • @thetrashmann8140
      @thetrashmann8140 4 роки тому +284

      Little fact the localization files is used for translations and well the item names etc. therefore updating the localization files from these past few updates have done nothing.

    • @masterthg3137
      @masterthg3137 4 роки тому +125

      Lord Jaraxxus // Too Bad!

    • @Orbitthemaster
      @Orbitthemaster 4 роки тому +62

      Imagine the amount of angry text over the PS3 port... xD

    • @tezcanaslan2877
      @tezcanaslan2877 4 роки тому +8

      JC Little That port wasn’t made by Valve

  • @meflea3675
    @meflea3675 4 роки тому +3911

    I just realized this may be one of the best ways to teach programming. Show frustrated comments in code for comedic effect and explaining the frustration behind it, whilst also teaching how to avoid it. Might go extremely far teaching students, but finding examples would be really difficult.

    • @firebug7208
      @firebug7208 4 роки тому +274

      Yandere Dev should be enough of an example

    • @june1884
      @june1884 4 роки тому +11

      Firebug nice

    • @gimmforwho_
      @gimmforwho_ 4 роки тому +83

      @@firebug7208 else if ()

    • @oi_bruv
      @oi_bruv 4 роки тому +8

      Yanderedev would be a great introduction to switch and how to use it

    • @sharpfang
      @sharpfang 4 роки тому +21

      Probably, if you can find "how to avoid it" on such genuine examples, you'll be making better money fixing these problems for real than teaching.

  • @ScTiger1311
    @ScTiger1311 4 роки тому +3555

    I love that line "Yes this causes a memory leak. Too bad!"

    • @FortuneHunters
      @FortuneHunters 3 роки тому +399

      There's another comment under that one saying "Actually, we need two memory leaks". So it turns out yes, they do need 2 memory leaks (2 reference tables in this video).

    • @popcultureprogrammer2171
      @popcultureprogrammer2171 2 роки тому +36

      I will probably use this in my projects when I'm lazy/have hit a wall

    • @31redorange08
      @31redorange08 Рік тому +3

      Wouldn't have happened with Java.

    • @fiskfisk33
      @fiskfisk33 Рік тому +44

      @@31redorange08 of all the languages you can choose between, you choose an interpretted one for this use case?!

    • @31redorange08
      @31redorange08 Рік тому

      @@fiskfisk33 It's debatable whether Java is interpreted or not. But what's your point?

  • @sharpfang
    @sharpfang 4 роки тому +908

    That last example is a perfect showcase how 3 days of developer's work can save the company 3 minutes of graphics designer work (drawing the 2-colored icon).

    • @eggbun
      @eggbun 4 роки тому +40

      What a deal

    • @Slash0mega
      @Slash0mega 3 роки тому +48

      3 minutes of graphic design work.... Unless they change somthing

    • @sharpfang
      @sharpfang 3 роки тому +131

      @@Slash0mega In which case it's 4 minutes. Maybe even 5 or 6!

    • @VeaceslavMunteanu
      @VeaceslavMunteanu 3 роки тому +45

      If you load everything from textures, you'll hurt both the performance and greatly increase the size of the game

    • @sharpfang
      @sharpfang 3 роки тому +161

      @@VeaceslavMunteanu Dude, we're talking about a tiny icon, likely less than a kilobyte in size. And guess what hurts performance more, loading a straightforward 1kb icon, or generating one on the fly basing on several "base" icons and following a byzantine algorithm with tons of edge cases.

  • @GabrielShitposting
    @GabrielShitposting 4 роки тому +5090

    I love that last one.
    It's smart, because it supports scalability.
    But it doesn't need scalability because there will always be 2 teams.

    • @tisaconundrum
      @tisaconundrum 4 роки тому +367

      Unless...

    • @ahmed4363
      @ahmed4363 4 роки тому +117

      @@tisaconundrum new game mode possibly but not likely

    • @sternowl2345
      @sternowl2345 4 роки тому +565

      Its not for supporting more teams, its for supporting the general case of having items with more than 2 color options.

    • @JustAthel
      @JustAthel 4 роки тому +60

      TF2Classic be like:

    • @alexstewart9592
      @alexstewart9592 4 роки тому +261

      This function is a general function for all paints that take multiple colours. If, for example, they were to release a napoleon ice-cream paint (Napoleon ice-cream is a single tub containing chocolate, strawberry and vanilla, and scooped accross the stripes to get all flavours in each scoop), this function would support it.

  • @TheDisarminghinkle
    @TheDisarminghinkle 4 роки тому +23939

    It's looking more and more like my conspiracy theory is right. The TF2 team "accidentally" leaked the code so that people would fix it for free.

    • @michealmcdoesntexist4970
      @michealmcdoesntexist4970 4 роки тому +3099

      My personal conspiracy is someone in valve found out there are plans to abandon TF2, and so someone leaked the code to make sure the community could keep it alive

    • @AGrayPhantom
      @AGrayPhantom 4 роки тому +1693

      Unfortunately the "leaked" code was old, is useless, and has been out for ages.

    • @genroynoisis6980
      @genroynoisis6980 4 роки тому +193

      @Mialisus ...yeah, like an added "nice" or "lmao" makes it better.

    • @rafaelmorales1926
      @rafaelmorales1926 4 роки тому +916

      Well you know, Murphy's law: if you want to know something, just say something completely wrong and someone will eventually correct you out of pure anger

    • @TheDisarminghinkle
      @TheDisarminghinkle 4 роки тому +341

      @@rafaelmorales1926 I like Murphy's Updated Law.

  • @gore4332
    @gore4332 4 роки тому +3153

    For that last one about the color icons... I do NOT blame whoever was angry at how over complex that code is lol

    • @Jenner_IIC
      @Jenner_IIC 4 роки тому +576

      It's like using a hunting rifle against some raccoon eating your trash.
      It will definitely work and will also work in far more demanding cases, but as of now it's such a ridiculous overkill that it's just painful.

    • @googleforcedhandle
      @googleforcedhandle 4 роки тому +255

      All I can think of is that they saw that mp mod where there are like 8 different color players and said "you know, that sounds cool, but if we do it this shit has to support it"

    • @elans.8595
      @elans.8595 4 роки тому +377

      All because the vertical line didn't look good enough.

    • @scoutiano4441
      @scoutiano4441 4 роки тому +195

      That's like trying to get rid of an ant colony by using a fucking rocket launcher

    • @darthgiorgi4990
      @darthgiorgi4990 4 роки тому +244

      @@scoutiano4441 well, in that case that would be in true TF2 spirit.

  • @DynaDere
    @DynaDere 4 роки тому +3317

    Me: *Calmly clicking through the menu's* Haha that team color paint looks good.
    Game Code: *Screams of agony*

    • @duetopersonalreasonsaaaaaa
      @duetopersonalreasonsaaaaaa 3 роки тому +28

      Is your pfp Maid!Kagero?

    • @mennedeklir5926
      @mennedeklir5926 3 роки тому +106

      @@duetopersonalreasonsaaaaaa consider touching grass

    • @sltrskid
      @sltrskid 3 роки тому +57

      @@duetopersonalreasonsaaaaaa go outside, god damn

    • @duke4726
      @duke4726 3 роки тому +25

      @@duetopersonalreasonsaaaaaa There is this one vitamin that you get by taking sun. im afraid you lack it.

    • @grod5998
      @grod5998 3 роки тому +56

      @@duetopersonalreasonsaaaaaa There's a door down the hall, it's called the "front door"
      I suggest you use it

  • @Omlet221
    @Omlet221 4 роки тому +967

    8:10 “the angle is prettier” I think coders have one of the most important jobs because look they’re even graphic designers now

    • @QuintaFeira12
      @QuintaFeira12 4 роки тому +203

      That comment wasn't a thought that came from the programmer. That was something the programmer was told before they took this task'scard, and they wanted to leave it as a comment near the code for the next person to know what's up.

    • @Omlet221
      @Omlet221 4 роки тому +32

      @@QuintaFeira12 oh yeah nvm you’re probably right

    • @rampageblizzard
      @rampageblizzard 3 роки тому +5

      Honestly that’s what I came here to say. Shouldn’t a graphic designer be making those paint splats? It would take them less Than a day’s work to split all of them in two.

    • @h.celine9303
      @h.celine9303 3 роки тому +47

      @@rampageblizzard The whole point of this is to have neither designers nor engineers have to work on this. Hence they automated it.

    • @rampageblizzard
      @rampageblizzard 3 роки тому +9

      @@h.celine9303 oh. Nice. The code probably applies to future colors added as well, so no extra work would be needed in the future. That’s kinda cool.

  • @Beanibirb
    @Beanibirb 4 роки тому +7592

    Thought this would be in a comedic way but instead here I am learning actual coding processes and the real problems behind the hilarious comments

    • @aqsem9073
      @aqsem9073 4 роки тому +286

      Well now we know why there's only at most 5-10 devs working on tf2. They all rage quit on their own code

    • @the_tube2
      @the_tube2 4 роки тому +49

      My brain hurts

    • @rabbitdrink
      @rabbitdrink 4 роки тому +40

      frustrated comments like these is part of the process lol

    • @The2Coolest2
      @The2Coolest2 4 роки тому +7

      Not hilarious, pretty sad

    • @dashdashdash_
      @dashdashdash_ 4 роки тому +11

      @@the_tube2 Atleast they wrap their methods

  • @normalguy729
    @normalguy729 4 роки тому +7342

    I wonder how the programmers are doing. Hopefully they're doing well.
    Why did we just make our own heavy is dead in the comments?

  • @Misuune
    @Misuune 4 роки тому +7304

    Coding is a good job mate, it's challenging work inside a office. I'll guarantee you'll go insane cuz at the end of the day as long as there's still code to write, someone is gonna need to calm down someone else.

    • @dumbleking5172
      @dumbleking5172 4 роки тому +238

      // _insert_ *MANIAC SPYPER SCREAM*

    • @Timeward76
      @Timeward76 4 роки тому +301

      The code for that diagonal line must've required a lot of hugs to get through.

    • @CS-om3kj
      @CS-om3kj 4 роки тому +63

      Ralof Are ya codin’ son?

    • @shirubaurufu
      @shirubaurufu 4 роки тому +43

      @@Timeward76 I hope I also get huggs when I eventually have to deal with things like that

    • @stiky5972
      @stiky5972 4 роки тому +65

      PROFFESIONALS HAVE

  • @trbz_8745
    @trbz_8745 4 роки тому +1479

    Honestly mad props to the paint color guy. As a programmer, writing code in the most general way is always best, because for all he knows ten years down the line they might add more teams and instead of writing another script for it, they already have it in a general form applicable for any color, number of teams, cut angle, image, etc.

    • @brownspottedcat
      @brownspottedcat 3 роки тому +10

      @Inna Sits Mods.

    • @womp6338
      @womp6338 2 роки тому +74

      Or they might not and then you did all that work for nothing. And even if they do there is a good chance that your code won't be usable.

    • @nuclearpugg
      @nuclearpugg 2 роки тому +75

      @@womp6338 So you wouldn't do the option that would be best for longevity just because the people of the future may not use it? I'm curious why man

    • @grqfes
      @grqfes 2 роки тому +25

      @@nuclearpugg bro team fortress 2 has always been and always will be red vs blu it will never have more team colors plus in this instance noone will touch the code for another 9 years anyways

    • @Jws20
      @Jws20 2 роки тому +28

      @@grqfes green and yellow in TFC and TF 1

  • @GothAlice
    @GothAlice 4 роки тому +749

    Working on a Facebook game for the Batchelor TV show, performing "matching" operations between contestant survey results as a game mechanic, I wrote up a particularly creative (nested!) use of Python's "groupby" iterator function and "diff" to determine the "distance" between two sets of sorted answers.
    Asking the Belarusian co-worker who I pair programmed those *two lines* with to add a little documentation, just a comment, above it describing what it's doing and why, he wrote:
    # Satan code, do not read backwards.
    They were, admittedly, *very* dense lines.

    • @wilburdemitel8468
      @wilburdemitel8468 4 роки тому +2

      cool story bro

    • @Bloodlyshiva
      @Bloodlyshiva 3 роки тому +91

      One man's treasure/clever is another man's Satan. Also sometimes just humour.

    • @Kreze202
      @Kreze202 3 роки тому +140

      Behind a cleverly written code is a set of programmers not understanding a single line

    • @josephvictory9536
      @josephvictory9536 3 роки тому +79

      AH yes my specialty, when the code comment is 10 times longer than the code.
      I used a list index and nested generator function to simulate counting two lists simultaneously (in a for loop) to get around using a shit ton of conditional statements and calls. lol (literally just some copy pasting and sign changing).
      On the plus side, it worked really well, on the down side, i am retarded.

    • @NoTraceOfSense
      @NoTraceOfSense 3 роки тому +25

      @@wilburdemitel8468 someone’s clearly never written code

  • @MrPatters
    @MrPatters 4 роки тому +1355

    4:22 I've never seen TF2 with motion blur, this is insane

    • @NeoDerikik
      @NeoDerikik 4 роки тому +300

      @@user-no3tu9kh3p it looks vomit-inducing

    • @ungamer6241
      @ungamer6241 4 роки тому +29

      @@user-no3tu9kh3p bruh no one said your playing on vr

    • @scarymonsters524
      @scarymonsters524 4 роки тому +129

      These are edited values. Default is nothing like this.

    • @ezrac704
      @ezrac704 4 роки тому +73

      I actually kind of like the motion blur in TF2. It isn't too noticeable or annoying, yet it looks good. I still have it disabled though.

    • @ungamer6241
      @ungamer6241 4 роки тому +3

      @@ezrac704 same

  • @jupitersky
    @jupitersky 4 роки тому +679

    "Hillariously overengineered"
    Literally all my code.
    No wonder I never get anything done.

    • @manasmahanand732
      @manasmahanand732 3 роки тому +55

      Lol same. I've written an entire cms type thing for a simple website.
      I just needed to load 6 videos, but my brain was like: Yes, this should be entirely customisable by the user from the backend, because they would definitely want that feature.
      I spent 1 week on that, I'm so stupid.

    • @YeetZmeN
      @YeetZmeN 3 роки тому +38

      Same. For some reason my brain is incapable of seeing easier ways of doing things until I’m already well into doing it in an unnecessarily complex and time consuming way.

    • @zrspangle
      @zrspangle 2 роки тому +9

      @@manasmahanand732 that one week definitely was amazing practice for you, though.

    • @manasmahanand732
      @manasmahanand732 2 роки тому +18

      @@zrspangle yes definitely. But I shouldn't do those experiments on client websites. I just wasted their time

    • @Roxor128
      @Roxor128 4 місяці тому

      @@manasmahanand732 Reminds me of something I did while playing "Turing Complete". One of the puzzles is to write a program to compute 2*pi*r, with pi approximated to 3 on an architecture without multiplication instructions. The simple way would just be to do five adds. I wrote a general multiply routine and fed it a value of 6 for one of the inputs every time.

  • @johnjordan3552
    @johnjordan3552 4 роки тому +755

    So that's why I get 3 FPS when opening my backpack in-game

    • @chicken8664
      @chicken8664 3 роки тому +75

      Bold of you to assume that FPS would be allowed to drop to 3 in TF2

    • @Danimations2015
      @Danimations2015 3 роки тому +48

      @@chicken8664 gotta get 2 fps instead

    • @TomitaGregorias
      @TomitaGregorias 3 роки тому +62

      Hey when I click Mann Vs Machine, store or backpack my fucking game lags and hear that amazing clicking sound for three seconds. My pc btw runs Cyberpunk 2077 on medium on 60fps.

    • @drugjoza5000
      @drugjoza5000 3 роки тому +8

      @@TomitaGregorias Same happens to me! It's brain melting

    • @thesauce1682
      @thesauce1682 3 роки тому +51

      @@TomitaGregorias lmao, the agony when you hear scout screaming on loop because you change settings.

  • @HistoMagouri
    @HistoMagouri 4 роки тому +261

    0:33
    "all the code in this function looks pretty normal"
    Famous last words before a programming disaster!

  • @QuintaFeira12
    @QuintaFeira12 4 роки тому +304

    I'm amazed the last guy actually did some pretty good and honestly, inevitable elegant solution - yet was incredibly angry and mad at having to do it in the first place.

  • @diegodankquixote-wry3242
    @diegodankquixote-wry3242 4 роки тому +1907

    This makes the comments even funnier than before

  • @spineck5499
    @spineck5499 4 роки тому +3272

    im just gonna act like i understand everything by nodding and saying "yes" every 6 seconds

    • @etlttc353
      @etlttc353 4 роки тому +53

      I kinda understand but im not an actual programmer yet so...

    • @chance9512
      @chance9512 4 роки тому +192

      Be sure to add a "hmmm" every once in a while, so you look like you're really thinking about it.

    • @TheInnerEvil
      @TheInnerEvil 4 роки тому +28

      Yes, interesting.

    • @kriss123boys5
      @kriss123boys5 4 роки тому +5

      r/meirl

    • @francescogirardello9250
      @francescogirardello9250 4 роки тому +8

      Exactly like in school

  • @RemiScutlet
    @RemiScutlet 4 роки тому +9800

    Is asking them to update the game considered torture?
    I feel bad now

    • @KingLich451
      @KingLich451 4 роки тому +709

      yep... That's why they're dead

    • @noahmay7708
      @noahmay7708 4 роки тому +389

      @@KingLich451 oh no... You killed Valve!

    • @KingLich451
      @KingLich451 4 роки тому +178

      @@noahmay7708 oh crab

    • @NotLordAsshat
      @NotLordAsshat 4 роки тому +712

      The game is probably so convoluted to code for at this point I'm pretty certain they're scared of even trying to work on it

    • @marshallemmet1366
      @marshallemmet1366 4 роки тому +174

      they should just sit back and work on cleaning up the code first before making another content update.

  • @aaronspencermusic
    @aaronspencermusic 4 роки тому +169

    It's actually really reassuring as a game dev, like some of the stuff i am doing feels like the wrong way of doing it, but even valve programmers have to do broken stuff to accomplish their goals

    • @orestisgeorgatos6725
      @orestisgeorgatos6725 Рік тому +11

      in a project large enough, you can’t dodge scuffed bullshit

    • @aaronspencermusic
      @aaronspencermusic Рік тому +15

      @@orestisgeorgatos6725 Yeah so in the time since writing that I became a software developer professionally and you're right :D

    • @epicfun2
      @epicfun2 Рік тому +6

      @@aaronspencermusic Glad I came back to this video to see that, it put a smile on my face. Congrats!

    • @lazerpie101
      @lazerpie101 11 місяців тому +1

      The only wrong way is the way that doesn't work.

    • @anstorner
      @anstorner 7 місяців тому

      There may be ways to optimize code, but that multiplies however time it took to create to just work at all by square probably.

  • @8Delian8
    @8Delian8 4 роки тому +437

    Now remember that every time someone asks for a TF2 update they want perpetual torment for the developers.
    It all makes sense now. They gave up not because they lost interest in their game... but because they lost their *sanity*

    • @admiraltonydawning3847
      @admiraltonydawning3847 3 роки тому +37

      You lost sanity? Too bad! Gib update naow!

    • @Ultra289
      @Ultra289 2 роки тому +4

      Its actually both interest and sanity

    • @veto_5762
      @veto_5762 Рік тому +7

      What an unscalable codebase does to a man...

    • @TheJjcczz
      @TheJjcczz Рік тому +14

      Some former Valve employees explained it basically comes down to the team at valve being small and having too many projects. Everyone wants to work on games but they’re all too busy with other projects

    • @iamnothale
      @iamnothale 5 місяців тому

      @@TheJjcczz Wasn’t this discussed in “The Final Hours of Half-Life: Alyx”?

  • @commenter_HIMIK-MAN
    @commenter_HIMIK-MAN 4 роки тому +6885

    YandereDev: I write the most overcomplicated code for the simpliest of functions.
    TF2 Team: Check this out. *T E A M P A I N T S*

    • @tearex_8443
      @tearex_8443 4 роки тому +502

      Fuck yandere dev for real though..

    • @ZKtheMAN
      @ZKtheMAN 4 роки тому +793

      I mean, to be fair, there isn't any more weird shit in Team Fortress 2 than I would expect to be in any other large codebase with tons of legacy history (HL2, HL, Quake). Yandere Simulator, on the other hand, is tripe with no excuses.

    • @noahprussia7622
      @noahprussia7622 4 роки тому +282

      You can learn from TF2 code at least

    • @j_eezus_christ_bro_chill
      @j_eezus_christ_bro_chill 4 роки тому +71

      Typo T *tea sipping intensifies*

    • @throwaway569
      @throwaway569 4 роки тому +165

      @@KT22672 "Now I'm just waiting for that trash game to release".. yeah about that...

  • @darkestccino5405
    @darkestccino5405 4 роки тому +534

    I am an aspiring programmer, and I am saving this in favorites for the day I can understand 100% of it.

  • @Shadowmaxim
    @Shadowmaxim 4 роки тому +384

    Me: sees a diagonal problem
    Also me: This is going to require Calculus, isn't it

    • @malumy
      @malumy 4 роки тому +18

      Maybe for projectile curves but not for a color icon

    • @drawapretzel6003
      @drawapretzel6003 3 роки тому +20

      It required calculus, when all it needed was two half image transparencies and independent color render.

  • @andershusmo5235
    @andershusmo5235 4 роки тому +123

    I've only just gotten my informatics degree, and I've already experienced the true smash-your-head-against-the-wall levels of madness that comes with programming too many times to count. It's a rollercoaster of emotions, swinging from limitless frustration over a problem that seemingly shouldn't be a problem to feeling like the smartest person in the universe when you finally figure it out. Everything in this video is incredibly relatable.

  • @scbtripwire
    @scbtripwire 3 роки тому +43

    0:22 Holy shit I can empathize with that sentiment. The lines with function calls that are or contain the word Invalidate look exactly like Win32 Control code used to refresh windows. That mechanism is now so old and patchy that it's a huge pain to learn how to get working consistantly and to implement correctly. I totally feel his pain.
    Edit: heh, the instant I unpaused, those methods were pointed out. Yep.

  • @wezerd
    @wezerd 4 роки тому +736

    Old man went to programming to avoid making a miracle build

    • @LazyJesse
      @LazyJesse 4 роки тому +45

      Ah, I see you are a man of culture aswell.

    • @Humanoidmp
      @Humanoidmp 4 роки тому +58

      But the true miracle build was the friends we made all along...

    • @flatterswhite
      @flatterswhite 4 роки тому +6

      the old man voice is called Will I believe

    • @notsogrand2837
      @notsogrand2837 4 роки тому +2

      He can't run away forever

    • @trackernivrig
      @trackernivrig 4 роки тому +2

      I’m assuming this is for Dark Souls, can I get a link?

  • @yvan2218
    @yvan2218 4 роки тому +2279

    Welcome to programming, where you either get it right the first time or chug enough energy drinks to have a stroke, have at most 2 hours of sleep a day, have 50 mental breakdowns in 50 minutes, pray to god even if youre an atheist, cry and laugh at the same time, until you get it almost right and then you notice the missing semicolon 400 lines before. So now you have to fix or delete everything youve just did for the past 5 hours.

    • @DukeJukem
      @DukeJukem 4 роки тому +415

      And if you DO get it right the first time, you'll be so paranoid thinking it's secretly breaking something that you end up breaking it

    • @sharcc2511
      @sharcc2511 4 роки тому +326

      Dont forget the point where you completely lose it and give up after toiling for 46 hours straight, and then come back to it in a day and realise its a single fucking spelling mistake and the code is actually fine.

    • @The2Coolest2
      @The2Coolest2 4 роки тому +46

      Yeah that's like 1st year freshman level thoughts. Lmao

    • @paperbag592
      @paperbag592 4 роки тому +77

      Try using Git, it lets you save past versions of your code that you can go back to instead of manually trying to delete everything you've written for the past 5 hours.
      Also, if you're stuck on a problem for a long time, take a break or get some sleep and it will be easier to solve the problem once you get back to it.

    • @rapier992
      @rapier992 4 роки тому +13

      The good ol' git reset --hard && git clean -fd :/

  • @Sha.ll0w
    @Sha.ll0w 4 роки тому +200

    Not gonna lie the last part was so well explained I almost fell asleep until I saw the angry engineer

    • @stev_.
      @stev_. 4 роки тому +5

      the **exact** same thing happened to me just now lol

    • @VashdaCrash
      @VashdaCrash 4 роки тому +16

      Well explained means boring? That doesn't sound right

    • @literallyglados
      @literallyglados 4 роки тому +15

      you cannot sleep now there are monsters nearby

  • @Sercil00
    @Sercil00 3 роки тому +32

    I can relate to that team colored part so well. You can do it the simple way and be done with it in a few minutes. Or you can do it a different way that would be so much cooler. Then you fiddle around with it for the rest of the day and start thinking that there's probably a far easier way to do it, but you just can't see it. Then it becomes so complex, you get embarassed for it, and you know it'll be a nightmare to rework this in 5 years when they decide to add something (like a third color). So you make the code more flexible to accomodate this, on the off chance it's ever needed.
    And then it's a tiny detail most people either don't notice or think nothing of, and whoever has to read and understand your code in the future is going to hate you.

    • @xGOKOPx
      @xGOKOPx Рік тому

      Hardcoding it for two colors would be trivial though

    • @ne0nmancer
      @ne0nmancer Рік тому +4

      @@xGOKOPx Yeah, but he was trying to make it scalable, for some reason

  • @qorso
    @qorso 4 роки тому +43

    remember kids. always comment your code so that way it can be used to mark your relentless suffering

  • @SoulPriest
    @SoulPriest 4 роки тому +382

    I really like the effort you put into graphics, the animations are really nice to watch

    • @XeZrunner
      @XeZrunner 4 роки тому +7

      I must compliment the animations too! They're very awesome!

    • @benjaminoechsli1941
      @benjaminoechsli1941 3 роки тому

      I wonder how much coding went into designing them. 😏

  • @BreadMan434
    @BreadMan434 4 роки тому +501

    "What's so terrible about this game that we barely get any coded material, maps, or weapon updates?"
    Valve TF2 Spaghetti untanglers in the lab: *"DRACONIC SCREAMS OF ETERNAL RAGE, LOSS, AND AGONY"*

  • @korvo9936
    @korvo9936 4 роки тому +411

    I wish the very best for the programers at VALVe
    their code comments doesn't seen well...

    • @zachsz9320
      @zachsz9320 4 роки тому +22

      Don't worry it's like that for most programmers, in my experience i have always written raging comments to cool down when struggling with a bug or with a fonction and my friends and colleagues seemed to do it too x)

    • @assumingctrl
      @assumingctrl 4 роки тому +4

      @@zachsz9320 Not sure where you work, but I have never seen any comments like this in a codebase, at least not ones that are committed to a repo. It's very unprofessional.

    • @Kuroganekisaki
      @Kuroganekisaki 4 роки тому +4

      @@assumingctrl they're usually not pushed to development, of course. Unless you forget to revert them

    • @fortnight5677
      @fortnight5677 Рік тому +1

      @@assumingctrl These are internal messages not meant for public and the only reason we can see them here is because of a leak.

    • @ravenID429
      @ravenID429 7 місяців тому

      @@assumingctrl🙄

  • @ArnoldsKtm
    @ArnoldsKtm 4 роки тому +55

    While the icon's code was over-engineered, it was an amazing accomplishment nonetheless.

  • @roytheidiot4844
    @roytheidiot4844 4 роки тому +723

    Recently, a file was discovered in TF2 called “coconut.jpg” which is a jpg of a coconut, a comment as follows “//I have no fucking idea who put this here, but when I deleted it, the game wouldn’t start. Words cannot describe my fucking confusion”
    That can’t be a good sign.
    EDIT: THIS COMMENT IS NOT TRUE!

    • @MrHat.
      @MrHat. 4 роки тому +94

      All hail the mighty coconut!

    • @roytheidiot4844
      @roytheidiot4844 4 роки тому +36

      Mr. Hat More like, all hail Source Spaghetti

    • @oz_jones
      @oz_jones 3 роки тому +24

      You put the -lime- game in the coconut?

    • @floater7082
      @floater7082 3 роки тому +80

      Thats actually fucking hilarious. I can't stop laughing right now.

    • @boy-Eugene
      @boy-Eugene 3 роки тому +86

      So basically TF2 runs on coconuts *intense wheezing*

  • @MrNotSpecified01
    @MrNotSpecified01 4 роки тому +428

    Lol that paint splat code is insane. I wonder how much time was saved by doing that instead of just manualy coloring a paint splat image with paint bucket and adding it to the splat images source folder whenever an item that needed it was added.

    • @JacobKinsley
      @JacobKinsley 4 роки тому +155

      Maybe they didn't know how to use image editing software and the art department smells like coffee and graphite and the big baby Yoda poster on the wall creeps you out so you'd rather just brute force it

    • @CATASTEROID934
      @CATASTEROID934 4 роки тому +89

      Maybe they said that repeatedly and possibly even offered to do that themselves but were given excuses about scalability and stuff and eventually capitulated and used a comically over-complex vector math procedure to generate the image on the fly

    • @JacobKinsley
      @JacobKinsley 4 роки тому +10

      Or an icon for "top left of splat" and "bottom right of splat" and place them in the same spot and colour them like normal

    • @kitfagan2027
      @kitfagan2027 4 роки тому +29

      It sounds insane until you get to having 3 or 4 different colour on a paint splatter or the time spent sending requests between departments. An interesting XKCD that is a good guide in general for how much time you should spend automating a task is here. xkcd.com/1205/

    • @ghosty918
      @ghosty918 4 роки тому +8

      That would be a massively more wasteful solution. Longer code means its harder to understand later or update, more art images means more space on every single install, slightly longer download times, and in general sucks.
      The solution to use two icons together sounds good, I thought of it myself, but might run into issues depending on how the code for displaying the icons works (the color is simply applying onto the paint splatter, the splatter works identically to every other icon). There may be a centering function, or some other issue with putting two icons in the same icon spot.

  • @angwydud
    @angwydud 4 роки тому +67

    dude i like how the last guy went thru with making a very hard code just for the paint icons and then got mad at it lmao also hes a GENIUS that paint icon code is worth weeks of mindbending pain

    • @benjaminoechsli1941
      @benjaminoechsli1941 3 роки тому +26

      That whole "overengineering" segment just _reeks_ of "this spaghetti code is so unstable, I am going to guarantee *one* thing won't break if they had another team for some godforsaken reason."

    • @angwydud
      @angwydud 3 роки тому +5

      @@benjaminoechsli1941 very VERY true

  • @M.J44
    @M.J44 4 роки тому +1305

    The sheer amount of code just to make a damn paint splatter color split at 60 degrees.
    This game is in DESPERATE need of a cleanup.
    Edit: I am stunned at how many of you think my take was bad. Emberassing replies below this.

    • @sznio
      @sznio 4 роки тому +50

      not 45deg but 60.
      It would be simpler working in pixel space, not uv space, you could just iterate from column 0 to n, then use the column number divided by n to get how much of the column should be one color, and how much should be the other. This gives a 45deg cut, but since it's just a linear function, code in some offsets and multiplications to get whatever degree cut you want. This approach could also get easily parallelized (and run in a shader).

    • @rideorhitchhike3347
      @rideorhitchhike3347 4 роки тому +27

      Honestly, the only thing they had to do was to load a 3-dimensional vector array with X and Y vertices specifying points of a diagonal and the Z vertex specifying the color offset, and then they could pass the paint colors as a Nx1 texture, and then the fragment shader could calculate which pixel in the colors texture to multiply the white paint texture with. It would have been extremely simple, then, to just generate as many triangles as required. That code could probably be shrunk 4 times. I hope that programmer really doesn't write UI code again.

    • @lopidav
      @lopidav 4 роки тому +94

      It's something like 20 lines. It's not much and it scales to a number of colors.
      Try to accomplish this task with less code.

    • @M.J44
      @M.J44 4 роки тому +32

      @@lopidav It's so unnecessary though. Valve isn't going to add more teams to this game, and a unique asset would've got the job done so much better.

    • @M.J44
      @M.J44 4 роки тому +6

      @crazywayne I was going to dispute your statement, but seeing the sheer state of TF2's code...yikes

  • @patiencebear
    @patiencebear Рік тому +31

    I'm programming since I'm 14. I started when Internet wasn't a given, and 10 year old books on C programming were the standard. I'm now in my 15th year as professional programmer.
    I witnessed how the times changed, how teaching how to code changed and this is one of the best videos explaining code I've ever seen.
    You did an astounding good job of visualizing. Really good!

  • @TomEyeTheSFMguy
    @TomEyeTheSFMguy 4 роки тому +292

    Is it weird that I want to learn C++, despite seeing the pain these people had to go through to make TF2?

    • @lychy645
      @lychy645 4 роки тому +16

      C++ is great 😅

    • @gianni50725
      @gianni50725 3 роки тому +48

      Making TF2 and learning C++ are very different things lol.
      Not that I would recommend spending a lot of time learning C++ though. Takes years and years to master and this mastery is only useful if you need it for a job (which becomes less and less likely as the years go on, unless you work in systems programming or something).

    • @TomEyeTheSFMguy
      @TomEyeTheSFMguy 3 роки тому +5

      @@gianni50725 so in other words, yes it is weird?

    • @gianni50725
      @gianni50725 3 роки тому +31

      @@TomEyeTheSFMguy Yeah it's weird, but there's little relation between what this video showcases and C++. They would go through similar pains with any language.

    • @TomEyeTheSFMguy
      @TomEyeTheSFMguy 3 роки тому +1

      @@gianni50725 ok then.

  • @Nobody432_YT
    @Nobody432_YT 4 роки тому +132

    I’ve only messed with hammer and sfm. I’m too scared to do anything else.

    • @Wilsonbism
      @Wilsonbism 4 роки тому +12

      Hammer just gives and takes my will to live.

    • @ahmed4363
      @ahmed4363 4 роки тому +10

      @@Wilsonbism me: I want to make a good map
      Also me after seeing the hammer editor: guess not

    • @AlPootis
      @AlPootis 3 роки тому +2

      I can't make maps or sfms, but atleast I can make particle effects!

    • @MANTHELEXUS
      @MANTHELEXUS 3 роки тому

      Dimerson Hammer giveth, Hammer taketh away

  • @metalimposter
    @metalimposter 4 роки тому +635

    I always wanted to work at valve but it seems like it doesn’t look worth it

    • @capnomonkeys8876
      @capnomonkeys8876 4 роки тому +206

      just dont ask for diagonal paint

    • @TheGraySeed
      @TheGraySeed 4 роки тому +228

      Well, you can just not work on TF2...
      Alright, now i understand why we never got an update.

    • @ckorp666
      @ckorp666 4 роки тому +158

      a lot of former employees have essentially said they were the original "hey noone's your boss here, friend! we're a big ol family :) there's just a gaggle of petty senior employees who look over ur shoulder, constantly hound your metrics, and have the power to get u fired if they dont like u. better start looking busy!" tech company

    • @proteinflakes4688
      @proteinflakes4688 4 роки тому +112

      tbh its probably better than working in rockstar and ND due to the allegations of treating their employees like shit

    • @AJAredstone
      @AJAredstone 4 роки тому +96

      Valve has a notably horizontal organization structure. Employees have massive amounts of freedom regarding what they want to work on.

  • @WolfCoder
    @WolfCoder 4 роки тому +104

    3:35 its 0xFFFFFFFF because that's -1, a value commonly used to represent an error value to be distinct from null for handle ID values (a general practice in programming, not just for the source engine code)

    • @koacado
      @koacado 4 роки тому +19

      exactly. I was wondering how did he manage to get that one wrong

    • @dendude2922
      @dendude2922 4 роки тому +4

      Oh yeah, it big brain time.

    • @MisterL2_yt
      @MisterL2_yt 2 роки тому +4

      oh, so it's a signed integer (and not an unsigned integer) like he claims?

    • @kleniiii
      @kleniiii Рік тому +3

      > a general practice in programming
      And the worst one. At least create a constant variable to be able to give it a name that explains what it is. Better yet, create an inline function following DRY.

    • @anon1963
      @anon1963 Рік тому +1

      @@kleniiii why inline if it's a long function, or a member function?

  • @oicmorez4129
    @oicmorez4129 3 роки тому +26

    I have to say, the "overengineered code" is actually briliant. The effect is elegant.
    Think about it - How much code is made in such a way that it supports new features (like more team colors) possibly being added?

  • @azazellon
    @azazellon 4 роки тому +20

    Knowing these comments are actually in the code make me happy
    Letting out frustrations where nobody but other coders can see

  • @forlackofawetterbird
    @forlackofawetterbird 4 роки тому +235

    me watching this having never learned c++, but knowing some java and python:
    this looks somewhat familiar

    • @j4n1x19
      @j4n1x19 4 роки тому +20

      I mean java uses c style syntax, so yeah...

    • @kiraangle2823
      @kiraangle2823 4 роки тому +4

      Dialectical differences. I know a little of and cplusplus and its all the same.

    • @smort123
      @smort123 4 роки тому +19

      Me seeing curly brackets in code after learning about python:
      "This is utterly fucking retarded."

    • @MonsterhunterFTWWTF
      @MonsterhunterFTWWTF 4 роки тому +2

      @@smort123 This why you learn C or C++ first so everything else seems familiar or easier (Python).

    • @fleefie
      @fleefie 4 роки тому +4

      @@smort123 tbh the lack of brackets in python is more painful to me...
      also indent-sensitive syntax. Just why

  • @theowlman2418
    @theowlman2418 4 роки тому +156

    Me: *knows basic HTML5*
    Also me: Yes very entertaining.

    • @JacobKinsley
      @JacobKinsley 4 роки тому +10

      Amateur. I know how to program in HTTP

    • @fr33kSh0w2012
      @fr33kSh0w2012 4 роки тому +5

      @@JacobKinsley You're all a bunch of amateur's I have a friend that knows how to program in machine code AND Binary code! yeah 0's and 1's BITCHES!

    • @sol2544
      @sol2544 4 роки тому +7

      Amateurs, I can solder flip flop logic gates and counter logic gates with nand gates to create rudimentary read-only memory in extremely tiny amounts

    • @chappie3642
      @chappie3642 4 роки тому +4

      @@sol2544 amateur, my computer is an abacus and I program it using transferring of energy trought gravity

    • @antonioazulamarillo7579
      @antonioazulamarillo7579 4 роки тому +3

      AMATEURS. I want to die :'D

  • @ParrotParrot
    @ParrotParrot 4 роки тому +846

    Imagine being mad about overengineering your code lmao
    Hurts just a little bit

    • @lordadamson
      @lordadamson 4 роки тому +3

      Why does it hurt?

    • @ДимитърИванов-е5ъ
      @ДимитърИванов-е5ъ 4 роки тому +143

      @@lordadamson because the guy spent a lot of time making something that looks so simple and possibly there is simpler solution

    • @DinnerForkTongue
      @DinnerForkTongue 4 роки тому +89

      @@lordadamson
      Imagine assembling a cutting and stretching machine to skin a cat, while knowing someone out there only needs a 5cm neck knife.

    • @ghoulbuster1
      @ghoulbuster1 4 роки тому +7

      German engineering.

    • @CoolGuy-sv6kn
      @CoolGuy-sv6kn 4 роки тому +16

      I honestly wouldn't be surprised if some of the code for this was written before some of the current team was alive

  • @jeremydixon1586
    @jeremydixon1586 2 роки тому +25

    Actually, with respect to what happened with the team colour paint graphic, the devs WERE planning on adding a third team into the game - tanDark - but, just as team 3 was going to be released, Gabe himself burst into the room in a blind rage and subsequently fired all people involved. Nobody in the office speaks of this event to this very day.

  • @grqfes
    @grqfes 3 роки тому +31

    i never played tf2 but this video inspired me to download it. if they spent so much time on a cut for an icon for something that will probably not ever even be used then it deserves to be on my pc

  • @venusianbasil
    @venusianbasil 4 роки тому +40

    the programmers sanity “checked out” that is a genius thumbnail

  • @a_blind_sniper
    @a_blind_sniper 4 роки тому +28

    I think this is the best followup video I've seen. You explained everything so well, and i definitely learned some stuff. Thank you for this!

  • @rafaelbordoni516
    @rafaelbordoni516 4 роки тому +6

    That last one I felt in my heart because I am the stupid designer that asked for that angle and the poor programmer that had to make it, at the same time. There is so much work put into small details that probably no one will ever notice... It changed the way I view video games.

  • @alexkozliayev9902
    @alexkozliayev9902 4 роки тому +79

    Lmao, people in comments saying how insane this is, but it's just everyday job if you working on any game.
    That colored icons is not even _that_ over-engineered.

    • @hanger3415
      @hanger3415 3 роки тому +1

      It seems like too much work and boring if you are constantly angry and worried.

  • @jesseking1403
    @jesseking1403 4 роки тому +84

    I already have great difficulty struggling to even grasp how to program, so with the angry foot notes from programmers from Valve, a company known for very well programmed games, I know now that I'm not the only one having a hard time. Hope the programmers are doing well, and I hope they're safe during these difficult times.

    • @q6969
      @q6969 3 роки тому +13

      Well made, yeah.
      Well programmed? Absolutely not

    • @armoredman10
      @armoredman10 3 роки тому +3

      They’re dead

    • @ahmed4363
      @ahmed4363 3 роки тому +4

      They didn't give up on tf2 because of losing interest
      They only lost their sanity

    • @crunchy_crop
      @crunchy_crop 3 роки тому

      Aren't all games programmed games lol

    • @ahmed4363
      @ahmed4363 3 роки тому +1

      @@crunchy_crop they mean well programmed games
      But not really when you actually look at the source engine

  • @fictionhead39
    @fictionhead39 4 роки тому +51

    This really gives you some perspective on how much goes into programming games... all that work just for a tiny paint icon...

  • @BreadMan434
    @BreadMan434 4 роки тому +24

    *Me, who's about to enter a University course involving advanced levels of digital security programming*
    "haha, I'm in danger..."

  • @Qira
    @Qira 4 роки тому +12

    Thats why Valve doesn't want to make a Heavy Update...
    It tears through the coder's mentality.

  • @TheUmopepisdn
    @TheUmopepisdn 4 роки тому +10

    2:15 Based on the anger level in the comment, I doubt they just found a better way.
    What probably really happened is they wrote code referring to this function, it didn't work, they spent AGES tracking down why it didn't work. Once they traced it to this (broken, possibly since forever), they rewrote the code and left an angry comment and moved on, instead of deleting the (now-unreferenced) function

  • @Jake_Ro_X
    @Jake_Ro_X 4 роки тому +89

    Yes, this causes a memory leak. T O O B A D! 🤣

    • @astroboy512
      @astroboy512 3 роки тому +2

      Actually we need another memory leak...

  • @TKsh1
    @TKsh1 4 роки тому +125

    I only know the very basics of C++ and somehow it hurts so bad to see those comments.

    • @blarpo7385
      @blarpo7385 4 роки тому +10

      yeah, im a cpp newbie too, and this shit looks fucked.

    • @marcoconsorti2663
      @marcoconsorti2663 4 роки тому +3

      IMO It's very relatable even at low levels

    • @AizakkuZ
      @AizakkuZ 4 роки тому

      Ye im decent at Lua and i can definitely feel the pain

  • @kerbonaut2059
    @kerbonaut2059 4 роки тому +211

    Hey, does anyone know where I can get a copy of the source code for myself? I'd like to read it myself and figure out a few things.

    • @SethTooQuick
      @SethTooQuick 4 роки тому +80

      @@AdrenResi @Dabbing Krbonaut
      This is from a code leak a few weeks back involving the source code for both TF2 and Counter-Strike: Global Offensive from 2018. If you can find it you found it. Distributing it is illegal. Downloading anything from these leaks can also be unsafe depending on where you get them.

    • @farterboy
      @farterboy 4 роки тому +23

      @@SethTooQuick I torrented the files from the og leak and everything seems fine.

    • @SethTooQuick
      @SethTooQuick 4 роки тому +15

      @@farterboy Cool. Doesn't mean the files weren't tampered with to get control of your shit. Just be safe with them aka don't run or build anything.

    • @Cat_Stevens
      @Cat_Stevens 4 роки тому +4

      search for "random leaked shit", the file is called "April 22nd 2020, random leaked shit.rar", you can find mirrors on anonfile and mega NZ

    • @moritamikamikara3879
      @moritamikamikara3879 4 роки тому

      @@SethTooQuick If you find anything, bring it straight to me. DO NOT BUILD IT.
      -Blutarch mann.

  • @gunk9629
    @gunk9629 4 роки тому +16

    You never realize how much code goes into something as simple as paint just for our convinience

    • @E_D___
      @E_D___ 4 місяці тому

      Oh no, the dev was angry at himself for making that because it was stupid and a waste of time.
      They could have just made a new icon - he thought that he could code it fast and easy, so no reason to bother - he understood what he got himself into to late, as he ended up putting so much time and effort on this code and couldn't let himself give up now.
      And after he finished it, he took a moment to look at his creation.
      "Wow, that dumb. Wtf am I doing. I shouldn't be doing this shit. Fk this waste of time bullcrap I don't want to touch those things ever again"

  • @SeresHotes25
    @SeresHotes25 Рік тому +10

    I like how he wrote "penis" at 1:30 and nobody noticed it

  • @thrdrshd7308
    @thrdrshd7308 4 роки тому +26

    The programmers must overheat more than my pc does launching this game. The game works great, I hope they're doing fine.

    • @ilikewindows3455
      @ilikewindows3455 4 роки тому +1

      Wait what? What temp does your cpu reach up to when starting it?

  • @GoldTheAngel
    @GoldTheAngel 4 роки тому +18

    Me: Has only basic programming knowledge from 10th Grade Computer Science
    Also me: Interesting...

  • @theanothermysteryoso4222
    @theanothermysteryoso4222 4 роки тому +40

    This guaranteed changing my perspective in morals if I or someone even asking for a "Heavy Update" so badly, I feel bad now. I understand the frustration.
    EDIT: Let us please stop asking for new updates, I almost felt sympathetic to them.

  • @WhaleMilk
    @WhaleMilk 4 роки тому +1

    I respect anybody that uses the dustforce ost in the background of a video.

  • @seba2366
    @seba2366 4 роки тому +6

    This is how actually programing feels
    The best part of programing is seeing your work done, is so satisfacing

  • @korbi3449
    @korbi3449 4 роки тому +21

    I really love that ");" at 6:31, it fits so hard.

    • @MailMainbutnot
      @MailMainbutnot 2 роки тому +2

      while it is just using a semi-colon for the end of a line of code in c#, it really does

  • @IBeforeAExceptAfterK
    @IBeforeAExceptAfterK 4 роки тому +4

    This reminds me a lot of how I wrote my code when I took my first computer graphics class: only a vague idea of what the preexisting functions I'm calling do, often no idea of why they only work when I call them in a specific way, and a general reluctance to mess with any working code I've already written for fear of breaking something else that relies on it. Except here the problem is 14 years worth of patches (or more if we take the history of the Source engine into account) instead of a dumb college student writing code without a plan. And just like with me, the smart solution would probably be to rewrite everything from scratch, while incorporating all the added functionality from the updates into the base design.

  • @tezza48
    @tezza48 4 роки тому +10

    The `InvalidateLayout` method's not being called twice, it's 2 methods being called on 2 objects. From what i can tell it's forcing all components in both objects to be dirty so they get redrawn.

  • @BudderBoyz
    @BudderBoyz 4 роки тому +1

    The code of tf2 is a vessel for the frustration of the programmers

  • @Memerath
    @Memerath Рік тому +12

    “Yes, this causes a memory leak. Too bad!” radiates such an incredible energy I love it

  • @furinick
    @furinick 4 роки тому +7

    The fact that this leak helped some people learn rather the cause chaos is just incredible, and goes against e n t r o p y itself

  • @DEWILL
    @DEWILL 4 роки тому +5

    I love the sheer quality and dedication you poured into this video. You deserves a like for sure.

  • @Kreiser_VII
    @Kreiser_VII 4 роки тому +7

    Every time I open a video looking for an interesting funny, I feel closer to the day I know how to actually code something

  • @JFirecracker
    @JFirecracker 2 роки тому +4

    My question with the paint splat is why they didn't just go with the vertical split for two-tone paints; then write code to just rotate the image by 45 degrees. Could add some UI distinction to two-tones with the rotation being different from monotone paints, which would draw a player's eye practically inherently.

    • @nocturn333
      @nocturn333 Рік тому

      I guess they didn't want 2 tone paints to look different. A bigger problem is that rotated images doesn't look as good, especially at a small scale. Try rotating a minecraft texture by even a couple degrees and see how it looks.

  • @fullsetsunk4090
    @fullsetsunk4090 Рік тому +5

    "My hope is that this code is so awful i'm never allowed to write UI code again" lmao

  • @immumbgaming3193
    @immumbgaming3193 4 роки тому +44

    Soooo...
    Any frustrated chat in those localization files?

  • @katerinakatykat
    @katerinakatykat 3 роки тому +4

    "the safest way to write code"
    **rust would like to know your location**

  • @one_smol_duck
    @one_smol_duck 4 роки тому +7

    1:40
    Me in css, before giving up and throwing exclamation points everywhere

  • @jordanbradford7729
    @jordanbradford7729 3 роки тому +2

    That last example with the two-tone icon can be done with CSS in a web browser trivially easily*. So I really feel for game UI developers whenever they have to reinvent layout and presentation stuff that browser rendering engines have been doing for years.
    * I’d make an image that’s partly transparent in the paint splatter part of it, and then style it with an angled linear gradient background that doesn’t blend the two colors. It could also be done entirely inside an SVG, and those can be programmatically altered if they’re inlined into the DOM.

  • @Mrs.THECOMMUNISTCHANNEL
    @Mrs.THECOMMUNISTCHANNEL 2 роки тому +4

    Me: Programmer, are you sure this will work?
    Programmer: haha, *I HAVE NO IDEA*

  • @Supervhizor
    @Supervhizor 4 роки тому +7

    3:43 that's actually checking if the function returns -1 which is a commonly used return code for something not existing. Idk why they didn't just use -1

    • @ausintune9014
      @ausintune9014 4 роки тому

      Unsigned int..

    • @Supervhizor
      @Supervhizor 4 роки тому +1

      @@ausintune9014 yes I know the difference. However, we can't see the return type of the GetRenderThreadID() function. It could be returning an int. In Linux, pthread_t is an unsigned long, however the literal in the code is only 32 bits wide, so it's not a long. Regardless of everything I said, because types can be arbitrarily cast and reinterpreted in C (by casting pointer types), the return type doesn't even matter because the only thing you can be sure of is that 32 bits are being put in the %rax register and they could have been reinterpreted in any way at any point in time during execution. A lot of beginner programmers don't understand that C this isn't like Java or other strictly-typed languages, it's a whole other beast. My explanation is a whole lot more likely that the video creator's arbitrary guess that it's verifying the system didn't create 4 billion threads.

    • @E_D___
      @E_D___ 4 місяці тому

      I assume they tried to use -1, and for some reason it didn't work for them and they couldn't figure out why.
      Till someone just threw things on it in anger till it started to work

  • @Louis.7493
    @Louis.7493 6 місяців тому +4

    right, "save tf2"
    nobody in valve wants to even try fix this huge mess.

  • @Tingorilla
    @Tingorilla 4 роки тому +9

    "I can't code her to come back😔"

  • @LividImp
    @LividImp 4 роки тому +2

    As a former programmer, this was both maddening and cathartic at the same time. It is nice to see I was not the only one being driven insane by other people's code.

  • @press8704
    @press8704 4 роки тому +2

    This stuff is so awesomely fascinating! I’d honestly watch 100 more videos about tf2’s code. Thank you so much for making this!!