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

49 lines
4.3 KiB
Plaintext
Raw Normal View History

[video member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Adding Debug Graphs" vod_platform=youtube id=U2RnqT6xSFk annotator=Miblo annotator=debiatan]
[0:11][We will replace the C standard library functions at some point]
[2:45][Recap]
[4:06][Let's display the debug information in a more useful way]
[4:50][Moving the debug code into handmade_debug.cpp]
[8:05][Graphing the values of timers]
[8:44][Displaying also the counters that have not been updated in the last frame]
[10:13][We will pick the maximum value of a timer over a period of time and use it to scale its plot]
[12:34][Drawing a rectangle for each counter]
[14:32][Plotting the rectangles next to the text, aligned to its baseline]
[15:56][Using the ascender height of the text as the chart height]
[16:24][The debug display code needs simpler access to font information]
[17:38][Using the relative value of the timer with respect to its maximum value to modulate the color of the rectangle]
[20:09][Testing the code so far. Our heartbeat graph doesn't line up with the text]
[20:56][Centering the timer plots with respect to the text]
[21:46][The automatic change of scale of the timer plots is not perfect, but there's no immediate way to solve it]
[23:54][Adjusting the plot sizes]
[25:51][Some of the performance counters are never hit and they show as "null". We won't be drawing those]
[27:58][We will save the platform layer debug_frame_end_info timings also as snapshots and we will display them as a stacked graph]
[29:30][Moving the DEBUGGameFrameEnd function to handmade_debug.cpp]
[32:28][Capturing debug_frame_end_info snapshots]
[33:55][The order of the debug_frame_end_info fields is specific to the platform layer and it shouldn't be]
[34:57][Transforming the individual debug_frame_end_info counters into an array of self-describing debug_frame_timestamps]
[37:01][Now we can iterate over all platform timestamps and plot them as a set of stacked bars]
[38:50][Using the inverse of our framerate (33 ms) as chart height]
[45:52][Implementing RecordTimeStamp]
[50:30][Testing the stacked bar chart. It's not positioned correctly]
[52:40][The plot seems to be overshooting 33 ms. Let's draw a reference line to check that]
[54:16][Yes, we're missing the target framerate]
[54:53][Color-coding the stacked rectangles to tell them apart more easily]
[57:10][Testing the color-coded rectangles. The plot doesn't look right]
[57:53][We never bothered to stack the rectangles!]
[58:29][It works now and the majority of the time is spent inside the GameUpdateAndRender function]
[59:52][Q&A]
[1:01:41][@BrainCruser][Doesn't the multi-core rendering screw up your timing?]
[1:02:37][@ifingerbangedurcat][Can you briefly explain how it tracks how long it takes the frame to work and the render engine to work if rendering the debug is part of that work? Also a suggestion, use a key to toggle the debug display to see the game]
[1:05:52][@garlandobloom][Did you get 4coder set up?]
[1:06:17][@ciutchism][Do you ever think it's amazing how 100s of designers can screw up a project by trying to be complex when indie designers can make a better game in a few months?]
[1:09:38][@griggs3d07][You mentioned that the way you draw rects is not optimized. What do you want to change?]
[1:10:44][@Stephenlast][Because you're using rendering on multiple threads, is it saying that you're spending more cycles in DrawRectangle / DrawRectangleQuickly than GameUpdateAndRender?]
[1:12:26][@Mojobojo][Why are you echoing to lock.tmp in your bat file?]
[1:14:13][@jfcatalan][So after "lib freedom week" we could reasonably easily boot HH off something like baremetalOS and go all "look 'ma no OS" (minus sound I guess)?]
[1:15:00][@inquarry][Will HH be optimized for GPUs or are you sticking to CPU render? Will that be an arduous task or pretty straight forward?]
[1:15:32][@ciutchism][If I have a simple app concept that I can't code myself because I'm a scrub, is there any good way to get somebody to make an app for me that is somewhat simplistic and we split profits or even I just get 10%? I don't care about the profits I just want to help develop the app]
[1:16:12][@SeargeDP][Why are you not using visual studio to write your code? It seems to be a windows machine you are working on]
[1:16:51][Close outta here]
[1:17:25][Announcement: GitHub private repository now available for those who preorder the source]
[/video]