The Unhinged Nature of GTA V Source Code
ฝัง
- เผยแพร่เมื่อ 16 พ.ย. 2024
- Michael performs some code review at Rockstar Games.
Take-Two, pls don't sue me. ty!
--------------------------------------------------------------------------------------------
Thumbs up the video for more content :D
www.youtube.com...
"Why the fuck is this public?"
Rockstar rn
LMAO
Lol golden comment right here 😂😂
Oh snap.
the dev meant the public keyword inside the code
@@KirksCountDownsMI’m lazy and not gonna Google how many Os are in wooosh
I can’t tell if rockstars developers are more or less insane than Valve’s developers
Probably around the same amount of insanity
all developers are insane, just comes with the job
More of course.
This is just a developer thing. If I had a nickel for every time I've written some code and immediately said "this is the dumbest fucking shit I've ever made," I would be able to retire.
because we think- and often KNOW that there is a better solution out there, that we just cant comprehend rn@@PhantomTissue
"But it should never fail" - every programmer be like after making a small change
the next thing you know, there are 5 shows at once, and the game crashes
@@monad_tcp Only 5? It'd more likely be 500 shows at once somehow that runs simultaneously.
@@keatonwastaken Nah
Imagine the in-game TV actually glitching this much, because i can't 💀
Me when pushing to prod with no code review or testing
If it it works, don't touch it, or it may never work again.
1:43 TODO - this makes shit really slow but without it it will crash
As a fellow programmer, that's the most relatable thing I've read all week. God bless those poor devs at Rockstar.
Same bro all I did was use a different render step for a function and caused the game to slowly lose fps every 20 secs
I pushed a fix like this earlier today
@@blueeple I have this problem when opening map in Far Cry 5. It start with normal 60 fps, then every few second it will lose fps one by one... so maybe ubisoft devs did implement code like yours)
@@zaicol850 Plot twist: He works in Ubisoft and wrote the code.
@@zaicol850 yea but in reality I put a render step in a render step and that crashed the engine then I made two then that happened 💀
seeing "TODO" so many times in a production build that has been worked on for like 13 years truly authenticates this gem
This may be a surprise to those not working on code, but in big productions there's always something TODO, half complete features and so on. The UI might be clean, but it's always somewhat dirty in the back.
like your mom@@ericcricket4877
@@ericcricket4877 Sure, but after 13 years of updates and literal billions of dollars, you'd think they'd fix some shit. Like the longass loading times that were fixed by just some guy and not R* noticing it was being really stupid and scanning every file or code line or whatever.
@@JZStudiosonlineNot to excuse the loading times, that was a travesty. But in general: why do those TODOs matter? There is always something that can be improved. At my job, we always have a boatload of tickets with improvements that we want to do. But time is limited and you have to pick your battles. If the TODO doesn't cause a bug, and isn't necessary for a feature to work... Why bother fixing it? If a TODO has been there for 13 years and nobody has actually needed to fix it, then the fix was never necessary in the first place. The shortcut was the right solution, as obviously it got the job done and took less development effort than a "proper" solution. Only build what you need, and improve/extend as necessary.
@@JZStudiosonline Ours has run for more than 20, and occasionally i find stuff from 2004 that's still waiting for completion. These are colossal projects. You'd think that only because you don't work on it yourself.
Michael finally got the white collar gig he always wanted. I’m so proud of him
If Michael actually got a job in that Life Invader mission and continued to fix Ricky's code.
Yes, this is how I like to imagine Michael would be like if he worked at the Lifeinvader office.
I guess dressing young and hip worked
Writing a single function for this game must be the scariest fucking thing in the world.
No cap, specially considering that RAGE is a 20 years old engine with tons of legacy and undocumented code.
Writing a new function is easy and fine. The pain is changing already existing ones and that will affect other parts of the code.
what are yall saying lmao its just like coding a game there is nothing special here 🤷♂🤷♂
@@wouf_ It is dude. They are using in-house propeitery game engine. Which probably hasn't been updated in god knows how many years and pair this with the fact that new people who are also working on the game don't know the documentation of the engine properly. So yeah it's special and not in a good way. It's basically a fuck fest going on over there at the DEV studio. LMAO
@@wouf_ just a couple million of lines of code ez stuff
1:29 This one just makes sense. If all doors are blocked, we can't have the player still stuck in the car, so teleport them out.
Sleeping dogs did it better. The character breaks through the windshield.
@@Redwan777I wonder if it will be like this in GTA6?
@@Redwan777what if windshield is blocked?
That function must be left over from GTA3 I remember that exact thing happening. When your car's doors are blocked on all sides you just teleport on the roof or a short distance away near the car.
@@Barmemthen the character teleports out, seriously you have to be REALLY going out of your way to block all doors AND the windshield.
"...but it should never fail"
Famous last words
_GTAV.exe has stopped working_
"Worked on my computer."
that HR call next morning
I now need to try and get 5tvs in one place to play channels
Its actually a good bug detector. If theres a fixed reason why it should never have more than 4 shows at once, it causing a crash should highlight an oversight elsewhere.
unironically, this video is a very good lesson on how to do code comments, not to explain the code itself, but why the code exists in the first place and what to do with it, because half decent code explains itself anyways.
these people are elite developers no joke.
That approach works better for higher level programming languages, not so much at lower levels
@@TragicGFuel well for low level code (anything lower than c++) you can always just give up.
We learn from these videos that you are not supposed to explain the code in comments, but just to comment how fucked the code is
Actually, code comments are just there to complain, apologise to future developers and occasionally write a political manifesto - probably about why it's morally justifiable to kill your boss.
true
“Double work, but at the moment I dont give a shit” did i write this code ? 😂
what does double work mean in this context?
@@cracked21 "double" is a variable type in programming
EDIT: my bad it's not that kind of double actually lol
@@cracked21 I'm assuming the code is doing double the work than it needs to be, i.e. being inefficient af.
@@kristof910k But that isn't meant here. Here it means twice the work, as he is recomputing something that was computed before somewhere else, but accessing it would require more work on the developers part
@@cracked21 work, especially in game and engine dev is usually referring to the amount of cycles needed to run a specific section of code. Double the work means the computer has to do double the amount of cycles for something. They're basically saying, it could run faster, but they just don't care.
"someone gone and fucked the sun up" sounds like a line from a really lighthearted cosmic horror story
Aztec lore
I think there is more strong language in code than in the game itself
Fr
When you don't have to worry so much about the virtue signalers and narcs, it allows you to lower your defenses and be yourself
@@ValorQuestStudios Hoping GTA 6 doesn't cave to that shit
@@d1ssolv3rRockstar's whole thing is that they're offensive. If they don't do, people will be very disappointed.
@@sylverlight You never know in the 2020s haha
"I won't even begin to claim that I know what the f**k is going on here."
The veracity, the audacity
Did you read the code it was commenting on? "Unwarranted chumminess with the implementation" doesn't come near it.
@@AdrianColley I felt personally attached to this one, considering I myself have wrote something similar in the past 🤣
There's a reinterpret cast, a.k.a. a shining beacon that signifies "shit's fucked." No context needed.
You can tell the programmers are pretty tight with the writers.
@@ze_rubenator Reinterpret cast is ok, don't be brainwashed by modern C++ people.
Just because the world is full of idiots that don't know how when and why use this doesn't mean it should never be used.
That code is pretty scary though.
1:25
really love the unhinged variable name: "bPoliceDontReallyCare"
This variable is also in the GTA 3 source code from 2001. Cool to see how some things have not changed in over 20 years.
realistic coding lmao
@@Nick-kb2jc
Yep, it seems like GTAV is just GTA3 with mods
@@narrativeless404 This is the saddest attempt I've witnessed at pretending to have coding knowledge lol
@@narrativeless404 pretty much, yeah. they've probably been building on the same codebase for every new GTA. You can tell because a lot of the module names in the GTA 3 codebase start with the "C" prefix. "CVehicle", "CImagePixelType", "CBaseModelInfo", "CAssetRef", "CEntityFlags", etc. I see those same names here.
you know it's a different era when there's a reference to 9gag in the code comments
There was time when most memes online were 9gag watermarked. Website is still on but I saw barely any memes, most of it was political nonsense.
@@Cat_in_The-Box9 gag died around 2017. Since 2016 it started to crumble and I effectively gave up on it in 2018.
9gag was never alive, it was a trash bin for all the dying memes doomed to become popular
@@赴大家惡化不得好死時 copium much?
9gag was always dead only noobs were on there
"these must be aligned, keep them here to stop the compiler from bitching" as a coder that is true 😂
The amount of "shut up " comments that I wrote is unreal. It's definitely a big part of the culture of programming
Remember, the compiler is always right, linters are a different beast, but still...
"warning: undefined re-" SHUT UP
@@skillaxxx Just write your own C++ compiler that doesnt bitch about non-issues
ion get it what does that mean from compiler from bitchin
"Someone gone and fucked the sun up" sent me.
Lightning and lightning-related shaders are hard to get satisfied with, so i felt the pain
@@0x0michael sun is always a formless blob in gta games
@@ivan4087 And in most other games
@@rykehuss3435but why $265 million game still have that sun, its strange
I wonder if he was talking about the sun inside the game, or the sun in real life. My guy probably hadn't slept in 3 days and was on his 52nd cup of coffee trying to hit a big deadline.
1:32 is beautiful, as its clearly some incredibly specific and odd state an NPC got into, and they've just wrapped an if statement around it.
seems to just be basic npc state checking so they don't talk while also being thrown around and screaming
i.imgur.com/jSCFImU.png
I kinda feel bad for the NPC that got its own code to unstuck itself.
Probably Goat Simulator NPC with ragdoll
1:58 - "If this fails, we're fucked" that's the most relatable IT thing when working with the servers.
Forrealz as a sysadmin lol that’s us relying stuff to eachother lol😂
I am the only sysadmin at a company of like 300 people. And I am basically fresh out of school. This is exactly my mood every other day. Id this fails, I am fucked
@@lucariolps277 Try being the only one and self taught
"le9gagmemeface"
Yup, that's some pre-2013 code right there.
Why?
@@infiltr80r9gag was more popular then ig
God IMAGINE the commentary on the source code for the ps3 version, coding on the ps3 was a total nightmare!
That ProDG comment makes it seem like this is the PS3 source, since that was the debugger the PS3 development kits used
@@studebaKer Woah! I thought it was just a witty comment or something.
Lol PS4 version is just expanded ps3 version
@@Name-tn3md gameplay -- yes, source code -- no. PS4 uses x86 architecture, PS3 used it's own Cell architecture. It is absolutely different architecture to write the source code on.
2:10 Just in case anyone forgot that this code was written over a decade ago
after watching this i have a slightly better idea how GTA Online loading code ended up being accidentally quadratic and with a linear search through a hashmap in a hot loop
Looks like this is the code from the real game engine. IIRC the loader is a separate team altogether (not to bash them, the poor souls) and I doubt it has comments that are this helpful.
@@louroboros Didn't we, like; got the full source code?
Everything is supposed to be in there i suppose, and that stupid glitched linear search as well
Because otherwise we wouldn't be able to recompile GTAV
does anyone have a normie translation of this
@@mortal_aethr there was a write up about how a guy sped up loading time to GTA online by 70%. Turns out that when loading to GTA online, the game was doing a bunch of completely unnecessary work, and after media started reporting, rockstar finally took notice and fixed it. It was a really simple mistake that caused some people to have loading times up to 8 or 10 minutes, and it was there for most of the lifetime of the game. It's unreal that this wasn't caught earlier
@@Bravo-oo9vdNah some other guy outside R* fixed it, then R* paid him 10K
"Keep here so the compiler doesn't bitch" real as hell
I hate it. In Angular/Typescript I had to start changing all requests to "Post request" instead of put or delete just to get the red line to go away, even knowing full well it was supposed to be a put or delete request because I wrote the fucking backend API myself and tested it myself on Postman.
You can control how strict the linter is in your project - there’s certainly a way to prevent the syntax warning without changing the HTTP method of your api call.
@@TheOriginalPyroBEAST Yeah I eventually turned the linter off all together and just write like it's Javascript at this point lmao
@@TheOriginalPyroBEAST I know it's been 2 months, but I've swapped to Alpine.js and am using a router for it called pinecone router and it's so much better than Angular. Pretty similar to Angular's HTML syntax with the ng-for and ng-if in the html but it uses x-for and x-if/x-show and other things.
And it doesn't use the typescript or need any fancy compilers and linting. Just one HTML page and a bit of JS and CSS. Best front end I've ever used.
@@maximumcockage6503 I think you have an skill issue. Why Angular will force you to change your request to POST? Angular has a HTTP PUT method. You just need the proper return type for it to work.
0:32 properly emphasizes the war between artists going HAM with their creativity vs programmers having non-zero awareness about reality of implementing stuff in the actual product.
Timothy Cain, the creator of Fallout has a video on his TH-cam channel talking about this exact thing.
@@Nick-kb2jclink?
@@Clarity-808 probably from GDC?
properly emphasizes the war between artists having zero awareness about reality of implementing stuff in the actual product without going HAM with creativity vs programmers not talking to any other discipline before deciding on things that will effect the entire project. :D
@@MemoriesLPNope, Tim Cain has a personal channel.
0:39 That quote is taken directly from my project m0d-s0biet-v-Redux. You can even see it says ~gir489 after it, it is in the source code listed as project ATK-003. or Attack 3. They were using it to see how well they could defend against attackers (modders). Eventually, they just stopped using codebases as unit tests, and just implemented Arxan directly to defend against modders.
Sobeit was the og of GTA mod menus, i wish GTA 5 mod menus has spider cars function like Sobeit, it was wild trolling freeroam servers on SA-MP driving above the ceiling inside tunnels
Yup, you're right!
wait, am i missing something? i don't see any text that says ~gir489
@@b1txh Any names were cropped to remove references to specific individuals, but it was indeed in there.
@@kpjVideo ah i see, thanks! didn't mean that i don't believe anyway, just curious
This is exactly what I expected
0:12 Fun fact this number is the maximum number for 4 bytes storage or integers that's why he is checking that it didn't surpass it
Ah nice. Love interesting facts like this, thanks for sharing. I wish we could see more of the code to analyze it further.
Yes about 2.1 billion is the max for 32 bit signed integer.
They're smart because they cap the money to that number otherwise it would overflow and go back to -2.1 billion dollars and you'd end up in a massive debt ☠️
@@Nick-kb2jcWhy can’t you? The whole thing leaked.
@@lizardpeter I don’t know where to download it safely. Everytime I ask someone who claims they have it, they don’t answer. Part of the reason I low key think it’s fake. I’ve seen a bunch of people say they have it, but not a single person say the actual place they got it from.
@@Nick-kb2jc Probably a torrent site or the dark web. And yeah, you can’t be sure it’s safe. Just don’t execute anything. The raw code itself should be fine.
1:43 is about the loading intro screen
even the programmer lives in GTA V
Lmfao fr
@@narrativeless404 nothing funny, those dumbass put +50GB of useless stuff in this game, they know nothing but add some shitty models and textures for the eyes of the kids.
With 50GB, you can create another GTA 5.
*_" Why did they hire a coder that can't run an antivirus software?! "_*
*_" I guess it was the weather. "_*
LMFAO@@AJRacer522
" *_Bad luck I guess._* "
It's the economy. It's in shambles 😂
Antivirus software slow down compilation speeds drastically, even by factor of 2x. so its better to keep it disabled.
Half of this is just what a regular programmer thinking in written form. 😂
I think more programmers should just go ahead and write those down, if nothing more than hilarity for those perusing
@@scrambledmandible No
That looks like a terrible advice
Most variables and method names are just incomprehensible and all comments do is just complain about how shitty the code is
@@narrativeless404 Well I mean be reasonable about it
@@scrambledmandible This is more like : "what not to do unless bored af"
@@narrativeless404 i mean its not supposed to be EVEN seen
Wouldn’t be surprised if some of these comments date back to GTA3
I once worked on a popular music game featuring heros and guitars, which was just one in a long chain of hacks piled on to the engine of a popular skateboarding game engine year after year. Plenty of random skateboard references everywhere, but I don’t remember reading any comments.
True, I was the hero
I think I saw someone close to me say something slightly close to what you're describing, lmao
Why the fuck would a guitar 'savoir' game run on a skateboarding game engine?
@@ratgreen Because they're both just DDR for dudes?
@@ratgreenGuitar Hero was worked on by Neversoft, the same people that made the Tony Hawk Pro Skater games.
This shit is always the best out of any source code leaks
1:32 should have gone with the Bethesda approach and kept it
See the difference between Rockstar and Bethesda is that Rockstar at least attempts to fix them while Bethesda just hopes it fixes itself
@@unoriginalperson72probably a big call to make but I think rockstar probably takes bug squashing more seriously than any other studio and that's commendable. I believe they literally spend a year looking for bugs and performing polish at the end of their dev cycles now
It just works
I haven't coded a single line in my life but I can absolutely relate to the "fuck it, it works. I have no idea how or why but it does and that's good enough" phase of exhaustion at work.
Every time a game's source code leaks, I'm always excited for when one of these videos inevitably comes out
Everything sounds like something Michael would actually say
The more I watch this the more I respect engineers in general. We're walking on or in this case playing on what overworked brains built and I think they're still unsatisfied with what they built 😂
Yeah as a SWE its like this all the time lol. part of it is time crunches, part of it is your brain just didnt think of the best solution that day and then you go back months later and are like damn, i should change it but now i got this other pile of stuff to do.
Technical Debt :(
1:18 R* Legal & PR rn
1:02 “do jack shit” lmao
1:23 the variable "bPoliceDontReallyCare" is so funny to me for some reason lol
it probably is just set to true during certain missions where you can't get a wanted level. It is kinda funny that that's what they named it, lol.
honestly perfect if you know exactly what it means
better than not knowing what it means
Who would’ve thought, GTA V was coded by *the characters of GTA V* 😂
sheesh, if thats what ended up in the code imagine what the git log must look like ...
My journey through game development:
Discovering skyboxes for the first time while noclipping in Unreal 1 back in the day: "Oooh, I think I understand how this works now. That's so cool; that's like... space magic."
Learning to code for the first time: "How do people do this? How did someone figure out how to make any of this work? It's like... computer magic."
Having launched a game on Steam: "There is no magic. There is no god. There is only jank that somehow works and you don't remember why, and you're afraid to refactor it in case it stops working entirely."
i want more. i was waiting for this to come out ngl!
programming is like if a prankster tried to learn math
yes
Emphasis on “tried” - a programmer
programming is like medicine. you might think you know what you are doing but most of the time you dont.
and yes I hate doctors
when a prankster learns programming you get Cat-Mario and the I Wanna Be The Guy series among others
Art of writing efficient comments in code to help other coders
"Just fucking kill me" sums up most of my coding experience
I imagine one day, source code for reality gets leaked and we will probably see the exact same comments.
That'd explain half of the world's problems
"I don't know what the appendix does but if I delete it the humans come out deformed"
can finally see God's true thoughts when he made humans.
// quick hack so they'll kill eachother less often
// TODO remove appendix and wisdom teeth
// updated code for prefrontal cortex seems like a clusterfuck
Watching this makes me feel so much better about my coding skills so far. I do stuff and it works awesome sometimes. Then others I’m doing the same thing for hours, or two days and have no idea what is wrong or why. The life of solo development is ripe with strife.
this is the way.
Watching this makes me feel good that i didnt get into programming
Keep in mind, gta 5 was also developed on the ps3, which had the craziest hardware I've ever seen on a video game platform, which made it super efficient, but extremely batshit crazy to actually understand and work with.
The cell is still probably as powerful as most computers now a days.
But because of its bottlenecks it’s used in semi - physic uses…
@@rayojordan2838uh... No? The "cell" was just a 64 bit PowerPC chip. And they had 8 of them. Powerful for the time but also aged very fast
@@FLMKane that is why I mentioned in physics the cell processor is still being used. To us gamers it’s not used because devs don’t want to go through the process of learning different tech.
Yes our computers in today’s ages are great but not on the supercomputer level. Amds & Radeon’s, are mostly used in a commercial setting meaning its commercial use.
CERN is most processed by cell processors and other cell like chips. Which is most privately used in the science communities.
The cell has been upgraded over the years and was built faster stronger it’s just that Sony and Microsoft chose the jaguar x86 chip sets instead of going with the cell like processor.
@@rayojordan2838 I actually have experience in computational mechanics and no we no longer use 32 bit processors.
That said, I wish IBM hadn't fumbled the ball with marketing PowerPC chips. It's an incredibly good design.
@@FLMKane uhm actually it had a single powerpc core and the 8 cores were SPUs (one disabled, one for the OS)
“If this crashes we’re fucked”..
The amount of times I’ve thought this in my professional career is astounding.
The tone of the code matchs the tone of the game. Brilliant.
All game code has this tone though. There's been source code of kids games with the same swearing lol
There will be more swears in GTA 6's code comments than the campaign.
1:19 That little specific part being public in the middle of everything else looks like some one day just said "fuck it" and just made what he needed public and hope it won't break anything else 😂
Making something public wouldn't ever break something else that has already been written
@@r6scrubs126 but it means it could be used in something else on the future by attempting to change its value, breaking other things attached to those parts if they were never intended to be changed like that in the first place
Probably talking about the public attribute which violates OOP principles
Gigachad makes all public
@@r6scrubs126 Yeah it can, if they are using reflection features of the programming language to invoke a private method specifically, that code would break if you changed the signature to public.
Can't believe we've all had this shit in our GTA V copies for years! 😂😂
Like there is another world goin on under the hood 😂😂
Sorry for ruining the fun but comments are ignored by the compiler
@@Wujek_Foliarz What doesn't change the fact that comments are still there inside source code
@@michuXYZ yeah but not on the discs
@@Wujek_Foliarz Aaaaah yeah thats a fact, how do you think, how long does it take to compile a source code as huge as gta v?
@@michuXYZ depends, AAA games are split in parts so changing one thing is probably around 1-2 minutes. The whole project at once takes way longer probably
Didn’t know what was being told at first until I knew it’s devs telling other people to not fuck with the code 😂
I love videos like this. I enjoy seeing the inner workings of video games, and how dev teams communicate with each other. If it’s one thing I’ve learned, it’s that coding for a game as big as GTA is stress inducing, and some just throw code at the wall and see what sticks. If it doesn’t stick, fix it until it does.
I'm learning programming right now, and this reminds me that, on a large enough scale, all software developers are just earnest fools trying to figure out how to make this shit work at the end of the day in a way that make the Muggles go "wowwwwwwwww" without exploding the sun. Or, in Rockstar dev terms, "gone and fucked the sun up."
Muggles? Didn’t know this was HP
especially game development, where you can't just the print the result of something in a console to see if everything worked correctly.
i think every proffesional is potrayed as more calm and collective than they really are, every human is winging it through life
nah these guys aren’t earnest fools lmao. If anything the content of this leak indicates just how intelligent rockstar devs are. Writing C++ this heavily optimized in a work environment like rockstars is extremely challenging, it causes hiccups like the code that is commented in this video but all in all there’s really no comparing beginning programmers to people this proficient in C++
To be honest this isn't even that bad, certainly not as bad as TF2 source code comments. Like I've had way worse comments in my own code comments lol.
cue coconut.jpg
@@zaremol2779that comment doesn’t appear anywhere in the source code and you can disprove that the coconut image does not keep the game stable by just deleting your textures directory and the game runs perfectly fine, just without any textures
@@zaremol2779
TODO - this feel like shit
I've done unspeakable things as well. One time for my capstone project we had to make an S3 client in rust to upload a html report generated from some data (we were doing a data science thing for a mining company). Damn client couldn't work and we were getting back errors from localstack which was an aws emulator we were using. It was literally the night before the project was due so we just said fuck it, and made the app execute terminal commands to use the aws cli to upload the damn file.
1:23 PoliceDontReallyCare
The code is very human
Rockstar office culture hasn't changed since 2004. San Andreas object names were swear. Actually, whole game code could be swear on gta san andreas.
it has absolutely changed since 2013, the political climate doesnt allow for their early 2000's "culture" anymore.
@@ٴۥٴٴٴ you a snowflake
@@ٴۥٴٴٴ Yeah, but nobody cares about what they write into the source code
And if Rockstar would bend under the political bs, they are DEAD to us
Rockstar used to organize parties and trips to the strip club between devs
Lmao@@kwiky5643
1:26 "bPoliceDontReallyCare" makes me wonder if this is for missions
Goofy method names and variable names are the best
@@BGTech1It's not that easy to find a new variable name on a project that big... If you take a name too simple, you are at risk that something conflic at some point, that a name too long and it became annoying to type and difficult to read...
Edit: You have some cool videos on your channel 😁
It’s for the wanted system. This variable is also in the GTA 3 source code from 2001.
I was thinking the same thing. Maybe for those type of missions that have 5+ stars for extra tension, but the game engine isn't actually spawning any extra cops + any cops around are less aggressive than usual, for the sole purpose of letting you complete the mission.
@@pierrotAI mean, encapsulation ?
i like when devs leave notes like these in their code
"Someone gone and fucked the sun up"
0:18 I bet this code is still better written than whole Yandere Simulator code.
0:55 is the funniest
This leak was truly a blessing.
It’s almost like these devs are apart of the universe they are creating 😂
as a coder I really felt the public one
Why?
@@TheTransitmtl usually objects have a public interface, where outside code uses the object's methods to make the object do stuff, but the object also has some private internal state or data, which can only be changed according to some rules that only the object itself knows about, so outside code shouldn't modify it directly. This is called encapsulation. If this state is made public, then the outside code can freely modify it and it's very likely that something will break because the state will change at times when we don't expect it to, or to the values we don't expect, and it won't necessarily be easy to spot. State that is supposed to be private leaks and it's very easy to make some stupid mistake
@@Bravo-oo9vd By objects, I think you meant classes with public:, protected: & private: components. An object is merely an instance of the class.
@@Spyro-kt8gy By object i meant an instance of a class, with live data tied to that object, but yeah it applies to static methods and fields as well
Brother just check if it compiles after you change it to private. ffs
As expected from a game as complex in nature as gta
nah bro this is all just bad code. Seems like there's not enough separation of engine and game
@@addmix i dont know what is inside (not game dev), but if game core is ok, but some missions and mechanics are full of crutches and hacks - its a good code base where you can onboard and progress pretty fast, but in some projects you will need to find dev, who wrote that shit and ask how it works.
@@БеловБорис-у4щ I don't know if i'm speaking nonsense, but the way Online works in GTA 5 seems to be alot of hacky stuff, bunch of tricks and lots of googling involved, the server being client sided somehow (which explains why modders can easily alter whatever the heck can happen in the session), the many different buttons just to do stuff, like sometimes at some missions, the game asks you to press E, or F, or Q to interect with mission objectives, it feels like the thing is scripted differently on each DLC rather than importing from a base of another code, or the vehicles special ability, there is always 3 inconsistent buttons, sometimes boost is E or X, missiles / machine gun is space or mouse click, or jump ability / vtol is either G or H.
@@БеловБорис-у4щ not really, bad code may work without flaws but as soon as a minor change has to be done, lots of the code has to be re-written
@@FilippoCalipp0 I meant that if core code (api for missions, core mecanics etc) works fine its not a seriouse problem to overwrite a few thousands of crappy code for some feature. Fast development before release could bring more value than costs extra week of development years later.
Ned Luke's AI voice fit this so perfectly I can't even😭
I am pretty sure they code with cigarette in mouth and cursing after each puff
1:18
> Why the fuck is this public
- Rockstar, 2023
yeah like releasing stupid source code even lead to something. never lead tp creation of any game
It was probably written in 2013 not 2023
@@Anti_Septikumno the joke is that it was leaked in 2023, as in why is the code public
All of that wasn't very bad. These types of problems always exist in projects as large as GTA V, doubly so when they have a specific release schedule and take several years to make.
Level indices starting at 1 instead of 0 is a real crime though
Unhinged? This is normal programmer behavior
maybe, in prison
@@MrSN99 you should check Valve's source code for TF2, it has much of the same stuff. it's not all that uncommon to see swears in code
I feel like only a fraction of these thoughts are written out because boy do I relate to them
Le9gagmemeface, GTA V truly is a game of its era.
It's a miracle games come out at all, these people are very brave and brilliant
Looks fun to be a developer at rockstar
The song playing at the background is "The Beer Song" by The Arrogant Worms. This reminds me of a old famous GTA video called "GTA IV DRUNK SHOW".
To everyone either starting or wanting to start a career in software. DO NOT GO IN GAMING. You will make less money, wirk more hours and be treated wirse than almost any other CS career
That is unless everything else is boring
i hate wirking and being treated wirse
Finally, a good use for AI voice synthesis!
"Why did I code here? Bad luck I guess..."
Their coding is unironically on brand with games/story’s they make.
I'm not gonna pretend to be a whiz kid or an actual developer or even smart, but I have a tiny bit of experience with game development and misc IT stuff. it's amazing how sometimes things that should work simply don't, and things that you don't know how they are working simply do. one can spend more than a few minutes just staring at a line, scratching one's head, maybe even with someone more experienced legit trying to help, and no one can figure it out, then eventually someone finds the mistake or comes up with a crazy solution that may or may not be efficient, but it's effective. I wish I was smart enough to have pursued a career in the field, it often feels like one's dealing with magic, it's amazing
IDK man, I know this code is a bit old at this point, but if I ever submitted code at my workplace with comments like that, I would be promptly asked to remove them before merging lol
Yup. I’m betting a lot of this is very old code, likely dating from the GTA3 era.
that's why i just push to master
XD@@realEchoz
This was fantastic. Thank you for taking the time to do this.
the dude ragdolling in pain fucking shit up is killing me
Not sure whether these comments are really from the GTA 5 development period. Presumably they don't start from scratch for every game, so many of these might be old comments from old games they made.
True. Most of the engine code appears to have been gradually improved to accommodate more modern programming paradigms and hardware. Some of the code was also presumably used for older games in the series spanning all the back to the late 90s according to the copyright notices.
i worked with a guy who took his own life, and didnt leave a note. until almost 3 years later it was found commented in the source code. we sent our boss, and then notified his family with it
so he left like a farewell letter in the code??
@@bjarne9700 yeah it was what he was going through, and he felt he had no one to talk to kinda stuff
I never thought I'd 'fit in' as a developer because of my foul language. Turns out I'd be the perfect fit?
"I don't think this really works, but fuck it call it anyway!" That is way too familiar XD
0:15 lmao those two lines are an absolute bruh moment
I’m surprised there’s no, “I don’t know why it doesn’t work before, but now I don’t know why it DOES work. GG.”
Nice to see how almost everything has a pointer or double pointer. Almost nothing about passing by reference. I liked it.
This just goes to show that it doesn't matter if your game follows standard 3317 2012 edition 8.b programming practices and contains algorithms implemented in vanilla C using derived equations.
Literally the only thing that matters is that it's done eventually.
I just realized I could work for Rockstar
just do it
have a very sharp c++