TIC-80
TIC-80 copied to clipboard
Perfomance Monitor/ Get FPS
Tools like FPS, CPU usage, Memory would be nice for optimizing our code. Working on very demanding games it is hard to tell if a code change effects frame-rate much. At least having a built in fps function would be very appreciated.
I started working on a profiler for TIC-80 in a fork. You can see what I have so far in schraf/TIC-80. It shows the frame time in the top panel, the frame details in the middle panel, and then the memory usage in the bottom panel. Looking for feedback. It still needs some polish and minor bug fixes, but I think it is almost there. To add profile markers to the code you need to add perfbegin("some tag") and then a perfend() call. It should be fairly low overhead to use.

is it ready or abandoned?
I tried to keep it updated with the master branch but eventually stopped working on my TIC-80 project. Not sure how hard the merge would be at this point. If I recall the feature itself was pretty much working with maybe some edge cases that still needed to be addressed.
Working on very demanding games
Do you have an example of such a game, just for reference?
. At least having a built in fps function would be very appreciated.
I actually don't think this is what we want if we're trying to make games that work for everyone. What matters is the lowest common denominator setup, not someone's personal development workstation. You might not be dropping frames, but your game might still be WAY too slow on someone else's setup.
That's the information you really need to know.
This is related to #1788. If we could figure out what a proper "expense" per frame was (that wasn't bound to CPU speed) then we could easily tell if someone was within that constraint or not. You could back convert this metric into a FPS (or "CPU" like) calculation (like Pico-8) does, but really you just want an absolute way of measuring resources consumed against some idea of what a "good" utilization actually is.
If you're dropping frames on MODERN hardware you're way, way off into dangerous territory. We need to provide warnings way before someone would start skipping frames on most modern PCs.
Do you have an example of such a game, just for reference?
I'd love it if we had an example of some carts that were CPU (math) bound rather than drawing bound...

See "CPU" utilization meter in bottom right.
I'd love it if we had an example of some carts that were CPU (math) bound rather than drawing bound...
As you said it depends on the machine you use. On my nintendo 2DS this cart https://tic80.com/play?cart=2452 is CPU bound at the beginning of the game when the bot has to test many options. It could be CPU bound on any machine if I was using brute-force methods. (Note that it's also far from being optimized, I'm not a programmer even though I love coding ^^.)