-
Notifications
You must be signed in to change notification settings - Fork 125
Advanced Profiling The Game
Keen was nice enough to give us access to their devtools and their profiler, and with some downloading and file moving, you too can use this version of the game.
You'll need to set up a few things before you can start using the profiling version.
First things first, is you'll need to download the ModSDK for the game. Open your Steam library, hovering your pointer over the "Library" button to get the menu. Select "Tools", and find "Space Engineers - Mod SDK" from the list, and install it. Or, you can just click this link right here to install the tool (If the link doesn't work, check the usual channels: Is it installed already? Do you own Space Engineers?)
Once the ModSDK has finished downloading an installing, you need to open the directory where it's installed (You can get to this quickly by right-clicking the tool in your library, selecting "Properties", "Local Files", "Browse Local Files...").
Make sure you make a backup of your Bin64
directory before you copy the files, to make restoring them easier. Open the Bin64_Profile
folder from the ModSDK's install directory, select everything in this folder and copy all of the files to Bin64
in your game's install directory, overwriting any of the files you're asked to.
Here's how to install the profiling version of the game without all the extra fluff.
- Install the Space Engineers - Mod SDK
- Copy the ModSDK files in
Bin64_Profile
to the game'sBin64
directory. Replace all files in the destination - Start the game
Once you're in the game, check the bottom left corner of the screen where you normally see the game's version number. You should see PROFILING NON-OFFICIAL
in red text next to the game version if you did everything correctly.
Once you're in game, from the main menu, or in a loaded game world, you can press F12(or Alt + F12 if you don't want to take a Steam screenshot) to open the debugging menu. Click on Performance at the top of the screen, and tick the box on the line next to "Profiler" to get the profiler view opened.
From here, you can use the various keybinds listed below to dig deeper into what's doing what in your game, see how long it's taking, and other fun profiling things. For profiling programmable blocks specifically, you can copy the text below and then press Alt + Shift + NumPad *..
UpdateInternal::Update > Session.Update > Before simulation > MySector > MyGameLogic.UpdateBeforeSimulation > PROGRAMMABLE_BLOCK
There are all kinds of debugging tools available in the profiler version of the game, but this page is only here to detail how to use the profiler specifically.
Press F12 in game (or Alt+F12 to not make steam screenshot) Select Performance tab Check Profiler checkbox
Profiler has hidden controls explained on attached image.
To profile PB - You need to find your PB. It should be something like:
Session.Update > Before Simulation > MySector > MyGameLogic.UpdateBeforeSimulation > PROGRAMMABLE_BLOCK
Run from terminal button will be somewhere in
After update -> Handle input
-->
The profiler has a lot of keybinds that aren't immediately obvious. They're listed here, grouped for convenience.
Key Combination | Functionality |
---|---|
Profiler management | |
Alt + NumPad . | Opens/closes the Profiler, doesn't reset the current profiler stack. |
Alt + NumPad Enter | Pause/unpause the profiler. |
Alt + Ctrl + Insert | Reset profiler data |
Alt + NumPad / | Decreases the level limit |
Alt + NumPad * | Increases the level limit |
Alt + Ctrl + NumPad / | Decreases the level limit by 1 |
Alt + Ctrl + NumPad * | Increases the level limit by 1 |
Alt + E | Toggle deep/shallow profile |
Alt + Shift + E | Toggle deep/shallow profile on connected DS |
Alt + A | Switch recording average times |
Alt + Shift + A | Switch recording average times on server |
Alt + 1-9 | Load profiler snapshot from file in `UserData/FullProfiler-X` |
Alt + LCtrl + 1-9 | Save profiler snapshot to file in `UserData/FullProfiler-X` |
Alt + RCtrl + 1-9 | Load snapshot from file and subtract it from current profiler data (diff) |
Alt + Shift + LCtrl + 1-9 | Save profiler snapshot on server |
Alt + S | Download current profiler data from server |
Profiler navigation | |
Alt + NumPad 0 | Go back 1 block (Will open the profiler if it's closed, this is done for backwards compatibility with programmer muscle memory) |
Alt + NumPad 1-NumPad 9 | Enter the next profiler block as usual |
Alt + Ctrl + NumPad 1-NumPad 9 | Select block 10-19 |
Alt + Ctrl + Space + NumPad 1-NumPad 9 | Select block 20-29 |
Alt + Ctrl + Home | Jump to root block |
Alt + NumPad + | Next thread |
Alt + NumPad - | Previous Thread |
Alt + Shift + NumPad / | Copy current profiler path to clipboard |
Alt + Shift + NumPad * | Try to navigate to the profiler path from the clipboard |
Profiler blocks optimization | |
Alt + NumPad 0 | Toggles all child block optimization state |
Alt + B + NumPad 1-NumPad 9 | Toggles block optimization state 1-9 |
Alt + Ctrl + B + NumPad 1-NumPad 9 | Toggles block optimization state 10-19 |
Alt + Ctrl + Shift + B + NumPad 1-NumPad 9 | Toggles block optimization state 20-29 |
Alt + B + NumPad Enter | Toggles optimizations enabled/disabled |
Alt + B + NumPad . | Resets optimization on all blocks |
Profiler display settings | |
Alt + Home | Increase profiler scale |
Alt + End | Decrease profiler scale |
Alt + Insert | Change profiler sorting order |
Alt + Ctrl + NumPad + | Increase local area (Used for calculating the average milliseconds) |
Alt + Ctrl + NumPad - | Decrease local area (Used for calculating the average milliseconds) |
Alt + Q | Switch to alternative graph (Used for memory allocation profiling) |
Profiler frame selection | |
Alt + PageUp | Go forward through frames |
Alt + PageDown | Go backwards through frames |
Alt + Ctrl + PageUp | Go forward through frames by 1 frame |
Alt + Ctrl + PageDown | Go backwards through frames by 1 frame |
Alt + Shift + PageUp | Fast forward through frames |
Alt + Shift + PageDown | Fast backwards through frames |
Alt + Ctrl + End | Disable selection mode |
UpdateInternal::Update > Session.Update > Before simulation > MySector > MyEntities.UpdateBeforeSimulation
UpdateInternal::Update > Session.Update > After simulation > MySector > MyEntities.UpdateAfterSimulation
You can make use of these paths by copying the text from here, opening the profiler ingame and pressing Alt + Shift + NumPad *.
A big thank you goes to AndrielChaoti who was kind enough to compose this document.
Do you have questions, comments, suggestions for improvements? Is there something I can do better? Did I make a mistake? Please add an issue here, and prefix your issue title with Wiki. Thank you, your help will be very appreciated!