Another approach is one i used for a profiler i wrote some time ago (and want to port to Linux at some point)[1] which displays the hottest "traces" (i.e. callstacks). One neat aspect of this is that you can merge multiple traces using a single function as the "head" (so, e.g., if there are two separate traces that contain a function "Foo" somewhere, you can select to use "Foo" as the starting point and they'll be treated as the same trace with their hitcounts combined).
Also this hacking started early on, so there is probably tons and tons of documentation and data, again making it a great candidate to work with it from a hacking perspective.
It was a game that clearly advanced the state of the art. Even in the month before it came out, people were claiming it simply could not be done technically on the underpowered PC technology of that time. Even after it came out, it took others a year to catch up.
Expectations at release were sky high, and Doom still overdelivered. The tech, the gameplay, the esport aspect, the gritty graphics theming. It was all new and daring.
The BSP was an obscure thing nobody understood. It took the DEU people months to wrap their heads around the NODES datastructure.
When the modding tools were finally available, the whole world became 1 big modding community for the same game. That amount of focus on 1 game has never happened before or since. Modding continues to this day, 30 years later.
Then the source code was delivered, for free, to everyone. It was easily readable and told every secret. We all went crazy. It was studied by every programming student. Even today, no other codebase has the same amount of scrutinity, with every bug and detail documented.
Myhouse.wad was a great example of how far a doom mod can be pushed. But it is also a testament to the collective midlife crisis of the doomers from that age, all of us yearning for the good old days.
forrestthewoods•16h ago
I’ll be honest, I kinda don’t get flame graphs. I mean I understand what they are. I have just always strictly preferred a proper timeline view ala Superluminal or Tracy.
Using 20ms chunks for a game is fine but also super weird. Ain’t no game using 20ms frames! So if you were using this for real you’d get all kinds of oddities. Just give me a timeline and call it a day plz.
tibbar•15h ago
Veserv•13h ago
It is like the difference between seeing the mean of a distribution and seeing a plot of every datapoint in the distribution. They are useful for different purposes.
An example of how you might use it in conjunction with a trace visualizer is that you would select a time span in a trace and generate a flame graph for the selection. This would show you which functions and call stacks were responsible for most of the execution time in the selection. You would then use that to find one of those call stacks in the trace to examine how they execute to see if it makes sense.
gerdesj•13h ago
So, you have your game model, input and output. Output needs to be good enough to convince you that you are in control and immersive enough to keep you engaged and input needs to be responsive enough to feel that you are in control. The model needs to keep track of and co-ordinate everything.
I'm old enough to still own a Commodore 64 and before that I played games and wrote some shit ones on ZX 80, 81 and Speccies. I typed in a lot of DATA statements back in the day (40 odd years ago)!
When you pare back a game to the bare basics - run it on a box with KB to deal with instead of GB - you quite quickly get to understand constraints.
Things are now way more complicated. You have to decide whether to use the CPU or the GPU for each task.
fennecbutt•13h ago
It makes it a lot easier to visualise at a glance, and sometimes an issue is obvious from the flame graph.
But you're right, for complex issues I find I need to dig deeper than that and view everything linearly.
They're just nice for glaring issues, it's like a mini dashboard almost.
bobmcnamara•12h ago
Edit: also my laptop can, but I'm not into that sort of thing.
brendangregg•12h ago
I think great UI should do both: have a toggle for switching between flame graphs (the summary) and timelines (aka "flame charts") for analyzing time-based patterns. I've encouraged this before and now some do provide that toggle, like Firefox's profiler (Flame Graphs and Stack Charts for timeline view).
As for 20ms, yes, we do want to take it down. A previous HN comment from years ago, when I first published FlameScope, was to put a game frame on the y-axis instead of 1 second, so now each column shows the rendering of a game frame, and you can see time-offset patterns across the frames (better than a time-series timeline). We started work on it and I was hoping to include it in this post. Maybe next one.
forrestthewoods•11h ago
So what I want is the ability to view each subsystem in a manner that lets me see when it didn’t hit its update rate. I have many many different frame rates I care about hitting.
Of course things even get more complex when you have all the work broadly distributed with a job system…
foota•11h ago
Sandwich views supporting collapsing recursion are the secret sauce for flame graphs imo. See e.g,. https://pyroscope.io/blog/introducing-sandwich-view/
coherentpony•11h ago
A frame every 20ms equates to 50 frames per second. Doesn't seem too unreasonable for a modern game.
60 frames per second would be one frame every ~16 ms.
forrestthewoods•10h ago
brendangregg•10h ago
When Martin, my colleague at Netflix at the time, built a d3 version of FlameScope, he put a row selector in the UI: https://github.com/Netflix/flamescope
wtallis•6h ago
forrestthewoods•4h ago
Flamegraphs are a nice tool to have in the bag I suppose. But they’re more tertiary than primary or even secondary to me.