Handmade Hero

About

Fun facts about Casey
  • "Knowledge I've built over 30 years, 20 years professionally".

  • He was 38 when he started making the episodes.

  • He thinks SDL is quite respectable.

  • He says he's not a game designer and really doesn't seem like a game designer.

  • He likes Functional Programming

    • "I tend to push FP when I can, but not as a dogma".

    • Likes immutability, etc., and tries to do that where possible.

  • If he weren't programming in C, he'd do it in Assembly.

  • "There will be no GUIs in this game".

Episodes

  • I did watch some other episodes, but I forgot to put it here.

~Ep 1 to 10 ("bootstrap", pseudo-platform layer)
  • Initial setup.

  • The introduction is very complex and deep.

  • Compilers, etc.

  • Some small off-topic bits.

  • "bootstrap" with the Windows API.

  • XInput lib for inputs.

  • DSound lib for audio.

  • Everything is done in a single script called win32_handmade.cpp .

  • "We did a lot so that we don't have to think about Windows anymore, going forwards".

  • I learned that the Windows API is terrible.

Ep 11
  • Starts with a good summary, clarifying differences when porting to different platforms, etc.

  • Things missing from the win32_handmade.cpp  file that will be done later:

    • .

  • {13:37 -> 31:41}

    • Great explanation and alternative for the app to be cross-platform.

  • {1:27:18}

    • Shows the use of "#include guards" to avoid defining things twice, so the same file isn't imported more than once.

  • {34:23 -> 41:45}

    • Creation of an Interface for implementing structs to be cross-platform.

      • He claims it's an Interface.

    • He doesn't like this approach much.

      • He says he prefers a different approach, "many-to-one".

      • Overall, I didn't fully understand the difference between this approach and the other described.

  • "There's no game in this 'platform layer', so you can use it for any game you want".

    • "I always use the same platform".

  • {1:27:18}

    • Shows the use of "#include guards" to avoid defining things twice, so the same file isn't imported more than once.

  • At the end of the video, you basically have a setup close to """"RayLib"""" / """SDL"""", finally.

Ep 26 - Game Architecture
  • Starts explaining software architecture concepts and game architecture.

  • "Until now I knew perfectly what I wanted to do, we made the Platform Layer, with Win32 and OpenGL and D3D (Direct3D), but from now on it will be a period of discoveries".

  • The game loop was planned a bit, kinda.

  • No code was written.

Ep 27
  • Draws a diagram to understand the project's state.

  • "This is basically day 1".

  • Characteristics of his game :

    • Grid-based world, but not looking like a grid.

    • "totally procedural".

      • pain :|||||||

  • "I don't have a plan on how to write those things at all".

  • He's not sure what the final version will be.

Ep 46
  • I watched the Q&A and a few things.

Ep 115 - SIMD Basics
  • Basically an explanation of "lanes" and using SOA to push data efficiently to SIMD instructions.

  • The video is about implementing SIMD using SSE/SSE2 processor intrinsics to send 4 pixels at a time to the processor instead of 1.

  • I have no idea why  he's doing this; I don't know how his renderer works, so I can't say the relevance.

  • Overall, the theoretical part of the video is short, the rest is implementation and comments. The video discusses SOA / AOS and SSE/SSE2 processor intrinsics.

Ep 122 - Introduction to Multi-threading
  • {00:00 -> OS}

    • Multithreading, Processes, HyperThreading, Logical Threads, and a bit about CPU Ports.

  • {OS}

    • Talks about Preemption

      • It's something every modern OS uses.

      • From what I understood, it's an 'interrupt' mechanism that causes other threads from other processes to run intermittently during the execution of your code.

      • This is apparently good to be done automatically, because if it weren't, all code would always need to call yield  to give up control.

        • This is a problem if the code is buggy/poor, which can hang the whole CPU core if the OS is not preemptive.

  • {Heat}

    • Talks about Heat.

      • Very interesting explanation about "why isn't everything single-core? why do I need to multithread to get '100%' CPU?".

  • {The rest}

    • Just some demos of creating and joining threads. Nothing special. Skippable.

Ep 277 - Entity Systems
  • {10:27 -> 46:46}

    • Casey explaining Inheritance, Composition, ECS, AOS, SOA

    • "Inheritance is a compression algorithm".

  • He ends up moving to a Sparse Entity System design, which I found a bit suspicious and didn't like much.

Ep 441
  • The first hour of the video is him having trouble with the Nvidia site. Nothing happens.

  • The rest of the video is about Nvidia Nsight, but I didn't watch it.

Chats

Chat 7 - Inverse Kinematics
  • TLDR :

    • He doesn't show any equations or discuss any specific technique.

    • The video is basically to demonstrate the nature and difficulty of the problem.

  • {24:36 -> 36:50}

    • IK is an "underdetermined" system. We don't have enough equations to solve the problem; no amount of direct math will solve this.

    • Examples of artificial criteria  to get out of the underdetermined system:

      • "Try to minimize movement"

      • "try to be as close as possible to the rest state"

      • "try to distribute the motion evenly among all the joints".

  • {40:19}

    • To solve: non-linear, constraints, minimization criteria:

      • Linear Complementary Solver / Lemke's Algorithm.

    • Needing this is not something you want to hear.

  • {43:04}

    • Most of the time you don't need to solve the math. It's not about getting a precise mathematical answer. You just need something that looks good.

  • {47:52}

    • I don't know the state of the art of an "easy" IK.

    • Then he mentions "Cyclic Coordinate Descent", but doesn't explain it.

Chat 11 - Undefined Behavior
  • He criticizes C and C++ a lot for how some things are not well defined, giving an incomplete solution and tool that requires you to understand all edge cases of a specification, which is absurd.

Chat 12 - Impostor Syndrome
  • Interesting.

  • He tries to be objective in judging the person's ability before making assumptions.

  • He also considers the weight of genetics.

  • {26:22}

    • Interesting exercise to find out if the problem is technique or perseverance.

  • {1:16:37}

    • The person gets stuck just reading tutorials.

    • The idea is to make steps and not get lost in scope.

    • Break into smaller problems.

    • Very interesting.

Chat 17 - Modern x64 Architecture and the Cache
Chat 18 - Shimmering artifact in Pixel Art and Nsight Shader Analysis
  • The video is incredibly useful.

  • "This is basically subpixel rendering, that's all it is".

  • {00:00 -> 45:43}

    • Use of Nvidia Nsight to reverse engineer the game Children of Morta, to try to fix the shader problems used.

    • Shows how to use Nsight a bit and comments several things.

    • The shader in Nsight is in ASM.

    • The game uses DX11.

    • He criticizes a lot the mess Unity makes.

  • {45:43 -> 1:21:21}

    • Diagram explanation of the problem and how to solve it.

    • {1:04:00}

      • The problem is well explained.

    • {1:12:00}

      • Explanation of the bilinear filtering equation.

  • {2:03:18 -> 2:13:39}

    • Analyzing and understanding this shader .

Chat 19 - Linear Blend, General Blend Equation, Blend for Mesh Skinning
  • {12:01 -> 21:27}

    • Explanation of linear blend.

      • (1-t) * a - t * b = c

      • If the range is [0, 1] , that's interpolation.

        • "We are inside 2 sample points, in a line, 'inter'".

      • If the range is [-inf, +inf] , that's extrapolation.

    • "Convex means that we stay within the boundaries we are provided".

    • "This linear blend is convex, because we are inside a line".

  • {45:24 -> 52:56}

    • Concludes the subject of Norm, by discussing a 'General Blend Equation'.

    • The example of the discussion comes from him drawing a pentagon, where he discusses using norm to blend between points.

      • Convex Multi-Point Blend.

      • Not solved for the pentagon case.

    • Norm:

      • General formula:

        • norm(g) = (a^g + b^g + c^g + ...)^(1/g)

      • Norm 1: Manhattan Distance.

        • a + b = c

      • Norm 2: Pythagoras.

        • a^2 + b^2 = c^2

    • He shows how it can be written as:

      • p' = w_0 * p_0 + w_1 * p_1 + ... + w_n * p_n

        • "fmad".

        • float multiply add.

      • Where:

        • p  are points.

        • w  are weights.

  • {52:56 -> 1:11:25}

    • Great explanation of mesh skinning.

    • Mesh skinning is making the mesh follow the skeleton's movement.

    • On the left, without mesh skinning. On the right, with mesh skinning.

      • Without mesh skinning, some vertex must be prioritized, causing deformations that collapse faces, producing ugly visuals.

    • .

    • All the Linear Blend explanation becomes useful here to give a nicer deformation effect on the mesh.

  • {1:11:25 -> 1:34:32}

    • Tricks for mesh skinning to work correctly, considering relative transforms, etc.

HandmadeCon

  • HandmadeCon .

    • It happened in 2015 and 2016.

    • I watched Pat Wyatt's talk about networking; cool.