Godot Version
Godot 4
Question
So, I’m creating a debug overlay for my game to help with diagnosing issues during development, similar to what Minecraft has. It displays various stats for the player and world which are retrieved from the respective nodes.
My question is this: what is the best way to send the stats to the overlay? Currently I have signals being emitted which sends the data to the overlay for updating, however as the number of stats increases, this could obviously get pretty overwhelming quite quickly. Also, with many of the stats needing to be updated every frame (such as velocity or position etc.), I wonder about the performance impact this would have with lots of signals.
Another option would be to group the signals per node such that each node that reports to the overlay only has 1 signal with a dictionary containing all the stats from that node, however this also leads to additional data being sent when it’s not needed (such as for values that stay the same over multiple frames).
Alternatively, I could reverse it and have the overlay request the information as it needs it (which I’ll do anyway for some things such as system information like fps etc.). This would reduce the amount of data being sent to only what’s necessary, but it also requires the overlay to keep track of the nodes itself, making it quite a tightly coupled system.
Keen to hear any advice people have regarding this or if you’ve done something similar. What worked, what didn’t, and how to minimise the performance impact.