Accurate FPS && HUD
Dekita
Introduction:
The purpose of this script is to give the developer an accurate representation of your frames per second and a small hud to display it.
The default FPS counter (seen by pressing F2 in game) can be wildly inaccurate depending on your setup.
IMO - the purpose of a frames per second display, is to show how many times your frames are being refreshed each second.
For some reason, the F2 FPS counter is quite different from the actual amount of updates the Graphics module processes each second.
Simply pop the script in your game in a new script page and a small hud will be displayed. The hud settings can be configured slightly in the Real_FPS customization module.
Along with showing you the real FPS rate, this script gives you an average FPS rate and a total target rate, target rate shows you the percentage of which your games FPS has been equal to the target FPS since the last average FPS refresh occurred..
Hello.
The FPS display of Ace is
very accurate, but you are misunderstanding it's purpose. F2 FPS display will show you how many times the screen was drawn in a second, not how many iterations were processed in a second. Your script actually shows how many
iterations were processed, so your HUD can say 20 FPS but the actual number of times the screen was drawn in a second can be 4 instead.
This is because how the actual hidden update method works, it doesn't draw the screen each time it's being called, it has it's own set of rules for frame skipping that we can just guess without seeing the actual code.
If you want it to actually draw the screen each time Graphics.update it's being called, you would have to call frame_reset before executing it to break its internal timing for frame skipping. Like this:
module Graphics class << self alias_method
:)original_update, :update) def update # This will reset the internal frame skipping timer so that the # screen is drawn at each update call. frame_reset original_update end endendBy using the code above, you will actually experience lag as a slow motion effect, things will appear to go smooth but slow, if that makes sense...
So, in reality, your script is an inaccurate FPS display (unless the code above is executed and thus making the screen draw happen every iteration, consequently making iterations per second same as frames drawn per second.) but an accurate iterations per second display.