Handmade Hero Day 021 - Loading Game Code Dynamically

Channel:Molly Rocket · Length:1:43:46 · Published:2014-12-16 · Views:83579

Watch on YouTube

Summary

Day 21 of Casey Muratori's Handmade Hero, which covers loading game code dynamically from a DLL on Windows. He builds hot reloading of C game code from scratch in about an hour and a half.

Why HN recommends it

Recommended as a clear, from-scratch demonstration of how simple code hot-reloading is with plain OS facilities.

Casey Muratori writes a hot-reloading functionality for C from scratch in about an hour — HN, 2024

C, C++, Rust, Go & systems languages · Game programming & engines

Subtitles (excerpt)

a clean record all right hello everyone and welcome to handmade hero the show where we code a complete game live on Twitch from scratch no engine no libraries no nothing uh just so we can learn basically everything that is involved in the complete sort of uh software stack of a game all the way down to the hardware which I think is actually really important and is uh becoming a little bit more of a lost start these days so this project kind of an attempt to bring that back to basically have everything there from start to finish so anyone who wants to really study uh how games work through the entire uh pipeline through the entire code base have the opportunity to do so and I think it's really great too just in general for everyone to kind of be aware of this sort of stuff I know it certainly makes it much easier for me to do uh any kind of work that I'm doing on games whether it it happens to be using libraries or happens to be using engines or not because you can always go in there and fix stuff you can debug so much more effectively you can know when something is suspicious uh just when you have sort of that that kind of um that kind of full background so that's we're doing here and we have basically finished um sort

On Hacker News

In one of the earlier episodes of the Handmade Hero series, Casey Muratori writes a hot-reloading functionality for C from scratch in about an hour (while giving detailed explanations of what he's doing). The following two episodes then improve upon the initial results. [VIDEO] — kleiba, 2024-01
The first time I learned about dynamic loading was while watching an episode of Casey Muratori's Handmade Hero - a series where he builds a video game, in C, from scratch. He compiles the game code as a dll and dynamically loads it at runtime in the Win32 platform layer code. This way he can keep platform code and game code separate and reload the game code at runtime if any changes are made. Bei… — coley, 2022-10
I don't think any game engine in use today except maybe the ultra-general ones would be without sections that are recompiled and reloaded live for gameplay code in this fashion. For all I know the ultra-general ones probably do it some stupidly complex way that sucks because they're overthinking things. Most setups will likely stream both code and assets to wherever the game is running while you'… — 59nadir, 2024-01
Yes. On Rust specifically [LINK] (discussed here [LINK] ) And then there's this crate [LINK] which works on the same principles as the article above, and is based on C code (i.e. the same approach works for C). On the documentation there's links to "Interactive Programming in C" [LINK] and "Loading Game Code Dynamically" [VIDEO] (this video by Casey Muratori is btw where I first heard about this … — nextaccountic, 2021-11

Related videos