[video output=day179 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Tracking Debug Information Over Time" vod_platform=youtube id=k_1FzhI3kv4 annotator=Miblo annotator=debiatan]
[0:43][Rant: Dedicate this episode to an awful company][quote 213]
[5:41][Boot this up on maybe the last version of Windows which works in terms of rendering fonts][quote 214]
[6:30][Apologise to those following along at home on Windows 8][quote 215]
[7:07][Our debug timer system is still missing some important functionality:]
[7:26][1) The timings are hard to visualize]
[8:33][2) It lacks the ability to point out which code is responsible for missed frames or other performance issues]
[10:32][We want to keep a longer history of the values of our performance counters]
[12:22][We are interested in keeping track of events that happen in the platform-specific layer, so some part of the debug system will have to live there]
[14:09][The platform layer will announce the end of each frame to the debug system]
[17:34][The platform layer will also inform the debug system of several other events]
[35:21][Writing the plumbing around DEBUGGameFrameEnd]
[37:00][Allocating debug memory on the platform layer]
[38:27][Improvising the set of structs that will keep track of the values of our counters]
[41:00][Modifying OverlayCycleCounters to use the debug memory]
[43:34][Making DEBUGGameFrameEnd  update the debug records]
[46:50][Allocating some memory for the debug storage]
[48:21][The debug information is now piped through the new system]
[48:38][Recording the snapshots into a rolling buffer]
[50:27][Recording the minimum, maximum and average values of timers]
[55:43][Using double precision for the values of timers]
[58:03][Printing out the statistics]
[58:49][The output looks incorrect because we're not using the appropriate type specifier for the timers in _snprintf_s]
[59:43][(Blackboard) Deriving the correct expression for the average cycles/hit. (Although it should be hits/cycle; see Q at 1:07:29)]
[1:05:44][Q&A][:speech]
[1:06:15][Song: 'Questions For Me' by Casey Muratori]
[1:06:25][@elxenoaizd][Is a C compiler faster in compiling C code than a C++ compiler compiling C-like C++?]
[1:07:23][@TheSizik][Shouldn't it be CycleOverHit?]
[1:07:29][handmade.cpp: Change HitOverCycle to CycleOverHit]
[1:07:43][@elxenoaizd][Is there a standard / portable way in C to get a FILE* to a block / region in memory? In Linux there's fmemopen but I can't seem to find an equivalent in Windows. Internet seems to suggest MapViewOfFile but I don't think that is it, I don't want a memory mapped file, just FILE* to a memory region. Does such a thing exist or am I looking at this the wrong way?]
[1:09:16][@CaptainKraft][Are there inherent problems with using composition for writing game engines like there are problems with OOP?]
[1:09:38][@elxenoaizd][Why is the preprocessor able to convert a parameter to a string via the # symbol, but not the other way around, i.e. string stripping, taking the inner value of the string and pasting it? My guess is that it's because this would not make it possible for the macro to be determined at compile time since we can pass it arbitrary strings?]
[1:11:04][@Culver_Fly][Unless I missed it, shouldn't it be CycleOverHit rather than HitOverCycle?]
[1:11:14][@Pseudonym73][Averages of averages need to be weighted by the population size. This is a common mistake that you even see in scientific papers that try to combine the results of other scientific papers]
[1:12:07][@JiveDude][Turbo C's successor is C++ Builder from Embarcadero]
[1:12:29][@elxenoaizd][Metaprogramming question: Let's say I want to have a generic dynamic list (resizable array) in my game library. Void-pointers and macros are two ways of approaching this; another is generating the code for the unique list types I want. Is this what you mean when you say "I write C programs that spit out C programs"? If so, can we do this generation at compile-time (like we can do in jai) or are we forced to write and run an executable that does the generation for us?]
[1:13:29][@CaptainKraft][With respect to composition: I have a Player struct that has various other structs to represent what the player is composed of. One could be the Object struct which is added to any entity in the game that I want to behave like an object. Then I create functions that run on objects such as objectMove(Object *obj) so that anything that I want to move in the game would simply have an Object struct within it]
[1:14:29][@CaptainKraft][When writing game engines, how much should a programmer know about how the compiler works, and what is a good way to learn what is going on under the hood?]
[1:15:49][@BigCat_CK][Hey! I am looking to pick up programming, I have some basic knowledge but really would like to know where to get started and any suggested languages you might think are a good place to start]
[1:16:34][@steveindusteves][How much more engine work are we going to do before diving into gameplay stuff?]
[1:18:15][@Jonks1234][Can you run around in the game a little bit? The last time I watched was a month or two ago and I'd love to see how it's progressed]
[1:19:41][@CaptainKraft][Your thoughts on using a scripting language with the game engine?]
[1:20:04][@blah238][For the performance counters, could you perhaps color-code them according to how far outside of an ideal or expected range they are? Similarly is there a way to (roughly) estimate the ideal cycle count of a function?]
[1:20:46][@Childz][I have an interview tomorrow and I'm going to have to whiteboard. How to not be nervous?]
[1:25:54][That's about it for today][:speech]
[/video]
