Skip to content

Conversation

w-czerski
Copy link
Contributor

@w-czerski w-czerski commented Feb 27, 2025

About

This PR introduces a game mode fps and memory statistics profiler that exports collected data into a csv file.

Features

The Profiler has an EBus that can control profiling in runtime (start/stop/reset), save profiled data, change save path, and access current frame memory data or fps (avg, min, max). Works with Lua and Script Canvas.

For details please refer to readme.

Saved File Example

Frame FrameTime CurrentFPS MinFPS MaxFPS AvgFPS CpuMemoryUsed GpuMemoryUsed
1 0.1731 0.00 2.38 0.00 0.00 1349.42 1752.12
2 0.4207 2.38 2.38 2.38 1.19 1375.50 2999.38
3 0.1934 5.17 2.38 5.17 2.52 1400.49 2963.44

Editor Configuration

Screenshot from 2025-03-17 15-31-39

Possible Improvements

This can be extended to profile the editor data, for example, with exposed EBus functionality.

Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
:

Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Copy link
Contributor

@norbertprokopiuk norbertprokopiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for future: Avoid merging main/development back to your feature branch, since it creates strange structure in git graph and shows some of already reviewed changes from main branch as changes currently made. Consider usage of the git rebase instead

Overal work really nice and provides very useful data, great job! Although I left some comments related to design and one small regression with file paths

I would recommend removing Editor component since it doesn't have any editor specific operations, just reflection. Instead reflection for edit context can be added to game component (FPSProfileComponent).

Could you also explain definitions of the system components in this setup? Possibly other than defining interfaces? Because this is the only reason that i see to define system components in this setup. But you defined all of them as system and don't really know why. It would be great if you could clarify this

w-czerski added 13 commits April 3, 2025 14:06
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
@w-czerski
Copy link
Contributor Author

w-czerski commented Apr 3, 2025

  • Replaced all AZStd::string path into AZ::IO::Path.
  • Removed file picker dialog.
  • Fixed path selection.
  • Removed the editor component and system component, editor reflection is passed dawn by FPSComponent.
  • Removed duplicate reflection validation
  • Removed const from bus notifications (let user modify configs on the run if needed)
  • Fixed FPS counter visibility - ImGui toolbar is no longer covering the counter

EDIT: Github automatically forces merge with the conflicted readme.md when using web editor. I've couldn't resolve it manually, so I used resolving in web editor.

Copy link
Contributor

@norbertprokopiuk norbertprokopiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good, I left only some comments to improve minor things.

But I will point it once again. Try to avoid merging main branch to your feature branch. It really messes up git graph structure. Better practice in case of conflicts is to update your local repo to be up to date with the remote, pull latest commits from the main branch. git switch/checkout to your feature branch. Git rebase main and then resolve all conflicts on you local repo. When you arre done, push rebased changes to the feature branch by git push origin feature_branch --force-with-lease.

Copy link
Contributor

@norbertprokopiuk norbertprokopiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, very nice feature!

@jhanca-robotecai jhanca-robotecai deleted the branch o3de-2409 July 25, 2025 07:55
@jhanca-robotecai jhanca-robotecai changed the base branch from main to 2409 July 25, 2025 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants