GTA3 Code Review: Weapons, Vehicles, Cops and Gangs

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 พ.ค. 2024
  • Today, we'll review the source code for RE3- the reverse-engineered C++ source code for Grand Theft Auto III and Vice City. We'll look at the code for Pedestrians, Vehicles, Cops, and Gangs.

ความคิดเห็น • 664

  • @caiocouto3450
    @caiocouto3450 6 หลายเดือนก่อน +3021

    wow i wasn't expecting the code to be so readable, it's kinda common big projects have complex codes you can't follow along easily

    • @WhiteTree97
      @WhiteTree97 6 หลายเดือนก่อน +1495

      It's reverse engineered. The original one is probably a monkey shit throwing trash.

    • @zurboz7098
      @zurboz7098 6 หลายเดือนก่อน +79

      @@WhiteTree97 ikr i was gonna say that

    • @TheDjarto
      @TheDjarto 6 หลายเดือนก่อน +40

      @@WhiteTree97😂😂😂too accurate

    • @jupiterapollo4985
      @jupiterapollo4985 6 หลายเดือนก่อน +69

      @@WhiteTree97 A little harsh, but probably completely accurate 😂😂😂

    • @typechecked9069
      @typechecked9069 6 หลายเดือนก่อน +82

      just goes to show how much optimization the compiler does under the hood. the underlying assembly must've been pretty neat (thanks to the compiler turning bad rockstar code into nice assembly)

  • @JensN113
    @JensN113 6 หลายเดือนก่อน +2072

    This is so cool. I am currently learning C++ and always thought about how big projects are structured and certain things are implemented

    • @adsadam1
      @adsadam1 6 หลายเดือนก่อน +245

      I wouldn't look to video game development for good practises though 😅

    • @jordan4220
      @jordan4220 6 หลายเดือนก่อน +106

      As someone who has worked with c++ for 10+ years, this code looks like something an intern would write. I do like the forward declarations in the headers, but I think that's pretty common in game development

    • @omaewamoushindeiru3303
      @omaewamoushindeiru3303 6 หลายเดือนก่อน

      ​@@jordan4220what exactly is your work in your company?

    • @teabaggins7091
      @teabaggins7091 6 หลายเดือนก่อน +6

      it's like magic

    • @ShrikeGFX
      @ShrikeGFX 6 หลายเดือนก่อน +26

      These are terrible structures they have

  • @wlockuz4467
    @wlockuz4467 5 หลายเดือนก่อน +164

    I am not even a C++ dev but this code was so easy to understand.
    The variable naming and logic almost makes it feel like reading natural language.
    "If x is y, do z" etc.

    • @DivineComedia
      @DivineComedia 3 หลายเดือนก่อน +1

      and now AI 's are getting into it to increase efficiency and dexterity of Devs

    • @pinekel8987
      @pinekel8987 หลายเดือนก่อน +5

      ​@@DivineComediaAI is a joke

    • @sytnoff1
      @sytnoff1 หลายเดือนก่อน +2

      ​@@pinekel8987nah bro wait for devin to replace y'all

    • @pinekel8987
      @pinekel8987 หลายเดือนก่อน

      @@sytnoff1 who's devin?

    • @sytnoff1
      @sytnoff1 หลายเดือนก่อน

      @@pinekel8987 bingo you are not into internet much ,you will get to know it

  • @Nomadnetic
    @Nomadnetic 6 หลายเดือนก่อน +140

    This is really fascinating to look at in depth. I used to make mods for GTA 3 around 2002-2003, and was always hampered by the limits of the engine. I haven't been in that scene in years so I wasn't even aware of this project. Great video.

    • @Sam-rr4ek
      @Sam-rr4ek 4 หลายเดือนก่อน +6

      That's really cool

  • @Brmngm
    @Brmngm 6 หลายเดือนก่อน +9

    I like it! Definitely will watch more as if there’s not enough code reviews have to be done at work. Maybe it’s your voice that makes it so satisfying)

  • @raveschwert
    @raveschwert 6 หลายเดือนก่อน +301

    My dad used to hide this game from me when i was little.
    Felt great to revisit this gem of a game in code form

    • @18PregnantAndProud
      @18PregnantAndProud 6 หลายเดือนก่อน

      why did he do that

    • @sleepi5550
      @sleepi5550 6 หลายเดือนก่อน +91

      @@18PregnantAndProud GTA isn’t really the most child friendly game lmao

    • @techgamer1597
      @techgamer1597 6 หลายเดือนก่อน +25

      now you can just program it yourself if he was to hide it again

    • @bapoTV
      @bapoTV 6 หลายเดือนก่อน +7

      mine would mod it to remove all pedestrians and just left the traffic so I only could steal cars and drive

    • @Zer0.-_
      @Zer0.-_ 5 หลายเดือนก่อน +7

      You guys don't realize that back in the late '90s and early 2000s there was still a lot of incorrect thinking that violent video games and movies directly caused kids to become violent and psychotic.
      This has since been disproven via psychological studies, but it was a common talking point back during that era. In fact you can still see some people clinging on to that incorrect belief to this day if you ask enough people.

  • @IronEducation
    @IronEducation 6 หลายเดือนก่อน +880

    Having one weapon class stacked with a huge switch case statement sounds bananas but the rest of the code looks pretty clean. This was really interesting!

    • @exilednivera
      @exilednivera 6 หลายเดือนก่อน +63

      I guess it was mostly issue of early gamedev as there were no engines like unity back then and I think people were following mostly the idea "don't fix what is not broken" allowing thus weird structures in code and logic just to make it done instead of banging their head to make it pretty. I recently starting to find this approach relatively viable if only certain team works on the project and until the point you decide to create it more maintainable.
      So currently my opinion on code is: First implementation can be anything that works, if features update starting to touch that piece of code a lot it will require revision.

    • @fishthefirst
      @fishthefirst 6 หลายเดือนก่อน +121

      @@exiledniveraYour opinion is known as technical debt

    • @n00bma5ter69
      @n00bma5ter69 6 หลายเดือนก่อน +14

      Yeah I thought it would have dynamically called the class based on weapon type. Would love to know the backstory to these little things like "yeah we let the intern loose on that. It worked so we left it"

    • @tomquareme3787
      @tomquareme3787 6 หลายเดือนก่อน +116

      Probably because a switch statement is faster than doing a vtable lookup for polymorphism.
      For a switch statement the compiler generates a jump table and there is no indirection of code; you just jump to the code which needs to be executed. In a vtable you have an indirection to another method with an extra cost of dereferencing a pointer. If I recall correctly virtual methods can also cause cache misses due to the vtable lookup, dereferencing and indirection. The use of a switch statement here probably serves as an optimisation. In game programming, especially back in the days, it is common practice to ditch virtual methods in favour of switch statements, use array based data structures instead of pointer-based ones like linked lists.

    • @markminch1906
      @markminch1906 6 หลายเดือนก่อน

      People keep saying this and implying that its like intern level code, but it really just shows how little exposure you have to anything outside of OOP code and don't understand c++ that well. using Switch statements are way faster than performing dynamic dispatch using inheritance. When using an dynamic function in C++ you are working with a pointer that has to be dereferenced, which is slow, then you have to perform a look up on the VTable to find the right function. And if that isn't bad enough you can't inline dynamic functions. Switch statements can call functions that are able to be inline and don't have to use a VTable, now normally you would have functions inside of the switch statement that are all in one compilation unit, and this stays clean because you can look at all the different implementations of the gun in one file, which is quite nice for code read ability, unlike a lot of OOP code where multiple classes exist in different cpp files and you have to go from file to file across your code base to see how different versions of the the inherited functionality is used.
      There are lots of good reasons to use procedural programming practice, along with learning functional programming practices, I recommend not calling code messy just because it doesn't conform to the only programming style you seem to know
      @@n00bma5ter69

  • @alexandermeneses5688
    @alexandermeneses5688 6 หลายเดือนก่อน +141

    I remember I got into programming because of GTA modding so looking at this kinda brings me back to those years. Great video

    • @Puxi
      @Puxi 6 หลายเดือนก่อน +15

      I worked on the Spider-Man Game, I was a graphic designer and they made me design some trans and gay flags for folks like you.

    • @thecubeheadguy6747
      @thecubeheadguy6747 5 หลายเดือนก่อน +21

      @@Puxi uh what?

    • @ihatetomatoees
      @ihatetomatoees 4 หลายเดือนก่อน

      @@Puxiyou should love yourself, NOW 🤗

    • @dancelphyt9906
      @dancelphyt9906 3 หลายเดือนก่อน

      For me its Java because Minecraft moding 😂

    • @pixelcatcher123
      @pixelcatcher123 หลายเดือนก่อน

      Same, not only gta but gaming @all

  • @WellActualllyyy
    @WellActualllyyy 5 หลายเดือนก่อน +4

    this is really cool. i’m learning how to code and it’s nice seeing how clean and easy to read this stuff is

  • @faeancestor
    @faeancestor ปีที่แล้ว +29

    Super insightful analysis! Thanks Ryan!

  • @FrankTalksFinance
    @FrankTalksFinance 5 หลายเดือนก่อน +354

    As a CS student it is refreshing to see this code being so "simple" and kinda relatable to what we are tough in school. You would think in the real world they would use some crazy logic and algorithms. It is nice to see the switch and the if statements lol

    • @S-Kara
      @S-Kara 5 หลายเดือนก่อน +38

      hoy hoy the switch and if statements are one of the backbones of any programming at all
      what's hard about CS study case vs IRL work case would be the decisions of said codes, analyzing your company's needs and ideal business process, and many other stuffs. Not forgetting working under more strict deadlines, dealing with tons of things to do with minimum resources, etc.

    • @okko7788
      @okko7788 5 หลายเดือนก่อน +7

      Keep in mind this is reverse engineered like specified at the start of the video. That still might say a few things about code you can see in the wild

    • @halfbakedproductions7887
      @halfbakedproductions7887 5 หลายเดือนก่อน +11

      I've seen some of the leaked/stolen GTA V code.
      Apart from the file I saw having over 10k lines (which isn't even really an issue per se) it was very readable, clearly structured, the function names and signatures were pretty clear and descriptive. Not too many comments, but you don't always need them.
      I also didn't see any truly scary or horrible C++ concepts (no sign of the dreaded reinterpret_cast etc. From what I can remember) and I understood about 90% of it, despite not really being a C++ expert.
      Can't quite remember what that file did, but I think it was logic governing humans interacting with different types of object in the game world e.g. getting into a car, getting out of a car, what happens if you encounter another pedestrian and bump into them etc.

    • @everyusernametaken11
      @everyusernametaken11 5 หลายเดือนก่อน +12

      There is crazy logic and algorithms involved in these games. Lighting, car physics, etc, which all need to be efficiently implemented.

    • @Tux0xFF
      @Tux0xFF 5 หลายเดือนก่อน +2

      Its actually the inverse, in school it is more complex(for grading), code implementation of things that will never be found in real world code

  • @ankk98
    @ankk98 5 หลายเดือนก่อน +1

    Wow, I learned so much from this video. Keep making videos on popular source code review.

  • @LuisMunoz-fq7de
    @LuisMunoz-fq7de 4 หลายเดือนก่อน +1

    Really Cool !!! Keep making content like this, it's very interesting. Found myself watching the entire video surprisingly

  • @kinershah464
    @kinershah464 5 หลายเดือนก่อน +5

    This code looks so amazing. It was clean and simple. Thanks for sharing this.

  • @ark_4281
    @ark_4281 6 หลายเดือนก่อน +1

    THIS IS GOLD, Thanks for making this vid

  • @jameshighmore
    @jameshighmore 6 หลายเดือนก่อน +2

    Really appreciate this video and your very clear way of explaining things. Thanks!

  • @morkallearns781
    @morkallearns781 6 หลายเดือนก่อน +293

    5:58 The differences between the different kinds of cops doesn't warrant another layer of inheritance. They all have the same functionality except for different attributes like model, armor, etc. They all will use the same methods. I think it's very clean and a testament to how well written the base cop class is that they don't need to reimplement methods for each different cop type.

    • @salsichalivre5401
      @salsichalivre5401 6 หลายเดือนก่อน +46

      To be honest, then project there is cool, but don't lose your time watching this video. Check the project by yourself or watch from a reliable resource. His comments are of very few value. Unless you are a junior, them it may be interesting to waste your time listening to him.

    • @okko7788
      @okko7788 5 หลายเดือนก่อน +11

      @@salsichalivre5401How can it be interesting to "waste" your time? Especially if you make it sound like there's still some value for less experienced people, that's never a waste of time in that case.

    • @Cd5ssmffan
      @Cd5ssmffan 4 หลายเดือนก่อน +1

      @@salsichalivre5401 🤓

    • @VivekYadav-ds8oz
      @VivekYadav-ds8oz 10 วันที่ผ่านมา +1

      @@salsichalivre5401 I agree, but I mostly just read code from the screen without really paying much attention to what he's saying. I feel like that's equivalent (except ofcourse you only read the code he shows).

  • @kingarthurthethirdthst3804
    @kingarthurthethirdthst3804 4 หลายเดือนก่อน

    Looking forward for the GTA 5 code review, you have a real knack for this stuff

  • @knightandlord
    @knightandlord 6 หลายเดือนก่อน +16

    I’m amazed that this even exists in the first place. The fact that it exists is proof that the free market of software / code is the real frontier of ideas. And I’m not even a dev. I’m a product designer but this is fascinating. I don’t play video games either. I’m just interested in the tech behind the world.

  • @papafhill9126
    @papafhill9126 6 หลายเดือนก่อน +56

    This is really useful content. I'm in Unity with C# but this is definitely giving me ideas of how to structure my code better and even how to "blueprint" my methods / variables to ensure I'm not forgetting functionality later on.

    • @gustavofelicidade_
      @gustavofelicidade_ 6 หลายเดือนก่อน

      Do you do some web based projects in c#, if so, what u use?

    • @F.ELEVEN
      @F.ELEVEN 6 หลายเดือนก่อน

      Same here, always useful to see how big projects are made!

    • @TheMathias95
      @TheMathias95 6 หลายเดือนก่อน +17

      You'll get a headache for sure trying to maintain or expand your game, assuming you are following this example too close. You're much better off modularizing your components.

    • @halfbakedproductions7887
      @halfbakedproductions7887 5 หลายเดือนก่อน

      As much as Unity annoyed me and felt like a cheap toy, the way you structure your scripts and attached them to things is so much more intuitive than Unreal. At least at first.
      Unreal gets very messy very quickly when you break out the C++. It's non-standard syntax (with many things hidden from you) and you don't attach the code to a game object, rather the code IS the game object. Just like how the Blueprint in the editor IS the game object also.
      You can't really go "half and half" in Unreal like you can in Unity. Or at least I haven't quite figured out how yet. You're better off doing your entire project in Blueprint or C++ IMO.

    • @F.ELEVEN
      @F.ELEVEN 5 หลายเดือนก่อน

      @@halfbakedproductions7887 I'm working on a complex game project and it's really up to you, both workflows are possible! You can have the code running outside the gameobject, and that gameobject just being a reference, if it's that what you mean.
      When I tried Unreal for a few weeks I noticed that the workflow I created throughout the years was kinda similar to Unreal. But for me calling scripts, gameobjects and prefabs the same thing is just a mess. I prefer that on Unity it's really up to you what workflow you want, even if you want to replicate something like Unreal I believe it's possible!

  • @JaredFL
    @JaredFL 6 หลายเดือนก่อน

    Great find. I'd love to see more of this

  • @slaction
    @slaction 10 หลายเดือนก่อน +2

    Love you videos dude, keep it up.

  • @RAPHAELSC
    @RAPHAELSC หลายเดือนก่อน +1

    That enum trick to keep track of how many items you have in the enum was awsome!

  • @saffi8322
    @saffi8322 6 หลายเดือนก่อน

    Thanks for the amazing video Ryan ❤

  • @ArmchairRamb0
    @ArmchairRamb0 26 วันที่ผ่านมา +1

    The degree of complexity is insane. Pretty good labeling for reverse engineering. Good video.

  • @erickfana4466
    @erickfana4466 2 หลายเดือนก่อน

    Just for the title, you won a new sub. Great!

  • @FarSam25
    @FarSam25 6 หลายเดือนก่อน

    Wow I'm glad that TH-cam recommended this to me! Subscribed ✔️

  • @eXit-mm3zg
    @eXit-mm3zg 9 หลายเดือนก่อน +1

    Love your channel!

  • @smallbluemachine
    @smallbluemachine 6 หลายเดือนก่อน +11

    So clean and readable.

  • @DanTheDeveloper
    @DanTheDeveloper 3 หลายเดือนก่อน

    This is very exiting. I'd love to look through that code 😊 especially the AI stuff haha. Amazing content!

  • @pleasedontwatchthese9593
    @pleasedontwatchthese9593 6 หลายเดือนก่อน +16

    11:21 I really like enums. There are so many little tricks you can do with them, they are simple to understand and lots of enforcement at compile time or static analyze.

    • @halfbakedproductions7887
      @halfbakedproductions7887 5 หลายเดือนก่อน

      And at the end they boil down to just being plain old numbers. Rather than having to remember that 1 means "walking", you just have state.IsWalking instead.
      Makes your code so much more readable and a smart compiler will optimise it all down anyway.

  • @cam2xx688
    @cam2xx688 5 หลายเดือนก่อน

    Cool asf to see. What I’m learning in class right now lol they are modulizing code cool asf breaking it down into separate functions

  • @ckk3129
    @ckk3129 4 หลายเดือนก่อน

    Really fun to have someone go through the code and help me identify what I'm looking at

  • @mikerope5785
    @mikerope5785 6 หลายเดือนก่อน +4

    What you are seeing is the labels given by the person who has reverse engineered the purpose of each "thing", not the original labels by the rockstar programmers. When you disassemble a binary file, you don't have the luxury of retaining any useful labels or comments (sometimes all you have are some unmolested cleartext strings e.g. names of some external .dll files) so you've just got to add your own labels as you discover what each structure does. One hell of a task, and they did a really good collaborative job on this one.

  • @3bomb
    @3bomb 6 หลายเดือนก่อน

    Man this is so awesome. Thank you.

  • @NightFyreTV
    @NightFyreTV 6 หลายเดือนก่อน +7

    Hey this was a really great video! Would like to see another like it if you're up to it :)
    There's a lot of open reversal projects for games dating to that generation.
    I personally recently was looking into MGS1 because I was curious on the implementation of the soliton radar.
    Hope you been well

  • @JSanyo
    @JSanyo 6 หลายเดือนก่อน +5

    7:12 is about the great fight at the dam, Catalina will eventually try to escape with the heli and the player should prevent those path increments

  • @lm3allem9
    @lm3allem9 ปีที่แล้ว +250

    Code looks clear and nice! Thanks for analysis:)

    • @nox4000
      @nox4000 6 หลายเดือนก่อน +21

      Clearly you don't know much C++ if you think this is clear and nice

    • @prostmahlzeit
      @prostmahlzeit 6 หลายเดือนก่อน +3

      ​@@nox4000please elaborate

    • @nox4000
      @nox4000 6 หลายเดือนก่อน +18

      @@prostmahlzeit Didn't really but much effort but here it goes:
      * Header file aren't documented in any way
      * Use of C-style pointers
      * The code doesn't follow memory safe practices. For instance, the pointers are not checked to be valid. In many places references could be used instead of pointers.
      * Questionable architecture. The monolithic classes should be split. For example the CVehicle class is awful. No abstractions, no proper pure virtual functions where needed.
      * By looking at a class header, it'll be unclear if the function changes the instance's state.
      * Unclear ownership of data.
      * The code doesn't seem to follow any widely used style practices. Lots of nested ifs, monolithic functions, no consts etc.

    • @exilednivera
      @exilednivera 6 หลายเดือนก่อน +3

      @@nox4000 Well... While its not the best practices there is 1 thing that makes it viable: it works

    • @theitatit
      @theitatit 6 หลายเดือนก่อน +4

      @@nox4000 show us your reverse engineered games

  • @yusufahmed3678
    @yusufahmed3678 3 หลายเดือนก่อน +1

    Great video. Was wondering what code editor was being used in the video. Thanks!

  • @georgy3136
    @georgy3136 6 หลายเดือนก่อน

    Thank you so much for this!

  • @smlgd
    @smlgd 6 หลายเดือนก่อน +55

    This is an amazing example why code doesn't necessarily need comments to be perfectly readable

    • @MohammadAlizade
      @MohammadAlizade 6 หลายเดือนก่อน +11

      Usually comments don’t make it to the final build or when you reverse engineer it

    • @pleasedontwatchthese9593
      @pleasedontwatchthese9593 6 หลายเดือนก่อน +1

      I think comments have two big places where they can help. To help summarize large amounts of code. Like explain what this whole file of code is. I also use then if I don't feel like the code does something a little abnormal. Like why am I getting this variable or calling this function when it seems unrelated. So I might a comment saying it's best to run this to make sure all the objects are updated or something like that.

    • @killionaire175
      @killionaire175 5 หลายเดือนก่อน +4

      It was reverse engineered by 3 German guys using IDA Hex Rays. All comments from the original source code are not compiled into the binary.

    • @smlgd
      @smlgd 5 หลายเดือนก่อน

      @@killionaire175 I don't mean the original code, I mean this version of the code shown in the video is perfectly readable despite being scarcely commented

    • @killionaire175
      @killionaire175 5 หลายเดือนก่อน

      @@smlgdAh yeah, I get ya

  • @Ghostie.
    @Ghostie. 6 หลายเดือนก่อน +1

    Pretty rad dude, GTA 3 and MGS2 changed everything I knew about games back then.

  • @allumallu6580
    @allumallu6580 4 หลายเดือนก่อน

    This was really awesome !

  • @kirdow
    @kirdow 6 หลายเดือนก่อน +8

    9:25 Wouldn't that be because the getters and setters (or similar) that they would have had in the original code probably was inline? I'm guessing you had something like pDriver->SetVehicle(this); but since it was probably defined in the header it was optimized away at compile time into simply an inline assignment. Thus when the project owners reverse engineer it, they only see the inlined version? I feel that's just common sense for C++ generally.

  • @jackkraus6948
    @jackkraus6948 2 หลายเดือนก่อน

    I don't know a lot about C++ beyond what it has in common with other languages, nor have I played GTA3, but this is still one of the coolest things I've seen in a while. I've always wondered how code in triple A projects was structured

  • @rickbalderas7153
    @rickbalderas7153 3 หลายเดือนก่อน

    as a cs student, this is so cool to find considering I am barely learning the more advanced concepts of C++. I am a complete novice to the language

  • @Z-Jiwonz
    @Z-Jiwonz 6 หลายเดือนก่อน +1

    This is rlly helpful 👍 if you don't mind, Can you do half-life 2 too?

  • @sah4pok633
    @sah4pok633 6 หลายเดือนก่อน +1

    Perfect review, it's a lack of such things with such projects on the Internet

  • @thydevdom
    @thydevdom 6 หลายเดือนก่อน +2

    That is some CLEAN code!

  • @bouzie8000
    @bouzie8000 5 หลายเดือนก่อน +1

    This is the best coding video I've seen on this app. Made me remember why I fell in love with this space. BECAUSE IT'S COOL

  • @yunekoh
    @yunekoh 4 หลายเดือนก่อน +1

    Your voice is so cool! it feels like watching a movie

  • @skylo706
    @skylo706 5 หลายเดือนก่อน +11

    You are very sympathetic and just got a new sub 😊
    Edit: The code looks extremely well written. When I was modding pokemon emerald for the gba, the disassembly, written in C, was completely unreadable. It was downright disgusting. I had an easier time working with the first and second generation purely written in Z80 Assembly ^^

    • @DanyloSyrotynskyy
      @DanyloSyrotynskyy 3 หลายเดือนก่อน

      Tbh code looks horrible in comparison of how modern games are written

    • @pcpll
      @pcpll 3 หลายเดือนก่อน

      @@DanyloSyrotynskyy blabla bla the code always look horrible for a one single random dude, I am sure if there was to put a poll most people would find this code very readable

    • @DanyloSyrotynskyy
      @DanyloSyrotynskyy 3 หลายเดือนก่อน

      @@pcpll read a book code Clean Code by Robert Martin. This is a Bible of coding. There are strict rules like methods should not fit more then screen.

  • @123bubbleup
    @123bubbleup 6 หลายเดือนก่อน

    my computer graphics professor sam buss worked on the driving physics in gta iv. really cool dude

  • @goswamivibhor
    @goswamivibhor 6 หลายเดือนก่อน +1

    First time saw a guy reviewing Game code but not the game. 😂🔥

  • @TheGoodChap
    @TheGoodChap 5 หลายเดือนก่อน +38

    I like the way they wrote it, they didn't go insane with the C++ OOP features, they do a very minimal implementation similar to how it would be done in C. I hate over engineered C++ stuff where there's a bunch of methods that are just one line.

    • @xMarious98
      @xMarious98 4 หลายเดือนก่อน

      Go read "Clean Code" book, please

    • @Gwarzonicus
      @Gwarzonicus 4 หลายเดือนก่อน +6

      one of my bigest issues with todays software concepts and frameworks. People just 'complexify' things. Makes code very hard to read. Its like a display of syntax knowledge rather than implementing things in the most efficient and simple way.

    • @klkl8525
      @klkl8525 4 หลายเดือนก่อน +2

      thats usually called a “c with classes” approach which basically tries to utilise core concepts of c and use c++ festures as little as possible (eg oop)

    • @klkl8525
      @klkl8525 4 หลายเดือนก่อน

      check the doom3 source code for a similar code base

    • @oooBASTIooo
      @oooBASTIooo 4 หลายเดือนก่อน

      It's about debugging. If you have several lines of code, it is much harder to find errors than in single lines. If you break it down all the way to super small methods, you can check each and find errors much quicker.
      Between 1/4 and 1/2 of programming time is spent on debugging. So minimizing this is a huge plus!

  • @SMTImagineEnjoyer
    @SMTImagineEnjoyer 4 หลายเดือนก่อน

    for the heli section at 6:40 I believe the Find Target section is to enter a heli, but if heli status is Shot Down then you cant enter the heli. then all the cases are different ways you are able to path to or enter the heli. which is why Take Off is after that block of code.

  • @uliveulearnandregret
    @uliveulearnandregret 6 หลายเดือนก่อน +1

    A game I know called Let It Die has Enums that the game signature was dumped so we found value types, but no source code, the enums would increment from 0 and the last enum would actually be called MAX, generally setting any enum to the MAX enum value would crash the game because there was no code built around MAX just everything that came before it

  • @nozimshaazizov2108
    @nozimshaazizov2108 6 หลายเดือนก่อน +3

    This is so cool, for me another interesting part is how does the front end part comes in? Like actual graphics of the game?

  • @everyhandletaken
    @everyhandletaken 6 หลายเดือนก่อน

    Interesting!
    Those nested conditionals though 😳

  • @arsnakehert
    @arsnakehert 6 หลายเดือนก่อน +21

    Thank you for doing this! Have you done Doom 3 yet? That would be pretty cool, could be a whole series!

    • @jimmyhirr5773
      @jimmyhirr5773 6 หลายเดือนก่อน +2

      You should check out Fabien Sanglard's thorough review of Doom 3's source code if you haven't already.

    • @arsnakehert
      @arsnakehert 6 หลายเดือนก่อน +1

      @@jimmyhirr5773 I have! Would be pretty cool to see something like that in video format

  • @BlueDecember06
    @BlueDecember06 6 หลายเดือนก่อน +7

    I ain't know shit about programming but this was nice to watch

  • @Ty-13
    @Ty-13 4 หลายเดือนก่อน +1

    Suprisingly readable thats cool

  • @FricoDev
    @FricoDev 6 หลายเดือนก่อน

    7:31 The "how do we get here" represents me 100%

  • @lasindunuwanga5292
    @lasindunuwanga5292 หลายเดือนก่อน

    damn even the title of this video! 🔥🔥

  • @F.ELEVEN
    @F.ELEVEN 6 หลายเดือนก่อน +1

    This is sooo cool!!! Love to see how older games are made specially cause they had to be optimized to run on such low specs!
    Also unrelated but you could 100% do trailer voices if you need a job, you have the voice for it!

  • @blahdelablah
    @blahdelablah 5 หลายเดือนก่อน +12

    It's worth pointing out that the reverse engineering of GTA3 was assisted by debug symbols being included in the PS2 and Android versions of GTA3, which made it easier (but not easy) to reverse engineer the source code.

    • @TheGoodChap
      @TheGoodChap 5 หลายเดือนก่อน +4

      It's always crazy to me when AAA developers leave debug symbols in the final compilation. It's extremely helpful, almost like a jigsaw where you know what certain functions are supposed to do by their name so when you finally find the code you can just go find that function name you know you saw and apply it

    • @blahdelablah
      @blahdelablah 4 หลายเดือนก่อน

      @@ITSecNEO Something tells me you don't understand the work that goes into reverse engineering source code. It's not enough to have something that works, you also have to engineer something that's maintainable. You can't automate that even with debug symbols.

    • @blahdelablah
      @blahdelablah 4 หลายเดือนก่อน

      @@ITSecNEO I have reverse engineered .NET code with tools like dnSpy. You still don't end up with code that you want to maintain. Why don't you go and tell the people reverse engineering GTA3 and Vice City that they're doing it all wrong, any look at their commit history will show it's not a 5 minute job.

  • @AnikenSkiwalker
    @AnikenSkiwalker 5 หลายเดือนก่อน +1

    The NPC base class is definitely worth looking at

  • @andreypanin2136
    @andreypanin2136 3 หลายเดือนก่อน

    Great vid.

  • @SpeedyMechnic
    @SpeedyMechnic 6 หลายเดือนก่อน

    So cool. So cool, now show us how you do a build and run the game after tweaking some values

  • @awawus
    @awawus 6 หลายเดือนก่อน +44

    It doesn't matter which programming paradigm you are a fan of. It only takes that one co worker for you to change your mind. In modern day programming, you need to be fluent in every paradigm and be able to apply one that fits for a specific part of your program. No project can be entirely procedural, object-oriented or functional. You also need to know to switch paradigms when refactoring if it is a better fit.

    • @gbbarn
      @gbbarn 6 หลายเดือนก่อน +1

      Okay o.o

    • @hamburgerfatso
      @hamburgerfatso 6 หลายเดือนก่อน +32

      Sir this is a Wendy's

    • @anon1963
      @anon1963 6 หลายเดือนก่อน +7

      99.9% of the time, compiler will do a better job optimizing than you arbitrarily deciding to use only functions and not classes

    • @jimmyhirr5773
      @jimmyhirr5773 6 หลายเดือนก่อน +13

      ​@@anon1963Refactoring is usually done to improve readability and ease of modification, not to improve performance.

    • @ultimaxkom8728
      @ultimaxkom8728 6 หลายเดือนก่อน +4

      @@anon1963 Until Yandev and recent unoptimized AAA launch flops enters the room.

  • @PPablinho
    @PPablinho 6 หลายเดือนก่อน +16

    Very nice video, by explaining the code I can understand a bit what it does despite of never code on C/C++. Is a shame that this project went to the trash because of Rockstar Games greediness but even so I can hope one day to see a project like this again because Vice City is one of my favourites games and the 3D era of GTA needs to be preserved

    • @LindenAshbyMK
      @LindenAshbyMK 6 หลายเดือนก่อน +7

      Vice City is a legendary game... and the reverse project seems to be much better in every possible way, than all the ports done by take2 and rockstar later on. I guess that why take2 brought it down - they cannot handle a fair competition. It's all about cash grab nowadays.

    • @jimmyhirr5773
      @jimmyhirr5773 6 หลายเดือนก่อน +2

      ​@@LindenAshbyMKTake2 owns GTA III and Vice City. It's their right to take down infringements of their property.

    • @pisse3000
      @pisse3000 6 หลายเดือนก่อน +10

      @@jimmyhirr5773Reverse Engineering is not piracy

    • @ultimaxkom8728
      @ultimaxkom8728 6 หลายเดือนก่อน

      @@pisse3000 It's clearly less about piracy than it being an unauthorized reverse engineering. This is not a defense as I only points out the disingenuous counter.

    • @phath0m135
      @phath0m135 6 หลายเดือนก่อน +6

      @@jimmyhirr5773 Just because something is "right" in a legal sense, doesn't mean its right in a moral sense.

  • @developerkwame
    @developerkwame ปีที่แล้ว +10

    This is cool, but I could not find the source code again, it seems it was taken down

  • @gabeworks_
    @gabeworks_ 6 หลายเดือนก่อน +1

    I don't understand a single line, but is visible that bro knows very well what he's saying

  • @fahnub
    @fahnub 5 หลายเดือนก่อน

    Damn, that's a crazy codebase.

  • @StewardGarcia
    @StewardGarcia 6 หลายเดือนก่อน

    ABSOLUTELY AMAZING THING THIS TOPIC!!!!!

  • @cmcdonough2
    @cmcdonough2 หลายเดือนก่อน

    That's really interesting. Thanks

  • @saitejapln3191
    @saitejapln3191 4 หลายเดือนก่อน

    clean code and clean design

  • @atultripathi9166
    @atultripathi9166 6 หลายเดือนก่อน +9

    The software architects behind these games have to applauded for their work as they bring a very complex game pictured by designers to life.

    • @arturzajac6181
      @arturzajac6181 6 หลายเดือนก่อน +2

      When I see the code, I doubt whether there were any software architects behind it...

    • @khalidzouzal8417
      @khalidzouzal8417 5 หลายเดือนก่อน +2

      ​@@arturzajac6181trust me there were, there's no way you're making a game that complex without some type of architecture.

  • @syedfarabi2884
    @syedfarabi2884 5 หลายเดือนก่อน

    The people wrote this code is an amazing guy. Because some people write complex logic for simple js stuff in basic websites.

  • @gamedoughhh
    @gamedoughhh 5 หลายเดือนก่อน +1

    I always want to see their traffic system and crowd population system.

  • @aloluk
    @aloluk 4 หลายเดือนก่อน +1

    Bare in mind, this code is reverse engineered. So when your commenting on the style of variable names, thats of those that reverse engineered it, not the original code.

  • @michaelhawthorne5516
    @michaelhawthorne5516 6 หลายเดือนก่อน +3

    Back in those days it was likely too expensive to take the cache miss for vtable indirection. Likely why they went with big switch statements over inheritance

    • @jordan4220
      @jordan4220 6 หลายเดือนก่อน +1

      Ya, likely due to call stack depth

    • @morkallearns781
      @morkallearns781 6 หลายเดือนก่อน +1

      It also serves no purpose to introduce another layer of inheritance when you can instead write a robust base cop class and provide sufficient attributes that effectively modify the behavior based off the different kinds of cops.

  • @olivierboisse1678
    @olivierboisse1678 3 หลายเดือนก่อน

    Very interesting. Are there unit tests to ensure the code base reliability ? Would be curious to know how they can maintain such a code base

  • @goodgod5608
    @goodgod5608 4 หลายเดือนก่อน

    RESPECT to those coders :)

  • @profitjourneywithsk2136
    @profitjourneywithsk2136 3 หลายเดือนก่อน

    Code is very modularised with inheritance and good naming conventions

  • @not_herobrine3752
    @not_herobrine3752 6 หลายเดือนก่อน

    holy spaces
    it is very nice to read through though

  • @Dota2Clips-bx9mt
    @Dota2Clips-bx9mt 28 วันที่ผ่านมา +1

    The codebase is pretty much similar to how Flyff is built. The naming convention etc.

  • @faresssoft
    @faresssoft 5 หลายเดือนก่อน +1

    When programming was programming ❤️ i bet the dudes have great time written the code

  • @johanngambolputty5351
    @johanngambolputty5351 6 หลายเดือนก่อน +1

    I think I just had a "wait its all basically if-else statements - always has been" kinda moment. I was turning my nose at it until I realised I kinda agree with it, being a rust convert, throwing away inheritance all together, you probably end up using enums/tagged unions to handle sum types anyway, but this seems kinda loose in c++. Does c++ have interfaces, I mean it has "contracts" (was it?) for its type constraints, are they like traits/interfaces?

    • @Ulissescars
      @Ulissescars 6 หลายเดือนก่อน

      I'm no C++ expert, but, if I remember correctly, C++ has only virtual classes, not interfaces.

    • @smlgd
      @smlgd 6 หลายเดือนก่อน

      C++ doens't have interfaces, closest to that would be abstract classes (classes with pure, non-initialized virtual functions) and multiple (virtual) inheritance

    • @goczt
      @goczt 5 หลายเดือนก่อน +1

      An interface is just an idea in C++ unlike in other OOP languages that don't allow multi-inheritance for class types. But it is usually allowed to implement multiple interfaces, that's why other languages need the distinction. In C++ you just inherit from interfaces because they're classes. An interface in C++ is just a class where all member functions are pure virtual, and there are no data members.
      Also concepts are another way to implement the idea of an "interface" in C++, but it's for static polymorphism, not for dynamic polymorphism. C++ is not strictly an OOP language, so it's other major paradigm is "generic programming" which is used to implement the standard library, and for which concepts were designed for mainly.

  • @natanmaia3575
    @natanmaia3575 หลายเดือนก่อน

    A lot of game programming in comparison to usual software programming I noticed so far is, if the game doesn't need to be maintained (single release), you can throw a lot of etiquette away.
    Using switch case instead of classes, changing member variables from other objects, and otherwise very unusual solutions to problems are more common than I first expected. After all, having a consistent code structure will help in the first 75% of development, and help with diagnosing bugs on the latter 25%, but the number one focus really is to deliver something playable.
    The client (the player) experience is the same if the state machine is its own class with scripts or just a switch with 40 statements lol. Of course, this doesn't quite apply to MMOs and online games and moddable games and frameworks/engines, but it's the main idea.

  • @fruitygranulizer540
    @fruitygranulizer540 5 หลายเดือนก่อน

    its crazy how readable this code is.

  • @gsr5706
    @gsr5706 3 หลายเดือนก่อน +1

    If a 00s game had this amount of code lines, just imagine gta vi...

  • @remcee2
    @remcee2 6 หลายเดือนก่อน

    This series is amazing! If you are doing more of this in the future, could you look at the code of Fortnite?

  • @enesdovec2676
    @enesdovec2676 4 หลายเดือนก่อน

    that imSureThatModelIsLoaded bool naming. LOL. I really felt the developer who write this code.. 10:12

  • @HeroTypez
    @HeroTypez 28 วันที่ผ่านมา +1

    Yeah as mentioned, it's nice to read haha

  • @lenonkitchens7727
    @lenonkitchens7727 12 วันที่ผ่านมา +1

    Comments, variable names, function names etc can't be retrieved via decompilation / reverse engineering, unless debug symbols are present. So all of the comments and names of everything are likely solely attributable to the folks that did the reverse engineering.

  • @juanarango4917
    @juanarango4917 6 หลายเดือนก่อน

    Would be interesting to see a Code Review of World of Warcraft Vanilla

  • @nathanielcolbert9070
    @nathanielcolbert9070 5 หลายเดือนก่อน +5

    This is interesting, but I think it would also be neat to look at the code that connects those logical functions to the visual character entities that display on the screen.

  • @catfree
    @catfree 6 หลายเดือนก่อน

    This video is so cool
    I always thought making a game was just some blackmagic until recently

  • @Jeremanteca
    @Jeremanteca 6 หลายเดือนก่อน +1

    Seeing this, I can't imagine what it is in the GTA 6 code