Skip to content
HomeVideos
AllLongsCategoriesPlaylists
BooksBlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K

    Handmade Hero Day 021 - Loading Game Code Dynamically

    Molly Rocket

    2 HN recommenders · recommended in 3 months, 2021–2024

    YouTube

    1:43:46 · 83K views · Dec 16, 2014

    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.

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

    Games & Game DevelopmentGame programming & enginesC, C++, Rust, Go & systems languages
    1. 1:13:51
      Handmade Hero Day 001 - Setting Up the Windows BuildMolly Rocket465K views • 11 years ago
    2. 1:11:59
      Intro to C on Windows - Day 1Molly Rocket371K views • 11 years ago
    3. 6:22
      Interactive programming Flappy Bird in ClojureScriptBruce Hauman55K views • 12 years ago
    4. 2:16:18
      Hot Code Reloading in CTsoding Daily94K views • 3 years ago
    5. 1:07:22
      HandmadeCon 2015 - Pat WyattMolly Rocket33K views • 10 years ago
    6. 1:19:52
      CppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”CppCon264K views • 10 years ago
    7. 1:11:48
      HandmadeCon 2015 - Mike ActonMolly Rocket102K views • 10 years ago
    8. 1:22:13
      HandmadeCon 2016 - History of Software Texture Mapping in GamesMolly Rocket15K views • 9 years ago
    9. 7:44
      Handmade Hero | Getting rid of the OOP mindsetvexe167K views • 9 years ago
    10. 45:31
      Bruce Hauman - Developing ClojureScript With FigwheelClojureTV56K views • 11 years ago
    11. 6:39
      Making MetagunNizzotch763K views • 16 years ago
    12. 1:55:24
      Ideas about a new programming language for games.Jonathan Blow530K views • 12 years ago
    13. 1:04:33
      CppCon 2014: Jeff Preshing "How Ubisoft Develops Games for Multicore - Before and After C++11"CppCon53K views • 12 years ago
    14. 10:30
      Unreal Engine 4 - GT.TV Exclusive Development WalkthroughGameTrailers972K views • 14 years ago
    15. 50:00
      Killing the Walk MonsterMolly Rocket59K views • 6 years ago
    16. 42:30
      RustConf 2018 - Closing Keynote - Using Rust For Game Development by Catherine WestRust Programming Language152K views • 8 years ago
    17. 27:56
      Unity DOTS vs Handbuilt: Sample ProjectNick Caston687K views • 6 years ago
    18. 1:41:38
      Mock Interview with Shawn McGrathMolly Rocket45K views • 9 years ago
    19. 1:02:49
      Reboot Develop 2017 - Jonathan Blow, Thekla Inc. / Making Game Programming Less TerribleReboot Develop113K views • 9 years ago
    20. 12:09
      How I Fixed a 10 Year Old Guitar Hero Bug Without the Source CodeExileLord404K views • 9 years ago

    4 comments from Hacker News

    1. @coleyOct 2022· in “Anatomy of Linux Dynamic Libraries”

      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. Being new to this technique, I was impressed to say the least. I always assumed the same functionality was available in the linux environment, but I hadn't bothered to look it up. Now I know. For those who want to learn how to do this in Win32, here's the episode I mentioned above - this video

      RecommendsView on HN
    2. @kleibaJan 2024· in “C and C++ Hot-Reload/Live Coding”

      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. this video

      RecommendsView on HN
    3. @59nadirJan 2024· in “Show HN: Hook – a simple graphical C/C++ runtime editor”

      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're developing as well, but I wouldn't necessarily call that trivial. Recompiling a shared library and hot reloading it if it's changed is (on the order of 20 or so lines), though, and I wouldn't expect any game to be developed without at least some code being reloaded this way. While I haven't seen it as much, developing servers this way is also very doable, depending on how much you have to change data structures that have to be kept around. Edit: See this video for an example of how trivial it is to get this using just your OS facilities (`stat` + `LoadLibrary`/`dlopen`). None of this stuff is new and it's certainly been used with C/C++ or any language like it for a very, very long time.

      CitesView on HN
    4. @nextaccounticNov 2021· in “Paradox of the perfect code editor”

      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" this video (this video by Casey Muratori is btw where I first heard about this technique) There's a bunch of other libraries that work the same way, and some example code that can do this. I can find [LINK] and [LINK] and [LINK] and [LINK] And there's [LINK] which has a nice API but uses a deprecated rustc internal API and doesn't build anymore. Anyway there was a library that did this in a more elegant way and I just can't find it (perhaps it was rust-hotswap?).

      CitesView on HN