In other languages: 日本語 Русский 简体中文

Debug mode: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
mNo edit summary
m (→‎List of debug-options and their function: link to moved prototype docs for hide_resistances)
 
(41 intermediate revisions by 13 users not shown)
Line 1: Line 1:
{{Languages}}
{{Languages}}
 
[[File:debug_during_play.png|thumb|250px|right|Debug mode, with some of its features enabled.]]The ''debug mode'' is used mainly by developers and modders to analyze the running state of the game. It can be enabled to show detailed information about the game world. The default key to enable debug mode is {{keybinding|F5}}.
''Debug mode'' is used mainly by developers and modders to analyze the running state of the game. It can be enabled to show detailed information about the game world, and its information varies based on which level is active. The keys to enable debug mode are f5 through f7.


For example, one can:
For example, one can:
* See the path the [[Biter]]s are coming from and where they plan to target,
* See the path the [[Enemies#Biters|biters]] are coming from and where they plan to target,
* See the position / coordinates of the cursor,
* See the position / coordinates of the cursor,
* See a grid-overlay for the [[Tile]]s and [[Chunk]]s,
* See a grid-overlay for the [[map structure|tile]]s and [[Map_structure#Chunk|chunks]],
* See the blocks in a railway network,
* See additional non-game related information, such as Updates Per Second and FPS.
* See additional non-game related information, such as Updates Per Second and FPS.
'''Note:''' In addition to this internal debugging tool there are also third-party debugging tools contributed by the community available on the [https://forums.factorio.com/viewforum.php?f=135 Factorio sub-forum for mod development tools].


== Activate the debug mode ==
== Activate the debug mode ==


You have 4 debug-levels:
There are 2 debug-levels:


* '''Always''' - This is the default mode, if no mode is active. Keep very few things active here.
* '''Always''' - This is the default mode, if no mode is active. Keep very few things active here.
* '''Basic''' - The first mode, accessed by pressing {{keybinding|F5}}. What power users often use.
* '''Debug''' - Toggled by pressing {{keybinding|F5}}. Allows to toggle the debug overlays.
* '''Detailed''' - The second mode, accessed by pressing {{keybinding|F6}}. The most commonly used for modders and developers.
* '''Full''' - The third mode, accessed by pressing {{keybinding|F7}}. Shows literally everything, tends to be unreadable.
 
To switch back to "always" you need to press the previous key again. Example: Press F5 to go to "basic", then press F6 to watch "detailed" and then press F6 again to switch back to "always".


== Configuring the debug mode ==
== Configuring the debug mode ==


To configure the 4 modes, press {{keybinding|F4}}. This opens up a menu with many options. You can move this menu with the mouse, if it hides some interesting underlying thing. You can switch between 4 folders, which reflects the option for that debug-mode ("always", "basic", "detailed", "full"). The options are the same for each mode. Each mode can be configured to the user's liking, the different modes are only for convenience.
To configure the 2 modes, press {{keybinding|F4}}. This opens up a menu with many options. You can move this menu with the mouse, if it hides some interesting underlying thing. You can switch between 2 folders, which reflects the option for that debug-mode ("always", "debug"). The options are the same for each mode. Each mode can be configured to the user's liking, the different modes are only for convenience. A search function ({{Keybinding|ctrl|F}}) is available.


== List of debug-options and their function ==
== List of debug-options and their function ==
{| class="wikitable"
|-
! Option !! Description
|-
| show-fps || Will show the current frames-per-second and updates per second, short <abbr title="Frames Per Second">FPS</abbr> and <abbr title="Updates Per Second">UPS</abbr>. Should be normally about 60.
|-
| show-clock || Shows a real time clock.
|-
| show-detailed-info ||
* Shows the cursor position in [[Map_structure#Tile|tiles]] (and subdivisions of that).
* Current resolution and zoom.
* How many objects are on the screen (painted by the graphic card).
* How many entities, chunks and paths are in the game and used.
|-
| show-time-usage ||
* Internal statistics about how long some calculations take, in milliseconds per [[Time#Ticks|tick]].
* Time is shown as average/min/max of the last 100 ticks, interval can be changed with /perf-avg-frames.
* Minimum values exclude zeroes (e.g. from ticks where no mod hooks were run).
* Overall calculation delays (some are parallel) must be under 16.6 ms to maintain normal framerate at 1x speed with 60 ticks per second.
* The Top section of metrics cover the wider game engines activities. The middle Update section relates to running the simulation for a tick. The bottom Map Generator section relates to the map generation activity.
|-
| show-entity-time-usage ||
|-
| show-gpu-time-usage ||
|-
| show-sprite-counts || The counts of each sprite rendered on screen.
|-
| show-lua-object-statistics || Statistics related to the Lua garbarge collector. Update time (avg/min/max), created objects (avg/min/max [total]), destroyed objects (avg/min/max [total]).
|-
| show-heat-buffer-info ||
|-
| show-multiplayer-waiting-icon || When in a multiplayer game: if the game is currently waiting for the server to process.
|-
| show-multiplayer-statistics || The latency information when in multiplayer.
|-
| show-multiplayer-selection-rectangles || Allows to view selection rectangles of other players in multiplayer.
|-
| show-debug-info-in-tooltips || Shows additional information in the tooltips of entities, items, recipes, tiles etc.
|-
| show-resistances-in-tooltips-always || Show entity resitances in all entity tooltips instead of just tooltips of enemy entities and entities with [https://lua-api.factorio.com/latest/prototypes/EntityWithHealthPrototype.html#hide_resistances hide_resistances] set to false.
|-
| hide-mod-guis || Hides GUIs added by mods.
|-
| show-tile-grid || Shows the borders of the [[Map_structure#Tile|tiles]] and [[Map_structure#Chunk|chunks]].
|-
| show-blueprint-grid ||
|-
| show-collision-rectangles || Shows the collision boxes of each entity (red).
|-
| show-selection-rectangles || Shows a blue box over each entity, if you hover over it, it will be selected.
|-
| show-render-rectangles || Shows a pink box over each entity, if that is on your screen, the entity will be rendered.
|-
| show-sticker-boxes ||
|-
| show-entity-positions ||
|-
| show-entity-velocities ||
|-
| show-selected-entity-advanced-tiles || Shows on which advanced tiles (2×2 tiles) the entity is registered.
|-
| show-selected-input-transport-belts || Shows which entities input into the selected transport line.
|-
| show-paths || The calculated paths for the biters in different colors.
|-
| show-path-requests ||
|-
| show-next-waypoint-bb || Shows waypoints for biters (in green), nearly the same info as the next.
|-
| show-target || Shows the current target of the biters (red).
|-
| show-unit-group-info || Biter groups, which belong together (circles and lines belonging together)
|-
| show-unit-behavior-info ||
|-
| show-pathfinder-fringe ||
|-
| show-path-cache || The source-positions of a path and about the length (?)
|-
| show-path-cache-paths ||
|-
| show-rail-paths || Which path a train will follow.
|-
| show-rolling-stock-count || Shows inserter positions
|-
| show-rail-connections || Shows rail connections.
|-
| show-rail-joints ||
|-
| show-rail-segment-collision-boxes ||
|-
| show-train-stop-point || When a train slows down it shows the calculated point where it should halt
|-
| show-train-braking-distance || The distance a train will take to stop at its current speed
|-
| show-train-signals ||
|-
| show-train-repathing || Display a flying "repathed" text over a train whenever it repaths.
|-
| show-network-connected-entities || Displays the network-id of the electric network that a pole is connected to
|-
| show-circuit-network-numbers || Shows the number (and color) of circuit networks
|-
| show-energy-sources-networks || Which network-id an entity is connected to.
|-
| show-active-state || Inserters, fish, turrets are turned to passive, if not used; Red = inactive, Purple = inactive when enemies aren't around (turrets etc), Green = inactive when player isn't around (fish). Passive entities consume less CPU power.
|-
| show-wakeup-lists || When an entity is sleeping in another entity it shows which entities it's sleeping in.
|-
| show-transport-lines ||
|-
| show-transport-line-gaps ||
|-
| show-pollution-values || Shows the numeric pollution amount on each chunk.
|-
| show-active-entities-on-chunk-counts ||
Shows counts of active entities per chunk. They are divided into two categories:
* Blue = active when a player is around (e.g. fish)
* Green = active when enemies are around (e.g. turrets)
|-
| show-active-chunks || Shows in the map view, which chunks are "on", unmarked chunks are not calculated.
|-
| show-polluted-chunks || Shows which chunks have pollution.
|-
| hide-chart-tags || Hides map tags.
|-
| show-enemy-expansion-candidate-chunks || Where is space left to spread the brood?. Goes from red (nearly no space) to green (space to expand).
|-
| show-enemy-expansion-candidate-chunk-values || Which chunks the enemies will try to expand into.
|-
| show-bad-attack-chunks ||
|-
| show-tile-variations || Shows, which tile-variation (1, 2 or 4 tile sized) is painted for which area of the map. Quite confusing, zoom in to see the meaning.
|-
| show-raw-tile-transitions || Turns connected textures for land and water off, so the distinction can easily be made.
|-
| show-fluid-box-fluid-info || How much fluid is in a pipe/storage tank, shows flow of liquid in pipes.
|-
| show-environment-sound-info || Displays which sound of which entity is played and how loud.
|-
| show-environment-sound-area ||
|-
| show-selected-entity-audible-range ||
|-
| show-recently-played-sound-info ||
|-
| show-logistic-robot-targets ||
|-
| show-spidertron-movement ||
|-
| show-player-robots ||
|-
| show-fire-info ||
|-
| show-sticker-info ||
|-
| show-decorative-names ||
|-
| show-decorative-collision-rectangles ||
|-
| allow-increased-zoom ||
|-
| show-chunk-components ||
|-
| show-train-no-path-details || Chat shows extra info on pathfinder for no-pathing trains. [https://forums.factorio.com/viewtopic.php?p=567834#p567834]
|}


* <code>show_fps</code>
{{C|Main}}
** Will show the current frames-per-second, or FPS. Should be normally about 60.
* <code>show_detailed_info</code>
** Shows the cursor position in [[Tile]]s (and subdivisions of that), [[Chunk]]s and [[Region]]
** Current resolution and zoom
** How many objects are on the screen (painted by the graphic card)
** How many entities, chunks and paths are in the game and used.
* <code>show_time_used_percent</code>
** Many important internal statistics about the timing. [http://www.factorioforums.com/forum/viewtopic.php?f=49&t=7972 F5 debug info - how to read it?] - how to interpret...
* <code>show_tile_grid</code>
** Quite useful to turn it on for the "always"-mode. It shows the borders of the [[Tile]]s and [[Chunk]]s.
* <code>show_collision_rectangles</code>
** Shows the collision boxes of each entity (red).
* <code>show_selection_rectangles</code>
** Shows the a blue box over each entity, if you hover over it, it will be selected.
* <code>show_paths</code>
** The calculated paths for the biters in different colors.
* <code>show_next_waypoint_bb</code>
** Shows waypoints for biters (in green), nearly the same info as the next.
* <code>show_target</code>
** Shows the current target of the biters (red).
* <code>show_unit_group_info</code>
** Biter groups, which belong together (circles and lines belonging together)
* <code>show_unit_stuck_info</code>
** Should show stuck enemies (?)
* <code>show_last_path_detail</code>
** The A*-algorithm at work, calculating new paths.
* <code>show_path_cache</code>
** The source-positions of a path and about the length (?)
* <code>show_rail_paths</code>
** Which path a train will follow.
* <code>show_rolling_stock_count</code>
** Shows inserter positions
* <code>show_rail_connections</code>
** Shows rail connections.
* <code>show_rail_segments</code>
** Shows the segment borders and enables you to see the borders of the block.
* <code>show_train_stop_point</code>
** When a train slows down it shows the calculated point where it should halt
* <code>show_network_connected_entities</code>
** Displays the network-id of the electric network that a pole is connected to
* <code>show_circuit_network_numbers</code>
** Shows the number (and color) of circuit networks
* <code>show_energy_sources_networks</code>
** Which network-id an entity is connected to.
* <code>show_blocked_by</code>
** Shows items, which are blocked (see for example full belts)
* <code>show_active_state</code>
** Inserters, fish, turrets are turned to passive, if not used; Red = inactive, Purple = inactive until enemies aren't around (turrets etc), Green = inactive until player isn't around (fish). Passive entities consume less CPU power.
* <code>show_active_enemies_on_chunk_counts</code>
** Not 100% clear: displays in the map view, how much biter nests (blue) are targeting to which are (red for the number of biters?), green: unknown?
* <code>show_active_chunks</code>
** Shows in the map view, which chunks are "on", unmarked chunks are not calculated
* <code>show_enemy_expansion_candidate_chunks</code>
** Where is space left to spread the brood?
* <code>show_tile_variations</code>
** Shows, which tile-variation (1, 2 or 4 tile sized) is painted for which area of the map quite confusing, zoom in to see the meaning.
* <code>show_raw_tile_transitions</code>
** Turns connected textures for land and water off, so the distinction can easily be made.
* <code>show_fluid_box_fluid_info</code>
** How much fluid is in a pipe/storage tank, shows flow of liquid in pipes.
* <code>show_environment_sound_info</code>
** Displays which sound of which entity is played and how loud.
 
== See also ==
 
* [http://www.factorioforums.com/forum/viewtopic.php?f=49&t=7972 F5 debug info - how to read it?] - how to interpret show_time_used_percent

Latest revision as of 10:45, 25 July 2024

Debug mode, with some of its features enabled.

The debug mode is used mainly by developers and modders to analyze the running state of the game. It can be enabled to show detailed information about the game world. The default key to enable debug mode is F5.

For example, one can:

  • See the path the biters are coming from and where they plan to target,
  • See the position / coordinates of the cursor,
  • See a grid-overlay for the tiles and chunks,
  • See additional non-game related information, such as Updates Per Second and FPS.

Note: In addition to this internal debugging tool there are also third-party debugging tools contributed by the community available on the Factorio sub-forum for mod development tools.

Activate the debug mode

There are 2 debug-levels:

  • Always - This is the default mode, if no mode is active. Keep very few things active here.
  • Debug - Toggled by pressing F5. Allows to toggle the debug overlays.

Configuring the debug mode

To configure the 2 modes, press F4. This opens up a menu with many options. You can move this menu with the mouse, if it hides some interesting underlying thing. You can switch between 2 folders, which reflects the option for that debug-mode ("always", "debug"). The options are the same for each mode. Each mode can be configured to the user's liking, the different modes are only for convenience. A search function (CTRL + F) is available.

List of debug-options and their function

Option Description
show-fps Will show the current frames-per-second and updates per second, short FPS and UPS. Should be normally about 60.
show-clock Shows a real time clock.
show-detailed-info
  • Shows the cursor position in tiles (and subdivisions of that).
  • Current resolution and zoom.
  • How many objects are on the screen (painted by the graphic card).
  • How many entities, chunks and paths are in the game and used.
show-time-usage
  • Internal statistics about how long some calculations take, in milliseconds per tick.
  • Time is shown as average/min/max of the last 100 ticks, interval can be changed with /perf-avg-frames.
  • Minimum values exclude zeroes (e.g. from ticks where no mod hooks were run).
  • Overall calculation delays (some are parallel) must be under 16.6 ms to maintain normal framerate at 1x speed with 60 ticks per second.
  • The Top section of metrics cover the wider game engines activities. The middle Update section relates to running the simulation for a tick. The bottom Map Generator section relates to the map generation activity.
show-entity-time-usage
show-gpu-time-usage
show-sprite-counts The counts of each sprite rendered on screen.
show-lua-object-statistics Statistics related to the Lua garbarge collector. Update time (avg/min/max), created objects (avg/min/max [total]), destroyed objects (avg/min/max [total]).
show-heat-buffer-info
show-multiplayer-waiting-icon When in a multiplayer game: if the game is currently waiting for the server to process.
show-multiplayer-statistics The latency information when in multiplayer.
show-multiplayer-selection-rectangles Allows to view selection rectangles of other players in multiplayer.
show-debug-info-in-tooltips Shows additional information in the tooltips of entities, items, recipes, tiles etc.
show-resistances-in-tooltips-always Show entity resitances in all entity tooltips instead of just tooltips of enemy entities and entities with hide_resistances set to false.
hide-mod-guis Hides GUIs added by mods.
show-tile-grid Shows the borders of the tiles and chunks.
show-blueprint-grid
show-collision-rectangles Shows the collision boxes of each entity (red).
show-selection-rectangles Shows a blue box over each entity, if you hover over it, it will be selected.
show-render-rectangles Shows a pink box over each entity, if that is on your screen, the entity will be rendered.
show-sticker-boxes
show-entity-positions
show-entity-velocities
show-selected-entity-advanced-tiles Shows on which advanced tiles (2×2 tiles) the entity is registered.
show-selected-input-transport-belts Shows which entities input into the selected transport line.
show-paths The calculated paths for the biters in different colors.
show-path-requests
show-next-waypoint-bb Shows waypoints for biters (in green), nearly the same info as the next.
show-target Shows the current target of the biters (red).
show-unit-group-info Biter groups, which belong together (circles and lines belonging together)
show-unit-behavior-info
show-pathfinder-fringe
show-path-cache The source-positions of a path and about the length (?)
show-path-cache-paths
show-rail-paths Which path a train will follow.
show-rolling-stock-count Shows inserter positions
show-rail-connections Shows rail connections.
show-rail-joints
show-rail-segment-collision-boxes
show-train-stop-point When a train slows down it shows the calculated point where it should halt
show-train-braking-distance The distance a train will take to stop at its current speed
show-train-signals
show-train-repathing Display a flying "repathed" text over a train whenever it repaths.
show-network-connected-entities Displays the network-id of the electric network that a pole is connected to
show-circuit-network-numbers Shows the number (and color) of circuit networks
show-energy-sources-networks Which network-id an entity is connected to.
show-active-state Inserters, fish, turrets are turned to passive, if not used; Red = inactive, Purple = inactive when enemies aren't around (turrets etc), Green = inactive when player isn't around (fish). Passive entities consume less CPU power.
show-wakeup-lists When an entity is sleeping in another entity it shows which entities it's sleeping in.
show-transport-lines
show-transport-line-gaps
show-pollution-values Shows the numeric pollution amount on each chunk.
show-active-entities-on-chunk-counts

Shows counts of active entities per chunk. They are divided into two categories:

  • Blue = active when a player is around (e.g. fish)
  • Green = active when enemies are around (e.g. turrets)
show-active-chunks Shows in the map view, which chunks are "on", unmarked chunks are not calculated.
show-polluted-chunks Shows which chunks have pollution.
hide-chart-tags Hides map tags.
show-enemy-expansion-candidate-chunks Where is space left to spread the brood?. Goes from red (nearly no space) to green (space to expand).
show-enemy-expansion-candidate-chunk-values Which chunks the enemies will try to expand into.
show-bad-attack-chunks
show-tile-variations Shows, which tile-variation (1, 2 or 4 tile sized) is painted for which area of the map. Quite confusing, zoom in to see the meaning.
show-raw-tile-transitions Turns connected textures for land and water off, so the distinction can easily be made.
show-fluid-box-fluid-info How much fluid is in a pipe/storage tank, shows flow of liquid in pipes.
show-environment-sound-info Displays which sound of which entity is played and how loud.
show-environment-sound-area
show-selected-entity-audible-range
show-recently-played-sound-info
show-logistic-robot-targets
show-spidertron-movement
show-player-robots
show-fire-info
show-sticker-info
show-decorative-names
show-decorative-collision-rectangles
allow-increased-zoom
show-chunk-components
show-train-no-path-details Chat shows extra info on pathfinder for no-pathing trains. [1]