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
@rbarua33684 жыл бұрын
Thanks
@liminal1114 жыл бұрын
Hell yeah, good luck in future videos!
@smb_64youtube54 жыл бұрын
So no more code memes like this will be maded.... To Bad!
@The-64th-Gamer4 жыл бұрын
Good luck with things! Excited to learn more about how TF2 was coded from the source leak
@twelvethousandths16984 жыл бұрын
I think you make the most interesting and entertaining tf2 videos. It's different, and that's Great!
@grandwizardautismo4 жыл бұрын
I will never look at my team spirit painted items the same again
@stardustriver4 жыл бұрын
wow
@wojtekpolska10134 жыл бұрын
Just think about how much pain went into making of these. Too bad!
@9frames5904 жыл бұрын
Same.
@Timeward764 жыл бұрын
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.
@noskalborg7234 жыл бұрын
@@Timeward76 fluffing their hours much? Sheesh. JUST DRAW IT!
@mrhomard6094 жыл бұрын
"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_isc4 жыл бұрын
🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣😅😅 im ded
@lanague68904 жыл бұрын
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.
@manasmahanand7324 жыл бұрын
@@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).
@averagegeek39574 жыл бұрын
Did you make up the quote or is it a real one? I tried googling but I wasn't able to find anything.
@mrhomard6094 жыл бұрын
@@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
@Speederzzz3 жыл бұрын
"This code supports an infinite amount of colours!" "Our game is based around two colours fighting"
@SirDavid2903 жыл бұрын
TF2 classic : Hold on a minute !
@JonatasAdoM3 жыл бұрын
Got to think about rainbow skins these days.
@grandmagunsales21253 жыл бұрын
And then there were 4 colors fighting
@Tekdruid2 жыл бұрын
Thing is, it's about as hard to account for 2 as it is for (n+1) instead of 1.
@RabbitKiwi2 жыл бұрын
@@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
@LordJoey9994 жыл бұрын
I use to code once, I now work with animals. Everything is now nice.
@damiengates75814 жыл бұрын
lmao, funny
@antonioazulamarillo75794 жыл бұрын
Ha ha ha. I laugh
@maerosss4 жыл бұрын
Exactly. Currently creating websites. Hopefully will not go nuts before I find a better, manual job in nature or something :D
@mr.d00m374 жыл бұрын
same
@AlPootis4 жыл бұрын
I wanna do some nature related jobs to when I'm old enough. I'd also like to learn good pixel painting and programming!
@marinenukem4 жыл бұрын
To the programmer who went above and beyond with designing the team spirit paint icon, I salute you.
@Aoredon Жыл бұрын
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 Жыл бұрын
@@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
@RubenKelevra11 ай бұрын
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.
@dabqu11 ай бұрын
everyone's GPU is slightly hotter because of this, bad design tbh
@Idiomatick11 ай бұрын
@@RubenKelevra there is definitely some built in graphics handling functions to do this without any custom math
@TheDisarminghinkle4 жыл бұрын
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.
@michealmcdoesntexist49704 жыл бұрын
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
@AGrayPhantom4 жыл бұрын
Unfortunately the "leaked" code was old, is useless, and has been out for ages.
@genroynoisis69804 жыл бұрын
@Mialisus ...yeah, like an added "nice" or "lmao" makes it better.
@rafaelmorales19264 жыл бұрын
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
@TheDisarminghinkle4 жыл бұрын
@@rafaelmorales1926 I like Murphy's Updated Law.
@gore43324 жыл бұрын
For that last one about the color icons... I do NOT blame whoever was angry at how over complex that code is lol
@Jenner_IIC4 жыл бұрын
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.
@googleforcedhandle4 жыл бұрын
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.85954 жыл бұрын
All because the vertical line didn't look good enough.
@scoutiano44414 жыл бұрын
That's like trying to get rid of an ant colony by using a fucking rocket launcher
@darthgiorgi49904 жыл бұрын
@@scoutiano4441 well, in that case that would be in true TF2 spirit.
@kelpocereal50774 жыл бұрын
Imagine the amount of angry text over the localization files
@lordjaraxxus54184 жыл бұрын
//why are we still here? just to suffer?
@thetrashmann81404 жыл бұрын
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.
@masterthg31374 жыл бұрын
Lord Jaraxxus // Too Bad!
@Orbitthemaster4 жыл бұрын
Imagine the amount of angry text over the PS3 port... xD
@tezcanaslan28774 жыл бұрын
JC Little That port wasn’t made by Valve
@ScTiger13114 жыл бұрын
I love that line "Yes this causes a memory leak. Too bad!"
@FortuneHunters3 жыл бұрын
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).
@popcultureprogrammer21712 жыл бұрын
I will probably use this in my projects when I'm lazy/have hit a wall
@31redorange08 Жыл бұрын
Wouldn't have happened with Java.
@fiskfisk33 Жыл бұрын
@@31redorange08 of all the languages you can choose between, you choose an interpretted one for this use case?!
@31redorange08 Жыл бұрын
@@fiskfisk33 It's debatable whether Java is interpreted or not. But what's your point?
@sharpfang4 жыл бұрын
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).
@eggbun4 жыл бұрын
What a deal
@Slash0mega3 жыл бұрын
3 minutes of graphic design work.... Unless they change somthing
@sharpfang3 жыл бұрын
@@Slash0mega In which case it's 4 minutes. Maybe even 5 or 6!
@VeaceslavMunteanu3 жыл бұрын
If you load everything from textures, you'll hurt both the performance and greatly increase the size of the game
@sharpfang3 жыл бұрын
@@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.
@Beanibirb4 жыл бұрын
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
@aqsem90734 жыл бұрын
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_tube24 жыл бұрын
My brain hurts
@rabbitdrink4 жыл бұрын
frustrated comments like these is part of the process lol
@The2Coolest24 жыл бұрын
Not hilarious, pretty sad
@dashdashdash_4 жыл бұрын
@@the_tube2 Atleast they wrap their methods
@GabrielShitposting4 жыл бұрын
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.
@tisaconundrum4 жыл бұрын
Unless...
@ahmed43634 жыл бұрын
@@tisaconundrum new game mode possibly but not likely
@sternowl23454 жыл бұрын
Its not for supporting more teams, its for supporting the general case of having items with more than 2 color options.
@JustAthel4 жыл бұрын
TF2Classic be like:
@alexstewart95924 жыл бұрын
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.
@normalguy7294 жыл бұрын
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?
@Patchess4 жыл бұрын
They're all dead.
@SleepySkull14 жыл бұрын
THE DEVS ARE DEAD?!
@MrHat20204 жыл бұрын
YES! *Slams table* THEY DIED!!!
@เจ๊ะอัมนะห์เจะยิ4 жыл бұрын
Too bad!
@flyingfloorboard40974 жыл бұрын
Damnit boys!
@DynaDere4 жыл бұрын
Me: *Calmly clicking through the menu's* Haha that team color paint looks good. Game Code: *Screams of agony*
@@duetopersonalreasonsaaaaaa There is this one vitamin that you get by taking sun. im afraid you lack it.
@grod59983 жыл бұрын
@@duetopersonalreasonsaaaaaa There's a door down the hall, it's called the "front door" I suggest you use it
@Omlet2214 жыл бұрын
8:10 “the angle is prettier” I think coders have one of the most important jobs because look they’re even graphic designers now
@QuintaFeira124 жыл бұрын
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.
@Omlet2214 жыл бұрын
@@QuintaFeira12 oh yeah nvm you’re probably right
@rampageblizzard3 жыл бұрын
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.celine93033 жыл бұрын
@@rampageblizzard The whole point of this is to have neither designers nor engineers have to work on this. Hence they automated it.
@rampageblizzard3 жыл бұрын
@@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.
@meflea36754 жыл бұрын
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.
@firebug72084 жыл бұрын
Yandere Dev should be enough of an example
@june18844 жыл бұрын
Firebug nice
@gimmforwho_4 жыл бұрын
@@firebug7208 else if ()
@oi_bruv4 жыл бұрын
Yanderedev would be a great introduction to switch and how to use it
@sharpfang4 жыл бұрын
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.
@Misuune4 жыл бұрын
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.
@dumbleking51724 жыл бұрын
// _insert_ *MANIAC SPYPER SCREAM*
@Timeward764 жыл бұрын
The code for that diagonal line must've required a lot of hugs to get through.
@CS-om3kj4 жыл бұрын
Ralof Are ya codin’ son?
@shirubaurufu4 жыл бұрын
@@Timeward76 I hope I also get huggs when I eventually have to deal with things like that
@stiky59724 жыл бұрын
PROFFESIONALS HAVE
@arandomday35304 жыл бұрын
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.
@papercotton4 жыл бұрын
i wonder how he made them. probably premiere?
@_Wombat4 жыл бұрын
I second this notion. It makes the video a lot more approachable
@501ststormtrooper94 жыл бұрын
Unlike the math at school as well.
@sasdagreat80524 жыл бұрын
"Clean", "colourful", and "fun to look at" does not describe your profile picture, however. What is that abomination?
@pierreo334 жыл бұрын
@@sasdagreat8052 Sanic
@trbz_87454 жыл бұрын
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.
@brownspottedcat3 жыл бұрын
@Inna Sits Mods.
@womp63382 жыл бұрын
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.
@nuclearpugg2 жыл бұрын
@@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
@grqfes2 жыл бұрын
@@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
@Jws202 жыл бұрын
@@grqfes green and yellow in TFC and TF 1
@GothAlice4 жыл бұрын
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.
@wilburdemitel84684 жыл бұрын
cool story bro
@Bloodlyshiva3 жыл бұрын
One man's treasure/clever is another man's Satan. Also sometimes just humour.
@Kreze2023 жыл бұрын
Behind a cleverly written code is a set of programmers not understanding a single line
@josephvictory95363 жыл бұрын
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.
@NoTraceOfSense3 жыл бұрын
@@wilburdemitel8468 someone’s clearly never written code
@MrPatters4 жыл бұрын
4:22 I've never seen TF2 with motion blur, this is insane
@NeoDerikik4 жыл бұрын
@@user-no3tu9kh3p it looks vomit-inducing
@ungamer62414 жыл бұрын
@@user-no3tu9kh3p bruh no one said your playing on vr
@scarymonsters5244 жыл бұрын
These are edited values. Default is nothing like this.
@ezrac7044 жыл бұрын
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.
@ungamer62414 жыл бұрын
@@ezrac704 same
@diegodankquixote-wry32424 жыл бұрын
This makes the comments even funnier than before
@kannatheweeb88364 жыл бұрын
xD
@sulphurous26564 жыл бұрын
Especially with the team spirit sprite.
@dumbleking51724 жыл бұрын
Funny
@diegodankquixote-wry32424 жыл бұрын
@@dumbleking5172 I corrected myself in the correct way. "This makes the comments funny" doesn't imply the correct intent. Get ogre whelmed.
@drifterduckygaming46464 жыл бұрын
Yeos
@commenter_HIMIK-MAN4 жыл бұрын
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_84434 жыл бұрын
Fuck yandere dev for real though..
@ZKtheMAN4 жыл бұрын
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.
@noahprussia76224 жыл бұрын
You can learn from TF2 code at least
@j_eezus_christ_bro_chill4 жыл бұрын
Typo T *tea sipping intensifies*
@throwaway5694 жыл бұрын
@@KT22672 "Now I'm just waiting for that trash game to release".. yeah about that...
@HistoMagouri4 жыл бұрын
0:33 "all the code in this function looks pretty normal" Famous last words before a programming disaster!
@thelunaticcultist51572 жыл бұрын
As a hobbiest programmer, this is far too true
@QuintaFeira124 жыл бұрын
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.
@jupitersky4 жыл бұрын
"Hillariously overengineered" Literally all my code. No wonder I never get anything done.
@manasmahanand7323 жыл бұрын
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.
@YeetZmeN3 жыл бұрын
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.
@zrspangle2 жыл бұрын
@@manasmahanand732 that one week definitely was amazing practice for you, though.
@manasmahanand7322 жыл бұрын
@@zrspangle yes definitely. But I shouldn't do those experiments on client websites. I just wasted their time
@Roxor1284 ай бұрын
@@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.
@johnjordan35524 жыл бұрын
So that's why I get 3 FPS when opening my backpack in-game
@chicken86643 жыл бұрын
Bold of you to assume that FPS would be allowed to drop to 3 in TF2
@Danimations20153 жыл бұрын
@@chicken8664 gotta get 2 fps instead
@TomitaGregorias3 жыл бұрын
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.
@drugjoza50003 жыл бұрын
@@TomitaGregorias Same happens to me! It's brain melting
@thesauce16823 жыл бұрын
@@TomitaGregorias lmao, the agony when you hear scout screaming on loop because you change settings.
@spineck54994 жыл бұрын
im just gonna act like i understand everything by nodding and saying "yes" every 6 seconds
@etlttc3534 жыл бұрын
I kinda understand but im not an actual programmer yet so...
@chance95124 жыл бұрын
Be sure to add a "hmmm" every once in a while, so you look like you're really thinking about it.
@TheInnerEvil4 жыл бұрын
Yes, interesting.
@kriss123boys54 жыл бұрын
r/meirl
@francescogirardello92504 жыл бұрын
Exactly like in school
@8Delian84 жыл бұрын
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*
@admiraltonydawning38473 жыл бұрын
You lost sanity? Too bad! Gib update naow!
@Ultra2892 жыл бұрын
Its actually both interest and sanity
@veto_5762 Жыл бұрын
What an unscalable codebase does to a man...
@TheJjcczz Жыл бұрын
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
@iamnothale5 ай бұрын
@@TheJjcczz Wasn’t this discussed in “The Final Hours of Half-Life: Alyx”?
@aaronspencermusic4 жыл бұрын
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 Жыл бұрын
in a project large enough, you can’t dodge scuffed bullshit
@aaronspencermusic Жыл бұрын
@@orestisgeorgatos6725 Yeah so in the time since writing that I became a software developer professionally and you're right :D
@epicfun2 Жыл бұрын
@@aaronspencermusic Glad I came back to this video to see that, it put a smile on my face. Congrats!
@lazerpie10111 ай бұрын
The only wrong way is the way that doesn't work.
@anstorner7 ай бұрын
There may be ways to optimize code, but that multiplies however time it took to create to just work at all by square probably.
@darkestccino54054 жыл бұрын
I am an aspiring programmer, and I am saving this in favorites for the day I can understand 100% of it.
@karlbischof28074 жыл бұрын
same
@PunzL4 жыл бұрын
Good luck!
@stavastava96224 жыл бұрын
Godspeed
@ibrahimshaikh67284 жыл бұрын
C++ with its multithreading code might give you seizures :(
@scoutiano44414 жыл бұрын
spoiler alert: you won't.
@yvan22184 жыл бұрын
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.
@DukeJukem4 жыл бұрын
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
@sharcc25114 жыл бұрын
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.
@The2Coolest24 жыл бұрын
Yeah that's like 1st year freshman level thoughts. Lmao
@paperbag5924 жыл бұрын
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.
@rapier9924 жыл бұрын
The good ol' git reset --hard && git clean -fd :/
@RemiScutlet4 жыл бұрын
Is asking them to update the game considered torture? I feel bad now
@KingLich4514 жыл бұрын
yep... That's why they're dead
@noahmay77084 жыл бұрын
@@KingLich451 oh no... You killed Valve!
@KingLich4514 жыл бұрын
@@noahmay7708 oh crab
@NotLordAsshat4 жыл бұрын
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
@marshallemmet13664 жыл бұрын
they should just sit back and work on cleaning up the code first before making another content update.
@andershusmo52354 жыл бұрын
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.
@scbtripwire3 жыл бұрын
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.
@wezerd4 жыл бұрын
Old man went to programming to avoid making a miracle build
@LazyJesse4 жыл бұрын
Ah, I see you are a man of culture aswell.
@Humanoidmp4 жыл бұрын
But the true miracle build was the friends we made all along...
@flatterswhite4 жыл бұрын
the old man voice is called Will I believe
@notsogrand28374 жыл бұрын
He can't run away forever
@trackernivrig4 жыл бұрын
I’m assuming this is for Dark Souls, can I get a link?
@Shadowmaxim4 жыл бұрын
Me: sees a diagonal problem Also me: This is going to require Calculus, isn't it
@malumy4 жыл бұрын
Maybe for projectile curves but not for a color icon
@drawapretzel60033 жыл бұрын
It required calculus, when all it needed was two half image transparencies and independent color render.
@Sha.ll0w4 жыл бұрын
Not gonna lie the last part was so well explained I almost fell asleep until I saw the angry engineer
@stev_.4 жыл бұрын
the **exact** same thing happened to me just now lol
@VashdaCrash4 жыл бұрын
Well explained means boring? That doesn't sound right
@literallyglados4 жыл бұрын
you cannot sleep now there are monsters nearby
@patiencebear Жыл бұрын
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!
@roytheidiot48444 жыл бұрын
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.4 жыл бұрын
All hail the mighty coconut!
@roytheidiot48444 жыл бұрын
Mr. Hat More like, all hail Source Spaghetti
@oz_jones3 жыл бұрын
You put the -lime- game in the coconut?
@floater70823 жыл бұрын
Thats actually fucking hilarious. I can't stop laughing right now.
@boy-Eugene3 жыл бұрын
So basically TF2 runs on coconuts *intense wheezing*
@M.J444 жыл бұрын
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.
@sznio4 жыл бұрын
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).
@rideorhitchhike33474 жыл бұрын
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.
@lopidav4 жыл бұрын
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.J444 жыл бұрын
@@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.J444 жыл бұрын
@crazywayne I was going to dispute your statement, but seeing the sheer state of TF2's code...yikes
@SoulPriest4 жыл бұрын
I really like the effort you put into graphics, the animations are really nice to watch
@XeZrunner4 жыл бұрын
I must compliment the animations too! They're very awesome!
@benjaminoechsli19413 жыл бұрын
I wonder how much coding went into designing them. 😏
@korvo99364 жыл бұрын
I wish the very best for the programers at VALVe their code comments doesn't seen well...
@zachsz93204 жыл бұрын
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)
@assumingctrl4 жыл бұрын
@@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.
@Kuroganekisaki4 жыл бұрын
@@assumingctrl they're usually not pushed to development, of course. Unless you forget to revert them
@fortnight5677 Жыл бұрын
@@assumingctrl These are internal messages not meant for public and the only reason we can see them here is because of a leak.
@ravenID4297 ай бұрын
@@assumingctrl🙄
@qorso4 жыл бұрын
remember kids. always comment your code so that way it can be used to mark your relentless suffering
@Sercil003 жыл бұрын
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 Жыл бұрын
Hardcoding it for two colors would be trivial though
@ne0nmancer Жыл бұрын
@@xGOKOPx Yeah, but he was trying to make it scalable, for some reason
@BreadMan4344 жыл бұрын
"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"*
@MrNotSpecified014 жыл бұрын
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.
@JacobKinsley4 жыл бұрын
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
@CATASTEROID9344 жыл бұрын
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
@JacobKinsley4 жыл бұрын
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
@kitfagan20274 жыл бұрын
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/
@ghosty9184 жыл бұрын
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.
@ArnoldsKtm4 жыл бұрын
While the icon's code was over-engineered, it was an amazing accomplishment nonetheless.
@TomEyeTheSFMguy4 жыл бұрын
Is it weird that I want to learn C++, despite seeing the pain these people had to go through to make TF2?
@lychy6454 жыл бұрын
C++ is great 😅
@gianni507253 жыл бұрын
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).
@TomEyeTheSFMguy3 жыл бұрын
@@gianni50725 so in other words, yes it is weird?
@gianni507253 жыл бұрын
@@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.
@TomEyeTheSFMguy3 жыл бұрын
@@gianni50725 ok then.
@angwydud4 жыл бұрын
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
@benjaminoechsli19413 жыл бұрын
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."
@angwydud3 жыл бұрын
@@benjaminoechsli1941 very VERY true
@Nobody432_YT4 жыл бұрын
I’ve only messed with hammer and sfm. I’m too scared to do anything else.
@Wilsonbism4 жыл бұрын
Hammer just gives and takes my will to live.
@ahmed43634 жыл бұрын
@@Wilsonbism me: I want to make a good map Also me after seeing the hammer editor: guess not
@AlPootis3 жыл бұрын
I can't make maps or sfms, but atleast I can make particle effects!
@MANTHELEXUS3 жыл бұрын
Dimerson Hammer giveth, Hammer taketh away
@theowlman24184 жыл бұрын
Me: *knows basic HTML5* Also me: Yes very entertaining.
@JacobKinsley4 жыл бұрын
Amateur. I know how to program in HTTP
@fr33kSh0w20124 жыл бұрын
@@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!
@sol25444 жыл бұрын
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
@chappie36424 жыл бұрын
@@sol2544 amateur, my computer is an abacus and I program it using transferring of energy trought gravity
@antonioazulamarillo75794 жыл бұрын
AMATEURS. I want to die :'D
@grqfes3 жыл бұрын
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
@azazellon4 жыл бұрын
Knowing these comments are actually in the code make me happy Letting out frustrations where nobody but other coders can see
@metalimposter4 жыл бұрын
I always wanted to work at valve but it seems like it doesn’t look worth it
@capnomonkeys88764 жыл бұрын
just dont ask for diagonal paint
@TheGraySeed4 жыл бұрын
Well, you can just not work on TF2... Alright, now i understand why we never got an update.
@ckorp6664 жыл бұрын
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
@proteinflakes46884 жыл бұрын
tbh its probably better than working in rockstar and ND due to the allegations of treating their employees like shit
@AJAredstone4 жыл бұрын
Valve has a notably horizontal organization structure. Employees have massive amounts of freedom regarding what they want to work on.
@forlackofawetterbird4 жыл бұрын
me watching this having never learned c++, but knowing some java and python: this looks somewhat familiar
@j4n1x194 жыл бұрын
I mean java uses c style syntax, so yeah...
@kiraangle28234 жыл бұрын
Dialectical differences. I know a little of and cplusplus and its all the same.
@smort1234 жыл бұрын
Me seeing curly brackets in code after learning about python: "This is utterly fucking retarded."
@MonsterhunterFTWWTF4 жыл бұрын
@@smort123 This why you learn C or C++ first so everything else seems familiar or easier (Python).
@fleefie4 жыл бұрын
@@smort123 tbh the lack of brackets in python is more painful to me... also indent-sensitive syntax. Just why
@WolfCoder4 жыл бұрын
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)
@koacado4 жыл бұрын
exactly. I was wondering how did he manage to get that one wrong
@dendude29224 жыл бұрын
Oh yeah, it big brain time.
@MisterL2_yt2 жыл бұрын
oh, so it's a signed integer (and not an unsigned integer) like he claims?
@kleniiii Жыл бұрын
> 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 Жыл бұрын
@@kleniiii why inline if it's a long function, or a member function?
@oicmorez41293 жыл бұрын
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?
@TheUmopepisdn4 жыл бұрын
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
@jesseking14034 жыл бұрын
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.
@q69693 жыл бұрын
Well made, yeah. Well programmed? Absolutely not
@armoredman103 жыл бұрын
They’re dead
@ahmed43633 жыл бұрын
They didn't give up on tf2 because of losing interest They only lost their sanity
@crunchy_crop3 жыл бұрын
Aren't all games programmed games lol
@ahmed43633 жыл бұрын
@@crunchy_crop they mean well programmed games But not really when you actually look at the source engine
@venusianbasil4 жыл бұрын
the programmers sanity “checked out” that is a genius thumbnail
@fictionhead394 жыл бұрын
This really gives you some perspective on how much goes into programming games... all that work just for a tiny paint icon...
@alexkozliayev99024 жыл бұрын
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.
@hanger34153 жыл бұрын
It seems like too much work and boring if you are constantly angry and worried.
@Qira4 жыл бұрын
Thats why Valve doesn't want to make a Heavy Update... It tears through the coder's mentality.
@a_blind_sniper4 жыл бұрын
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!
@ParrotParrot4 жыл бұрын
Imagine being mad about overengineering your code lmao Hurts just a little bit
@lordadamson4 жыл бұрын
Why does it hurt?
@ДимитърИванов-е5ъ4 жыл бұрын
@@lordadamson because the guy spent a lot of time making something that looks so simple and possibly there is simpler solution
@DinnerForkTongue4 жыл бұрын
@@lordadamson Imagine assembling a cutting and stretching machine to skin a cat, while knowing someone out there only needs a 5cm neck knife.
@ghoulbuster14 жыл бұрын
German engineering.
@CoolGuy-sv6kn4 жыл бұрын
I honestly wouldn't be surprised if some of the code for this was written before some of the current team was alive
@Jake_Ro_X4 жыл бұрын
Yes, this causes a memory leak. T O O B A D! 🤣
@astroboy5123 жыл бұрын
Actually we need another memory leak...
@theanothermysteryoso42224 жыл бұрын
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.
@SirCheeseEater4 жыл бұрын
Them? You mean the log they left over in place of them?
@blckmesa89783 жыл бұрын
"almost"
@gunk96294 жыл бұрын
You never realize how much code goes into something as simple as paint just for our convinience
@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"
@BreadMan4344 жыл бұрын
*Me, who's about to enter a University course involving advanced levels of digital security programming* "haha, I'm in danger..."
@TKsh14 жыл бұрын
I only know the very basics of C++ and somehow it hurts so bad to see those comments.
@blarpo73854 жыл бұрын
yeah, im a cpp newbie too, and this shit looks fucked.
@marcoconsorti26634 жыл бұрын
IMO It's very relatable even at low levels
@AizakkuZ4 жыл бұрын
Ye im decent at Lua and i can definitely feel the pain
@thrdrshd73084 жыл бұрын
The programmers must overheat more than my pc does launching this game. The game works great, I hope they're doing fine.
@ilikewindows34554 жыл бұрын
Wait what? What temp does your cpu reach up to when starting it?
@rafaelbordoni5164 жыл бұрын
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.
@jeremydixon15862 жыл бұрын
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.
@mr_pigman1013 Жыл бұрын
As a real gabe, I can confirm
@korbi34494 жыл бұрын
I really love that ");" at 6:31, it fits so hard.
@MailMainbutnot2 жыл бұрын
while it is just using a semi-colon for the end of a line of code in c#, it really does
@GoldTheAngel4 жыл бұрын
Me: Has only basic programming knowledge from 10th Grade Computer Science Also me: Interesting...
@SeresHotes25 Жыл бұрын
I like how he wrote "penis" at 1:30 and nobody noticed it
@IBeforeAExceptAfterK4 жыл бұрын
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.
@seba23664 жыл бұрын
This is how actually programing feels The best part of programing is seeing your work done, is so satisfacing
@furinick4 жыл бұрын
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
@tf3confirmedbuthv544 жыл бұрын
Valve developers when Gaben asks them to write one line of code 1:51
@Tingorilla4 жыл бұрын
"I can't code her to come back😔"
@fullsetsunk4090 Жыл бұрын
"My hope is that this code is so awful i'm never allowed to write UI code again" lmao
@WhaleMilk4 жыл бұрын
I respect anybody that uses the dustforce ost in the background of a video.
@Kreiser_VII4 жыл бұрын
Every time I open a video looking for an interesting funny, I feel closer to the day I know how to actually code something
@one_smol_duck4 жыл бұрын
1:40 Me in css, before giving up and throwing exclamation points everywhere
@Supervhizor4 жыл бұрын
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
@ausintune90144 жыл бұрын
Unsigned int..
@Supervhizor4 жыл бұрын
@@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___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
@jordanbradford77293 жыл бұрын
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.THECOMMUNISTCHANNEL2 жыл бұрын
Me: Programmer, are you sure this will work? Programmer: haha, *I HAVE NO IDEA*
@DEWILL4 жыл бұрын
I love the sheer quality and dedication you poured into this video. You deserves a like for sure.
@hashgulso_osu3 жыл бұрын
Found you! :)
@Memerath Жыл бұрын
“Yes, this causes a memory leak. Too bad!” radiates such an incredible energy I love it
@JFirecracker2 жыл бұрын
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 Жыл бұрын
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.
@press87044 жыл бұрын
This stuff is so awesomely fascinating! I’d honestly watch 100 more videos about tf2’s code. Thank you so much for making this!!
@katerinakatykat3 жыл бұрын
"the safest way to write code" **rust would like to know your location**
@tezza484 жыл бұрын
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.
@violetwtf4 жыл бұрын
YESS THANK YOU I BEGGED YOU FOR THIS ON TWITTER!!
@Louis.74936 ай бұрын
right, "save tf2" nobody in valve wants to even try fix this huge mess.
@BlumChoi4 жыл бұрын
My KZbin app crashed while I was watching this. I find this ironic.
@BeatCrazey4 жыл бұрын
Damn, that last part was awesome. Definately a testament to how much work had to be done just for a tiny stupid detail in the game. Honestly, if I were them, instead of having one texture for everything, I'd make one texture for single color and two others split in half for team colors.
@RenShinomiya1213 жыл бұрын
filesize though. It's better to render stuff in a certain hex color than inserting numerous amounts of color sprite that could take up lots of space. 1kb strings are better than 25+ 100kb color sprites.
@BeatCrazey3 жыл бұрын
@@RenShinomiya121 I know. It would use the Source Engine's "color tint" system to paint the assets. In total, there would be only 3 assets.
@LordTrashcanRulez Жыл бұрын
@@RenShinomiya121 You still have to consider time spent on something. I'm sure that .5 more megabytes for a simple feature is worth the countless hours that would've been spent here. Besides, you could've just wrote the color change as a code so the only real asset you'd need is the "colourless" sprite