cinera_handmade.network/cmuratori/hero/code/code185.hmml

53 lines
4.1 KiB
Plaintext

[video output=day185 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Finishing Basic Debug Collation" vod_platform=youtube id=kkoiLQO5JGo annotator=Miblo annotator=debiatan]
[0:08][Recap and plan for today]
[1:22][We left the code in a non-working state]
[2:37][Review of code from the previous day]
[3:30][Pushing debug frames into the collation memory arena]
[4:40][By using MAX_DEBUG_FRAME_COUNT as the size of our event arrays, we assume that only one frame end event will be issued per frame. Let's get rid of that restriction]
[5:53][Allocating debug_frames]
[6:30][Allocating debug_frame_regions]
[7:55][Testing. We are running out of debugging memory]
[9:00][What is the cause of that error? Are we processing too many frames?]
[9:55][We were treating the whole event array as if it was populated with real events!]
[10:21][The game runs now]
[10:44][(Blackboard) Problems we will face while pairing begin and end events]
[15:22][We will identify the events with a combination of their thread and counter ids. We will pair them using a stack]
[17:58][Forbidding overlapping begin/end paired blocks]
[20:00][Allocating storage for the stack to pair the debug blocks]
[22:58][Using debug_thread to segregate debug blocks according to the threads that originated them]
[27:33][Processing DebugEvent_BeginBlocks]
[29:34][Setting the values of debug_blocks]
[30:42][In DebugEvent_EndBlock we'll find the matching block, if there is one, and pull it out]
[33:39][Finding the frame index associated to the BeginBlock that matches our EndBlock]
[36:20][Drawing a debug region once we find an EndBlock]
[37:41][Yawn][quote 232]
[37:48][On the perils of overeating][quote 233]
[38:03][We will normalize the size of the bar charts with respect to the beginning and ending clock values of the frame]
[41:43][We will only draw top-level blocks, for the moment]
[44:12][Removing matching blocks from the stack]
[45:31][Implementing GetDebugThread]
[47:15][Implementing AddRegion]
[49:50][Scaling the bars using the frame's clock range]
[50:30][Testing. The game seems to loop forever and hang]
[51:13][The bug was that we were not initializing the thread id]
[52:00][Still not running correctly]
[53:35][After increasing the amount of top-level regions per frame, the program works but runs really slowly and does not show the debug bars]
[54:03][Stepping through the code]
[54:31][Keeping the largest FrameBarScale to scale our debug bars]
[57:34][The scale for drawing seems wrong]
[59:06][Let's hardcode the FrameBarScale for the moment for debugging purposes]
[1:00:22][The debug visualization is still not showing properly]
[1:03:32][We were not multiplying the scaling factor by the chart height]
[1:04:34][Q&A][:speech]
[1:05:38][@insofaras][Is there still going to be a debug visualization of the asset memory chunks?]
[1:06:01][@XEnDash][Can you make a mini episode about project management, outsourcing, freelance hiring, etc.? Programming is great but making a game takes more. If not, can you point to good resources on the topic?]
[1:06:20][@elxenoaizd][Do you use the same memory model as in HMH when writing utilities or meta programs, or do you just malloc and it wouldn't matter because the thing runs once, does its thing and closes?]
[1:08:32][@Culver_Fly][What are the pros / cons of viewing debugging information real time vs logging them and viewing them after the fact?]
[1:12:21][@abnercoimbre][Off-topic. People want you to actually drink chocolate wine some time. Are you up for it?]
[1:12:49][@duel1000][Are you going to IndieCade in Culver City? Would you recommend it?]
[1:13:03][@elxenoaizd][Thank you very much for mentioning cmirror. It addresses a lot of my issues directly and is much more human readable. What was the GetToken written for? For config files? Doesn't seem like for C code]
[1:13:44][@XEnDash][How will you debug the OpenGL / Direct3D stuff when you will ship?]
[1:16:13][@davidthomas426][Did I misunderstand mollyrocket.com update, or should there be a comic there today having something to do with your project?][quote 234]
[1:17:50][Wrap up here][:speech]
[/video]