The Genius Simplicity of the GTA Vice City Source Code

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ม.ค. 2025

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

  • @KX36
    @KX36 18 วันที่ผ่านมา +120

    7:00 they are using bitfields so each :1 is one bit of a single shared uint32, and each group of 8 is one byte of that uint32. It's not to enforce 32 bits per bool, it's probably so that the whole thing can be accessed as one uint32 or 4x uint8 for serialization and deserialization, but individual flags can be accessed without having to do bitwise logic
    See also, the comment on line 113.

    • @therealjtgill
      @therealjtgill 18 วันที่ผ่านมา +7

      Came here to say this, spot on! The groupings have 8 flags each, and it looks like there are 4 groups, so it's safe to say that they're grouped by the bytes of a `uint32_t`.

    • @johnmarston2474
      @johnmarston2474 14 วันที่ผ่านมา +2

      I wish more people did this, it would save so much memory. It works in basically every language, even JS. Great for storing a bunch of booleans or whatever.

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

      John, saving memory and Js devs so t happening anytime soon 😂

    • @Digitalgems9000
      @Digitalgems9000 12 วันที่ผ่านมา

      Ain't*

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

      I do this exact thing all the time:
      union
      {
      uint8_t flagsByte;
      struct
      {
      uint8_t flag0 : 1;
      uint8_t flag1 : 1;
      ...
      ...
      uint8_t flag7 : 1;
      } flags;
      } flags;
      Now I can access the flags as an 8 bit byte via flags.flagsByte (useful for sending across a network connection, or serialising) or i can access each flag individually (flags.flags.flag6). The compiler does the rest.

  • @SDRIFTERAbdlmounaim
    @SDRIFTERAbdlmounaim 16 วันที่ผ่านมา +172

    not being able to buy a house and talk to women is a pretty accurate simulation of things i wish to do in real life but can only do in gta 😂

    • @m.ahmad72
      @m.ahmad72 4 วันที่ผ่านมา

      🤣😂🤣

  • @noinodev
    @noinodev 16 วันที่ผ่านมา +48

    its really interesting to see how professionals write code for games, or even just in general. in my head i expect it to be some unnatural voodoo but its so simple, but i suppose that's what makes it good. especially with inheritance ive both seen and written some absolute garbage OOP. personally i find enum/struct/buffer relationships easier to reason about for games though. good video as always :)

  • @CAJames902
    @CAJames902 15 วันที่ผ่านมา +39

    "Cars have colors, extras (whatever extras are)"
    Extras are Optional parts like the teddy on gang burrito, or taxi light on taxi / cab.

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

    Video title: GTA Vice City Source Code
    Actual video: Ofcourse, it's not the GTA VC source code

  • @sorrefly
    @sorrefly 18 วันที่ผ่านมา +17

    Would also be cool to see a class diagram where all of this was designed! Great job 🙂

  • @cromulence
    @cromulence 12 วันที่ผ่านมา +29

    Low gdp country accent - lmao, such a clever line.

  • @hohstapler4161
    @hohstapler4161 15 วันที่ผ่านมา +18

    U moje vreme ucilo se iz Quake source code. Bilo je dosta komplikovano jer je pisan u C, ne C++. Tesko je upasti u veliki projekat i snaci se, ali ako je covek placen tok to radi onda je ok.

  • @Reichstaubenminister
    @Reichstaubenminister 18 วันที่ผ่านมา +53

    >tariq
    >low gdp country accent
    >still sounds german
    >potatofication.jpg

  • @RealEngineer
    @RealEngineer 18 วันที่ผ่านมา +19

    Got a house, talked to a woman. I must be in game real life. 0:12

    • @Tariq10x
      @Tariq10x  16 วันที่ผ่านมา +9

      Sir, you are in the top 0.00001% of all CS guys.

  • @uioup7453
    @uioup7453 16 วันที่ผ่านมา +10

    What would you reccommend to a person trying to learn from source code? I've gone trough all the basics but I still don't have a clue on how people make all of these complex functions or how they know what they need to make in order to have a game run... I've tried reading Quake source code but I just don't even know where to begin... I'd love to program games one day, I've tried everything but can't even make a simple pop-up.
    I also want to insanely thank you for your videos, you explain stuff very simply and nicely, they helped me a lot.

    • @Tariq10x
      @Tariq10x  16 วันที่ผ่านมา +12

      Let’s start with this: Understanding the Quake source code in a short time frame can be very difficult even for experienced programmers. So, don’t beat yourself if you couldn’t understand it and remake your own quake game.
      Now, if you are interested in game development, or any other type of programming for that sake, you need to start with something basic. Want to make a game? Start with a 2D game. Once that’s done, raise the complexity of your task. But your main goal should be mastering the fundamentals, for example you have to learn how to break down the problem properly in smaller achievable tasks. In my video „Want to start coding?“ I provided a link for project based learning, its a huge free collection of resources with small projects. You can also find there how to create a doom like game in C++, its called „486 lines of C++“. It also contains projects in many other languages. I hope this helps and I am glad you like my content!

    • @uioup7453
      @uioup7453 16 วันที่ผ่านมา

      @Tariq10x Thank you for your reply. I've tried many things but I still struggle to see how basic data types like numbers and strings, arithmetic operations, etc... end up creating stuff like renderers or whatever else. I just don't know how to tackle stuff on my own from scratch, I don't understand the (software design? architecture?) side of things and the problem solving, like how can I use an array for something?

    • @Tariq10x
      @Tariq10x  15 วันที่ผ่านมา +7

      I see. Now, the reality is most people get their inspiration from other projects, so rarely will someone start coding a renderer without knowing how the logic of a renderer works. Creating a renderer from scratch would be a non-trivial task to begin with. First learn how something is supposed to work, look at how other people did it, try to understand their reasoning behind their decisions. And then you can try to recreate it, improve it, or even come with a completely different unorthodox approach on how to solve the problem. This goes for anything. So, don't expect to know how to create a renderer because you know how arrays work. You need to understand how renderers work, and then, how you can make one with the tools you have (programming language, standard libraries, third party libraries).
      If you have the chance to get a software internship somewhere, I would highly recommend it. The guys at my first internship taught me more about practical software knowledge than my university degree.

    • @GameskoTV
      @GameskoTV 15 วันที่ผ่านมา

      start programming first with opengl, directx11

    • @vlc-cosplayer
      @vlc-cosplayer 13 วันที่ผ่านมา +3

      Learning to code by reading the Quake source code is like reading the Bible by learning Aramaic first 💀
      Start with something simple and manageable like Unity, and then work your way down. Also, don't forget that old games had to do unholy hacks to work around hardware limitations, so there's a lot of "noise" in the way of the signal you're looking for, which is algorithms and data structures for video games.

  • @nask0
    @nask0 3 วันที่ผ่านมา

    Ma man Tariq strikes again. I enjoy those types of videos. And other ones as well. Keep it up bruh, continue to spill truths.
    Nask0x out.

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

      Got nothing but love for you bro

    • @nask0
      @nask0 21 ชั่วโมงที่ผ่านมา

      ​@@Tariq10x me too for you my Balkan brother

  • @NotBen101
    @NotBen101 3 วันที่ผ่านมา

    9:38 Treadable means that the building or object can have paths for cars to drive on. Helpful when you have objects like bridges or parking garages in the game. The asset logic would be included in the main.scm file and controlled by using the pickup system in Pickups.cpp.

    • @Tariq10x
      @Tariq10x  3 วันที่ผ่านมา +1

      You are absolutely right👌

  • @RichardBejtlich
    @RichardBejtlich 11 วันที่ผ่านมา +6

    1:25 low GDP country accent 😂 made me lol

    • @Haveagoodday7928
      @Haveagoodday7928 8 วันที่ผ่านมา

      What country that is I don't get it 😂

  • @Tomvillan
    @Tomvillan 14 วันที่ผ่านมา +5

    Bro the vscode folder has nothing related to gta

  • @ryanzeus31
    @ryanzeus31 13 วันที่ผ่านมา +2

    The only GTA that I remember All part of the map, I don't even need the mini map when play this game. 😅

  • @ConfusionWood
    @ConfusionWood 15 วันที่ผ่านมา +2

    I am waiting to see the GTA6 code :D

  • @myGameDemos
    @myGameDemos 5 วันที่ผ่านมา

    void FuckCarCompletly(void) in the DamageManager class at 15:40 was funny

  • @hicarodestrui
    @hicarodestrui 17 วันที่ผ่านมา +4

    Still waiting video like this to Official GTA V Source Code :(

    • @kneesnap1041
      @kneesnap1041 14 วันที่ผ่านมา +5

      nobody is going to cover that for legal reasons. But if that's something you really want to figure out, it's possible even if you know nothing as long as you have enough dedication!

    • @nask0
      @nask0 3 วันที่ผ่านมา

      ​@@kneesnap1041 oh but some guy almost did it (only portion if comments tho), but forgot the name of the video, but I guess you'll manage to find it, if dedication is there 😀

  • @martinmusli3044
    @martinmusli3044 18 วันที่ผ่านมา +3

    What does it say about me, watching a low gdp country guy explaining some code to me I will never look at 😅.
    Enjoyed that. Keep it up

  • @FokC352
    @FokC352 11 วันที่ผ่านมา +1

    Low gdp country accent went crazy

    • @Tariq10x
      @Tariq10x  5 วันที่ผ่านมา

      🔥

  • @nngnnadas
    @nngnnadas 11 วันที่ผ่านมา

    It's my own damn copy of the repository, and I'll refactor it if I wanna

  • @elmatuko
    @elmatuko 15 วันที่ผ่านมา +1

    I really like this kind of thing but I dont understand anything, but I would love to learn how to code. Any advice for how I can start learning?

    • @MartinWoad
      @MartinWoad 14 วันที่ผ่านมา +3

      Depends on what you want to code and what is your background. If you are going in completely blind with no CS background, I would start by watching a Python tutorial and giving yourself a goal of completing 10 very easy programs. Once you complete that, you can decide what to do next. Note down any specific questions you have and ask ChatGPT about them, but try not to use the code it provides and instead write everything yourself, so that you get comfortable with coming up with solutions.

    • @Tariq10x
      @Tariq10x  14 วันที่ผ่านมา +1

      As Martin pointed out, it depends on your background and what you want to do. A codebase like this is not something you would do as your first project. I made a video „want to start coding?“ for beginners which is full with learning material, so you can take a look there. If you are someone studying CS or something similar I would highly recommend to get an Internship as early as possible. If you are still in school, then going for a CS degree is a good base. If none of this applies, then go watch my video and go through the resources there, there’s a lot of self taught people working in software, but it’s important to note that it is getting harder for anyone without professional experience to get a job in the last few years.

    • @WannesVantorre
      @WannesVantorre 6 วันที่ผ่านมา

      As someone who is self taught. Martin is spot on!
      That **is** the easiest and most effective way to do it.

  • @kruger5394
    @kruger5394 8 วันที่ผ่านมา +2

    1:25 man you killed me 😂😂😂

    • @Tariq10x
      @Tariq10x  5 วันที่ผ่านมา

      💥🔫🔫

  • @StefanReich
    @StefanReich 13 วันที่ผ่านมา

    How did they reverse engineer this? Did the game ship with debug symbols? Otherwise they'd have to guess every single identifier which sounds really, really hard

  • @maximizer174
    @maximizer174 14 วันที่ผ่านมา +1

    I am at my second semester of my CS degree. I have just completed java oop. How much more do I need to learn to understand all these stuffs? (C++ Language is not a problem to me)

    • @Taher_M
      @Taher_M 13 วันที่ผ่านมา +2

      a lot more!

    • @nikolaynakorkeshko448
      @nikolaynakorkeshko448 13 วันที่ผ่านมา +1

      You need to practice, a lot of practice

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

    Make a source code review of blue sky social. It’s a twitter alternetive.

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

    Buy house 💀
    Talk to girls ☠️

  • @lucasfranca9006
    @lucasfranca9006 19 วันที่ผ่านมา +2

    Great video !

  • @asadasada-e6s
    @asadasada-e6s 10 วันที่ผ่านมา

    IMO not being able to read and understand properly named code without comments is a skill issue.

  • @atabac
    @atabac 14 วันที่ผ่านมา

    whats the link of the code?

  • @patrickrios67
    @patrickrios67 14 วันที่ผ่านมา

    please, do the leaked source code of first FarCry game

  • @guiAI
    @guiAI 14 วันที่ผ่านมา +1

    your comment on third world country accent made me subscribe

  • @klod1duraku
    @klod1duraku 15 วันที่ผ่านมา

    The start😅

  • @iraf.official
    @iraf.official 9 วันที่ผ่านมา +1

    😎😎😎👌👌👌

  • @akashsonar6332
    @akashsonar6332 17 วันที่ผ่านมา +3

    What do you mean when you said " Only and Only for educational purposes, what were you thinking we would do ? "

  • @iraf.official
    @iraf.official 9 วันที่ผ่านมา +1

    🤯🤯🤯🤯

  • @steven1671
    @steven1671 15 วันที่ผ่านมา +1

    Inheritance? Why does everyone have an inheritance fetish?

    • @iCrimzon
      @iCrimzon 15 วันที่ผ่านมา +1

      I dont like OOP and dont use it so from a Go perspective where i use structs for inheritance, when you define something like type Player struct { Name string X-Position float64 Y-Position float64 } (idk game programming), it makes it easier to just call Player.X-Position and adjust it without any of the headaches involved, im not very good at explaining but im sure it makes sense when you look at it and think about it

    • @arjix8738
      @arjix8738 14 วันที่ผ่านมา

      Inheritance is great, but not the java-style inheritance, that shit belongs to hell

    • @steven1671
      @steven1671 14 วันที่ผ่านมา

      @@arjix8738 Why is inheritance great? Languages like Haskell, F#, Rust don’t have it at all. Proof that it’s not even necessary.

    • @criptych
      @criptych 13 วันที่ผ่านมา +1

      @@steven1671 Why is async great? Languages like C, Fortan, COBOL, don't have it at all. Proof that it's not even necessary.

    • @steven1671
      @steven1671 13 วันที่ผ่านมา

      @@criptych Async is great. I work with it all the time in C#. It basically synchronizes asynchronous code. So if you have one microservice sending messages to the other, you can write code that basically says “once you get a message, I want you to do this.” Doing that without async is usually done with callbacks, which do not compose well. But async composes as well as regular variables do. It basically completely abstracts away the fact that the data is not there yet. Also none of those languages you mentioned have inheritance at all either lol.

  • @FaceFirst
    @FaceFirst 14 วันที่ผ่านมา +8

    "Object oriented programming has its place" What?!?! It does not only have its place its in 98% of usecases the best usecase

    • @TheCommunistRabbit
      @TheCommunistRabbit 12 วันที่ผ่านมา +5

      Hell nah, oop makes stuff work seemingly by magic, it's impossible to see how the underlying thing Is working, and you usually need to dig through like 4-8 classes to understand the object fully.

    • @dminik9196
      @dminik9196 3 วันที่ผ่านมา +1

      In "98%" of use cases it's the wrong choice. There's places where it's usable or maybe even preferred, but it should not be the only tool in your toolbox.
      What's actually useful about OOP is the concepts of abstraction, encapsulation and so on. But while OOP does give you these it also has many drawbacks. You can get these out of other programming models/techniques without getting the same drawbacks.

  • @ManthaarJanyaro
    @ManthaarJanyaro 18 วันที่ผ่านมา

    777 Views, ❤

  • @Taher_M
    @Taher_M 13 วันที่ผ่านมา +1

    This was personal @ 0:06 🥲

  • @AAKalam
    @AAKalam 15 วันที่ผ่านมา +1

    LoL the starting was fure 🤣🤌