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
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.
"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
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.
@@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 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
@@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
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.
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.
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.
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.
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).
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).
@@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.
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.
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
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
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.
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"
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.
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.
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.
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.
@@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
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.
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.
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.
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.
@@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.
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.
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.
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
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*
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
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.
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.
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.
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.
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.
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.
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.
"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"*
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)
@@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.
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!
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.
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
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
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/
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.
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
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."
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.
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).
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.
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!
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 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.
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
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)
> 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.
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?
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.
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
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.
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.
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.
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
@@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.
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"
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.
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.
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.
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.
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.
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.
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 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.
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
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.
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
Thanks
Hell yeah, good luck in future videos!
So no more code memes like this will be maded.... To Bad!
Good luck with things! Excited to learn more about how TF2 was coded from the source leak
I think you make the most interesting and entertaining tf2 videos.
It's different, and that's Great!
I will never look at my team spirit painted items the same again
wow
Just think about how much pain went into making of these. Too bad!
Same.
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.
@@Timeward76 fluffing their hours much?
Sheesh. JUST DRAW IT!
"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
🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣😅😅 im ded
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.
@@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).
Did you make up the quote or is it a real one? I tried googling but I wasn't able to find anything.
@@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
"This code supports an infinite amount of colours!"
"Our game is based around two colours fighting"
TF2 classic : Hold on a minute !
Got to think about rainbow skins these days.
And then there were 4 colors fighting
Thing is, it's about as hard to account for 2 as it is for (n+1) instead of 1.
@@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
I use to code once, I now work with animals. Everything is now nice.
lmao, funny
Ha ha ha. I laugh
Exactly. Currently creating websites. Hopefully will not go nuts before I find a better, manual job in nature or something :D
same
I wanna do some nature related jobs to when I'm old enough.
I'd also like to learn good pixel painting and programming!
To the programmer who went above and beyond with designing the team spirit paint icon, I salute you.
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
@@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
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.
everyone's GPU is slightly hotter because of this, bad design tbh
@@RubenKelevra there is definitely some built in graphics handling functions to do this without any custom math
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.
i wonder how he made them. probably premiere?
I second this notion. It makes the video a lot more approachable
Unlike the math at school as well.
"Clean", "colourful", and "fun to look at" does not describe your profile picture, however. What is that abomination?
@@sasdagreat8052 Sanic
Imagine the amount of angry text over the localization files
//why are we still here? just to suffer?
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.
Lord Jaraxxus // Too Bad!
Imagine the amount of angry text over the PS3 port... xD
JC Little That port wasn’t made by Valve
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.
Yandere Dev should be enough of an example
Firebug nice
@@firebug7208 else if ()
Yanderedev would be a great introduction to switch and how to use it
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.
I love that line "Yes this causes a memory leak. Too bad!"
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).
I will probably use this in my projects when I'm lazy/have hit a wall
Wouldn't have happened with Java.
@@31redorange08 of all the languages you can choose between, you choose an interpretted one for this use case?!
@@fiskfisk33 It's debatable whether Java is interpreted or not. But what's your point?
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).
What a deal
3 minutes of graphic design work.... Unless they change somthing
@@Slash0mega In which case it's 4 minutes. Maybe even 5 or 6!
If you load everything from textures, you'll hurt both the performance and greatly increase the size of the game
@@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.
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.
Unless...
@@tisaconundrum new game mode possibly but not likely
Its not for supporting more teams, its for supporting the general case of having items with more than 2 color options.
TF2Classic be like:
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.
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.
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
Unfortunately the "leaked" code was old, is useless, and has been out for ages.
@Mialisus ...yeah, like an added "nice" or "lmao" makes it better.
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
@@rafaelmorales1926 I like Murphy's Updated Law.
For that last one about the color icons... I do NOT blame whoever was angry at how over complex that code is lol
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.
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"
All because the vertical line didn't look good enough.
That's like trying to get rid of an ant colony by using a fucking rocket launcher
@@scoutiano4441 well, in that case that would be in true TF2 spirit.
Me: *Calmly clicking through the menu's* Haha that team color paint looks good.
Game Code: *Screams of agony*
Is your pfp Maid!Kagero?
@@duetopersonalreasonsaaaaaa consider touching grass
@@duetopersonalreasonsaaaaaa go outside, god damn
@@duetopersonalreasonsaaaaaa There is this one vitamin that you get by taking sun. im afraid you lack it.
@@duetopersonalreasonsaaaaaa There's a door down the hall, it's called the "front door"
I suggest you use it
8:10 “the angle is prettier” I think coders have one of the most important jobs because look they’re even graphic designers now
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.
@@QuintaFeira12 oh yeah nvm you’re probably right
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.
@@rampageblizzard The whole point of this is to have neither designers nor engineers have to work on this. Hence they automated it.
@@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.
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
Well now we know why there's only at most 5-10 devs working on tf2. They all rage quit on their own code
My brain hurts
frustrated comments like these is part of the process lol
Not hilarious, pretty sad
@@the_tube2 Atleast they wrap their methods
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?
They're all dead.
THE DEVS ARE DEAD?!
YES! *Slams table* THEY DIED!!!
Too bad!
Damnit boys!
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.
// _insert_ *MANIAC SPYPER SCREAM*
The code for that diagonal line must've required a lot of hugs to get through.
Ralof Are ya codin’ son?
@@Timeward76 I hope I also get huggs when I eventually have to deal with things like that
PROFFESIONALS HAVE
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.
@Inna Sits Mods.
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.
@@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
@@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
@@grqfes green and yellow in TFC and TF 1
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.
cool story bro
One man's treasure/clever is another man's Satan. Also sometimes just humour.
Behind a cleverly written code is a set of programmers not understanding a single line
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.
@@wilburdemitel8468 someone’s clearly never written code
4:22 I've never seen TF2 with motion blur, this is insane
@@user-no3tu9kh3p it looks vomit-inducing
@@user-no3tu9kh3p bruh no one said your playing on vr
These are edited values. Default is nothing like this.
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.
@@ezrac704 same
"Hillariously overengineered"
Literally all my code.
No wonder I never get anything done.
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.
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.
@@manasmahanand732 that one week definitely was amazing practice for you, though.
@@zrspangle yes definitely. But I shouldn't do those experiments on client websites. I just wasted their time
@@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.
So that's why I get 3 FPS when opening my backpack in-game
Bold of you to assume that FPS would be allowed to drop to 3 in TF2
@@chicken8664 gotta get 2 fps instead
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.
@@TomitaGregorias Same happens to me! It's brain melting
@@TomitaGregorias lmao, the agony when you hear scout screaming on loop because you change settings.
0:33
"all the code in this function looks pretty normal"
Famous last words before a programming disaster!
As a hobbiest programmer, this is far too true
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.
This makes the comments even funnier than before
xD
Especially with the team spirit sprite.
Funny
@@dumbleking5172 I corrected myself in the correct way. "This makes the comments funny" doesn't imply the correct intent. Get ogre whelmed.
Yeos
im just gonna act like i understand everything by nodding and saying "yes" every 6 seconds
I kinda understand but im not an actual programmer yet so...
Be sure to add a "hmmm" every once in a while, so you look like you're really thinking about it.
Yes, interesting.
r/meirl
Exactly like in school
Is asking them to update the game considered torture?
I feel bad now
yep... That's why they're dead
@@KingLich451 oh no... You killed Valve!
@@noahmay7708 oh crab
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
they should just sit back and work on cleaning up the code first before making another content update.
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
in a project large enough, you can’t dodge scuffed bullshit
@@orestisgeorgatos6725 Yeah so in the time since writing that I became a software developer professionally and you're right :D
@@aaronspencermusic Glad I came back to this video to see that, it put a smile on my face. Congrats!
The only wrong way is the way that doesn't work.
There may be ways to optimize code, but that multiplies however time it took to create to just work at all by square probably.
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*
You lost sanity? Too bad! Gib update naow!
Its actually both interest and sanity
What an unscalable codebase does to a man...
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
@@TheJjcczz Wasn’t this discussed in “The Final Hours of Half-Life: Alyx”?
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*
Fuck yandere dev for real though..
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.
You can learn from TF2 code at least
Typo T *tea sipping intensifies*
@@KT22672 "Now I'm just waiting for that trash game to release".. yeah about that...
I am an aspiring programmer, and I am saving this in favorites for the day I can understand 100% of it.
same
Good luck!
Godspeed
C++ with its multithreading code might give you seizures :(
spoiler alert: you won't.
Me: sees a diagonal problem
Also me: This is going to require Calculus, isn't it
Maybe for projectile curves but not for a color icon
It required calculus, when all it needed was two half image transparencies and independent color render.
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.
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.
Old man went to programming to avoid making a miracle build
Ah, I see you are a man of culture aswell.
But the true miracle build was the friends we made all along...
the old man voice is called Will I believe
He can't run away forever
I’m assuming this is for Dark Souls, can I get a link?
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.
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
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.
Yeah that's like 1st year freshman level thoughts. Lmao
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.
The good ol' git reset --hard && git clean -fd :/
Not gonna lie the last part was so well explained I almost fell asleep until I saw the angry engineer
the **exact** same thing happened to me just now lol
Well explained means boring? That doesn't sound right
you cannot sleep now there are monsters nearby
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.
Hardcoding it for two colors would be trivial though
@@xGOKOPx Yeah, but he was trying to make it scalable, for some reason
remember kids. always comment your code so that way it can be used to mark your relentless suffering
I really like the effort you put into graphics, the animations are really nice to watch
I must compliment the animations too! They're very awesome!
I wonder how much coding went into designing them. 😏
"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"*
I wish the very best for the programers at VALVe
their code comments doesn't seen well...
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)
@@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.
@@assumingctrl they're usually not pushed to development, of course. Unless you forget to revert them
@@assumingctrl These are internal messages not meant for public and the only reason we can see them here is because of a leak.
@@assumingctrl🙄
While the icon's code was over-engineered, it was an amazing accomplishment nonetheless.
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!
All hail the mighty coconut!
Mr. Hat More like, all hail Source Spaghetti
You put the -lime- game in the coconut?
Thats actually fucking hilarious. I can't stop laughing right now.
So basically TF2 runs on coconuts *intense wheezing*
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.
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
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
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
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/
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.
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
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."
@@benjaminoechsli1941 very VERY true
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.
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).
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.
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.
@@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.
@crazywayne I was going to dispute your statement, but seeing the sheer state of TF2's code...yikes
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!
Is it weird that I want to learn C++, despite seeing the pain these people had to go through to make TF2?
C++ is great 😅
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).
@@gianni50725 so in other words, yes it is weird?
@@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.
@@gianni50725 ok then.
I’ve only messed with hammer and sfm. I’m too scared to do anything else.
Hammer just gives and takes my will to live.
@@Wilsonbism me: I want to make a good map
Also me after seeing the hammer editor: guess not
I can't make maps or sfms, but atleast I can make particle effects!
Dimerson Hammer giveth, Hammer taketh away
I always wanted to work at valve but it seems like it doesn’t look worth it
just dont ask for diagonal paint
Well, you can just not work on TF2...
Alright, now i understand why we never got an update.
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
tbh its probably better than working in rockstar and ND due to the allegations of treating their employees like shit
Valve has a notably horizontal organization structure. Employees have massive amounts of freedom regarding what they want to work on.
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)
exactly. I was wondering how did he manage to get that one wrong
Oh yeah, it big brain time.
oh, so it's a signed integer (and not an unsigned integer) like he claims?
> 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.
@@kleniiii why inline if it's a long function, or a member function?
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?
Knowing these comments are actually in the code make me happy
Letting out frustrations where nobody but other coders can see
me watching this having never learned c++, but knowing some java and python:
this looks somewhat familiar
I mean java uses c style syntax, so yeah...
Dialectical differences. I know a little of and cplusplus and its all the same.
Me seeing curly brackets in code after learning about python:
"This is utterly fucking retarded."
@@smort123 This why you learn C or C++ first so everything else seems familiar or easier (Python).
@@smort123 tbh the lack of brackets in python is more painful to me...
also indent-sensitive syntax. Just why
Me: *knows basic HTML5*
Also me: Yes very entertaining.
Amateur. I know how to program in HTTP
@@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!
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
@@sol2544 amateur, my computer is an abacus and I program it using transferring of energy trought gravity
AMATEURS. I want to die :'D
Imagine being mad about overengineering your code lmao
Hurts just a little bit
Why does it hurt?
@@lordadamson because the guy spent a lot of time making something that looks so simple and possibly there is simpler solution
@@lordadamson
Imagine assembling a cutting and stretching machine to skin a cat, while knowing someone out there only needs a 5cm neck knife.
German engineering.
I honestly wouldn't be surprised if some of the code for this was written before some of the current team was alive
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.
As a real gabe, I can confirm
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
the programmers sanity “checked out” that is a genius thumbnail
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!
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.
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.
It seems like too much work and boring if you are constantly angry and worried.
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.
Well made, yeah.
Well programmed? Absolutely not
They’re dead
They didn't give up on tf2 because of losing interest
They only lost their sanity
Aren't all games programmed games lol
@@crunchy_crop they mean well programmed games
But not really when you actually look at the source engine
This really gives you some perspective on how much goes into programming games... all that work just for a tiny paint icon...
*Me, who's about to enter a University course involving advanced levels of digital security programming*
"haha, I'm in danger..."
Thats why Valve doesn't want to make a Heavy Update...
It tears through the coder's mentality.
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
Yes, this causes a memory leak. T O O B A D! 🤣
Actually we need another memory leak...
I only know the very basics of C++ and somehow it hurts so bad to see those comments.
yeah, im a cpp newbie too, and this shit looks fucked.
IMO It's very relatable even at low levels
Ye im decent at Lua and i can definitely feel the pain
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.
@@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.
@@SethTooQuick I torrented the files from the og leak and everything seems fine.
@@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.
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
@@SethTooQuick If you find anything, bring it straight to me. DO NOT BUILD IT.
-Blutarch mann.
You never realize how much code goes into something as simple as paint just for our convinience
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"
I like how he wrote "penis" at 1:30 and nobody noticed it
The programmers must overheat more than my pc does launching this game. The game works great, I hope they're doing fine.
Wait what? What temp does your cpu reach up to when starting it?
Me: Has only basic programming knowledge from 10th Grade Computer Science
Also me: Interesting...
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.
Them? You mean the log they left over in place of them?
"almost"
I respect anybody that uses the dustforce ost in the background of a video.
This is how actually programing feels
The best part of programing is seeing your work done, is so satisfacing
I really love that ");" at 6:31, it fits so hard.
while it is just using a semi-colon for the end of a line of code in c#, it really does
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.
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.
The code of tf2 is a vessel for the frustration of the programmers
“Yes, this causes a memory leak. Too bad!” radiates such an incredible energy I love it
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
I love the sheer quality and dedication you poured into this video. You deserves a like for sure.
Found you! :)
Every time I open a video looking for an interesting funny, I feel closer to the day I know how to actually code something
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.
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.
"My hope is that this code is so awful i'm never allowed to write UI code again" lmao
Soooo...
Any frustrated chat in those localization files?
"the safest way to write code"
**rust would like to know your location**
1:40
Me in css, before giving up and throwing exclamation points everywhere
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.
Me: Programmer, are you sure this will work?
Programmer: haha, *I HAVE NO IDEA*
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
Unsigned int..
@@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.
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
right, "save tf2"
nobody in valve wants to even try fix this huge mess.
"I can't code her to come back😔"
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.
This stuff is so awesomely fascinating! I’d honestly watch 100 more videos about tf2’s code. Thank you so much for making this!!