[video output=day023 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Looped Live Code Editing" vod_platform=youtube id=xrUSrVvB21c annotator=schme annotator=garlandobloom]
[2:45][Review of the live code editing feature]
[4:13][Building a demo to show gameplay tuning workflow]
[9:00][Testing the demo]
[11:20][Adding jumping]
[14:10][Necessary improvements to square drawing]
[15:44][Jump tuning]
[16:52][Problems with gameplay tuning and a solution]
[18:19][Making a loop editor for code]
[19:33][The ease of storing the input stream in memory]
[20:25][Writing it out to disk instead]
[21:49][Creating a win32_state structure that we can pass around]
[22:30][Press L to record]
[24:41][Usage code for recording and playback]
[25:36][Implementing the record and playback functions]
[28:14][Functions to handle the recording output file]
[31:04][Functions to handle reading in the recording file]
[32:22][Some code to loop the input playback]
[34:56][Testing the recording and playback]
[37:48][Bug-fixing]
[40:06][Input record success, moving on to record game state]
[42:27][Implementing recording of game state]
[47:54][Testing, and a failure to loop]
[49:43][Successful looped editing demonstration]
[54:50][Playing around with window types]
[59:47][Transparent Window! And Access Violation!]
[1:01:56][Improvements to transparent window.]
[1:03:47][Final Thoughts]
[1:06:24][Q&A][:speech]
[1:06:50][Does Win32PlayBackInput need to return status in case the file read fails and/or reaches the end, since in those cases the function output data structures will be stale or invalid?]
[1:08:36][Will this break when you make changes to the game_state structure?]
[1:11:30][Why didn't you use a switch for all the VKCode stuff?]
[1:11:54][Since it's mostly zeroes, do you think it'd be worth writing out the game state in a sparse way using a simple RLE or something, or is performance sufficient? Or perhaps that would make performance worse?]
[1:13:22][What's on the schedule for next week?]
[1:13:57][Are you going to show how to create more debug tools like this?]
[1:15:01][Regarding saving game state for recording, won't we run into problems if we port a system that doesn't allow us to specify a base address?]
[1:16:08][Any chance for a high-level overview while cleaning up?]
[1:16:45][Isn't a two gig snapshot of your game memory crazy huge though?]
[1:19:17][I think your sine wave is a tad bit off on land of the jump.]
[1:19:38][I'm thinking maybe less about the error and more about what happens at the end of the stream when it loops, doesn't that generate an extra repeated input event played back, or am I missing something?]
[1:21:25][Can you clarify if function pointers are part of that game_state block, maybe elaborate on what could ever cause it to fail or misalign?]
[1:24:26][How can we make the playback work if we have no base address?]
[1:25:40][Wouldn't the address spaces of two game_state's clash?]
[1:27:00][Would a memory-mapped file that doesn't commit to disk be faster to read/write from?]
[1:27:58][I thought you were going to use the memory snapshot as a game save, but you're using it like a save state in an emulator.]
[1:28:30][How easy do you think it is to re-arrange an existing codebase so that it supports the instant live code editing feature, and what steps would need to be taken to get there?]
[1:30:02][Will there be a Christmas special?]
[1:30:18][How will replay work once you have start-up logic for the game? How will it be skipped? Will it just work?]
[1:31:04][Clarification of earlier question (How often do you look up code?) How often do you study code on your own?]
[1:33:22][Perhaps ReBaseImage() regarding loading dll at location?]
[1:33:51][Suggestion to add -mix to the linker for fixed dll location.]
[1:35:14][How long did it take for you to get to a point where you can concieve of a feature and with little effort know exactly what you need to accomplish to realize that feature?]
[1:38:43][Couldn't you create an offset pointer struct which overloads the unary * operator?]
[1:40:43][Have you got some good explanation on how you architect code, is that in the text you wrote about your work on the Witness?]
[1:42:06][I have to spend a lot of time unlearning what I was taught just to get to features which should be easy, but were made hard by the kind of programming I learned in school. Have you had a similar painful unlearning process?]
[1:44:51][Wrap-up][:speech]
[/video]
