Hello there! I’m glad to share with you my another Asset Store contribution: Advanced FPS Counter!
It’s a simple yet flexible in-game frames per second counter with some additional features.
Here they are:
FPS Counter with optional milliseconds, average, min/max values, render time and customizable coloration intervals
Memory Counter (total reserved, allocated, used by Mono and for dev builds - allocated for graphics driver) with optional precise mode
Device Info (OS, CPU, GPU, RAM, screen info, model)
configurable style and colors for all counters
optional background, shadow and outline effects to increase readability on contrast backgrounds
flexible counters anchoring (allows to anchor any counter to any screen corner) with stacking in seamless group
smart “dirty” update system – counters are updated only when something changes
independent update intervals for FPS and Memory counters
background operation mode (make benchmarks, collect stats, analyze performance and use you UI easily!)
global hotkey to enable / disable plugin with optional modifiers
global gesture to enable / disable plugin on any device, even GearVR
force FPS option to run your game on specified frame rate (useful e.g. for physics debug)
many other features (see inspector screenshot below)
Try it in live WebGL demo (best view in latest Chrome and Firefox)!
Each feature described in more details in User Manual. Also most of inspector settings have tooltips with additional notes.
Plugin has tiny footprint and simple setup.
All settings may be tuned both from inspector and code.
ExampleScene with common API usage examples included.
Works fine on all platforms including VR devices.
Full C# sources included!
I just purchased this, and after importing, I get a bunch of compiler errors, like this:
Assets/CodeStage/AdvancedFPSCounter/Examples/APITester.cs(74,65): error CS1061: Type FPSCounter' does not contain a definition for ResetAverage’ and no extension method ResetAverage' of type FPSCounter’ could be found (are you missing a using directive or an assembly reference?)
Thanks. That got rid of the compiler errors, but now when I put Advanced FPS Counter into my scene, I get a new error:
Instance of AFPSCounterEditor couldn’t be created. The script class needs to derive from ScriptableObject and be placed in the Assets/Editor folder.
EDIT: That error disappears at runtime, but it reappears when I click on the AFPS object in my scene – and that inspector simply says “Multi-object editing is not supported” even though I only have that one object selected in the hierarchy.
Ah, this is a bad news - looks like you need to move Plugins\AdvancedFPSCounter\Scripts\Editor folder right to the Assets root thus its path should became Assets\Editor.
And you need to edit AFPSCounterEditor script itself a bit - remove namespace from it and add line:
using CodeStage.AdvanecedFPSCounter;
to the beginning of file.
I’m really sorry you have to be involved into all this handwork in case you have another script with same name somewhere in project.
This issue already fixed and will be rolled out with next update.
Now I have a problem that’s very particular to my project: I have a four-camera setup to create a fisheye effect, and the AFPS readout is being rendered in all four cameras. I would like it to render in another camera that assembles the four-camera views. Is there any way to specify which camera renders the readout?
Actually there is no such option ATM, it will be rendered by all cameras with GUILayer enabled since it renders via GUIText.
You may try to disable GUILayer component on those four cameras to prevent them from rendering AFPS though.
EDIT: next update will allow you to select Layer for AFPS.
Okay, I can disable GUILayer on the four-camera setup, so now it renders in the correct camera. And selecting Layer would be great. One other suggestion: Add a pixel offset for the corner anchors, to allow for more customized placement.
Any way to add draw calls and other details like the “stats” from Unity Editor’s play mode to Advanced FPS Counter?
I know people probably think those details are useless… but not if I publish a “developer” version of my project to see how things run on other computers…
Hey, BES!
Glad it works for you!
I’m afraid it is pretty hard if possible to count real draw calls amount from code. I’ll investigate it further, but I’d suggest to not await for this feature in near future.
Ok, thanks for the quick response, Advanced FPS Counter will still be very useful for “dev” builds even without the draw calls stuff, just figured I would ask.
Ah, I see now what are you asking about. It shows amount of memory, allocated for not collected mono (managed) objects.
In Flash Player it shows total memory usage by Flash Player plugin process.
Cool plugin! How difficult is it to modify this to work with NGUI label or DF-GUI text? I think on mobile, this will actually show a much worse FPS than is real just because it is using a GUIText (I assume it is using that), because mobile devices perform terribly with GUI Text…
Maybe you should include optional packages in the plugin for users that have those plugins?