切换语言: English 日本語 Русский

Debug mode/zh: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
m (substituted links to go to official lua api documentation)
No edit summary
Line 1: Line 1:
{{Languages}}
{{Languages}}
Debug模式可能更多的是为了游戏开发者来调试游戏用的,但是当你玩游戏的时候,通过这里也可以看到很多有趣的信息。
'''调试模式'''(Debug mode)主要由开发者和模组制作者用来分析游戏的运行状态。启用调试模式可显示游戏世界的详细信息。启用调试模式的默认键是{{keybinding|F5}}


例如,你可以
例如,你可以
* 查看[[Biter/zh|虫子]]从哪儿来,又要攻击哪里,
* 查看[[Biter/zh|虫子]]从哪儿来以及它们计划攻击的目标;
* 查看[[Tile/zh|格]]和[[Chunk/zh|块]]的网格,
* 查看光标的位置/坐标;
* 查看你的铁路系统的闭塞区段,
* 查看[[Tile/zh|格]]和[[Chunk/zh|块]]的网格;
* 查看更多的与游戏无关,但是很有趣的信息。:)
* 查看更多的与游戏无关,但是很有趣的信息。如每秒更新次数和帧率。
'''注意:''' 除了这个内部调试工具之外,社区还在[https://forums.factorio.com/viewforum.php?f=135 Factorio 子论坛]上提供了用于mod开发的第三方调试工具。


== 激活调试模式(Debug mode) ==
== 激活调试模式(Debug mode) ==


一共有4种调试等级(Debug-levels):
一共有两种调试等级(Debug-levels):


* '''always''' - 如果你不进行选择,这是默认的模式
* '''Always''' - 如果没有选择任何模式,这便是默认模式。这里只保留很少的活动选项。
* '''basic''' - 按F5开启
* '''Debug''' - 按{{keybinding|F5}}键切换。允许切换调试覆盖。
* '''detailed''' - 按F6
* '''full''' - 按F7


返回"always"模式你只需要再按一下之前的按键。例如:按F5进入了"basic"模式,然后按F6进入"detailed"模式,这时再一次按F6就可以返回"always"模式。
== 配置调试模式(Debug mode) ==


== 配置调试模式(Debug mode) ==
要配置两种模式,请按{{keybinding|F4}}。这将打开一个包含许多选项的菜单。如果它遮挡了某些有趣的内容,你可以用鼠标移动该菜单。你可以在两个菜单之间切换,对应该调试模式的选项('''Always'''、'''Debug''')。每种模式的选项相同,用户可以根据喜好进行配置。不同模式仅为方便使用而设。可按下({{Keybinding|ctrl|F}})进行搜索。


要配置4种模式,按'''F4'''。这会打开一个有许多选项的菜单。如果它挡住了什么有趣的东西,你可以用鼠标移动这个菜单。
== 调试选项以及功能 ==


你可以在4个标签下切换,这4种对应了4种调试模式("always", "basic", "detailed", "full")。每种模式的可选项都是相同的。你可以根据你的喜好,调整每一种模式的选项的开关。
{| class="wikitable"
 
|-
== 调试选项以及功能 ==
! 选项 !! 描述
|-
| show-fps || 将显示当前的每秒帧数(FPS)和每秒更新次数(UPS)。<abbr title="每秒帧数">FPS</abbr> and <abbr title="每秒更新次数">UPS</abbr>. 正常情况下应为 60 左右。
|-
| show-clock || 显示实时时钟。
|-
| show-detailed-info ||
* 显示光标在[[Map_structure#Tile|格]](及其分区)的位置。
* 当前分辨率和缩放比例。
* 屏幕上有多少个物体(由显卡绘制)。
* 游戏中使用了多少实体、块和路径。
|-
| 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 || 多人游戏时的延迟信息。
|-
| 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 || 隐藏由mod添加的GUI。
|-
| 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 || 路径的源位置和长度(?)
|-
| show-path-cache-paths ||
|-
| show-rail-paths || 火车将沿着哪条路径行驶。
|-
| show-rolling-stock-count || 显示插入器位置
|-
| show-rail-connections || 显示铁路连接。
|-
| show-rail-joints ||
|-
| show-rail-segment-collision-boxes ||
|-
| show-train-stop-point || 当火车减速时,显示计算出可能的停车位置。
|-
| show-train-braking-distance || 火车以当前速度停下来所需的距离
|-
| 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 || 显示每个块上的污染量数字。
|-
| show-active-entities-on-chunk-counts ||
显示每个区块的活动实体数量。它们分为两类:
* 蓝色 = 当玩家靠近时激活(例如鱼)
* 绿色 = 当敌方靠近时激活(例如炮塔)
|-
| show-active-chunks || 在地图视图中显示 “已探索 ”的区块,未标记的区块不计算在内。
|-
| show-polluted-chunks || 显示哪些块有污染。
|-
| hide-chart-tags || 隐藏地图标签。
|-
| show-enemy-expansion-candidate-chunks || 还有什么空间可以繁殖幼虫?从红色(几乎没有空间)到绿色(可以繁殖的空间)。
|-
| show-enemy-expansion-candidate-chunk-values || 敌人会尝试扩张到哪些区块。
|-
| show-bad-attack-chunks ||
|-
| show-tile-variations || 显示地图上每个区域所绘制的区块变体(1、2 或 4 个区块大小)。较为混乱,请放大查看具体含义。
|-
| show-raw-tile-transitions || 关闭陆地和水体的连接纹理,以便更容易区分。
|-
| show-fluid-box-fluid-info || 管道/储罐中有多少液体,并显示管道中液体的流动情况。
|-
| show-environment-sound-info || 显示哪个实体正在播放哪个声音,以及音量大小。
|-
| 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 || 聊天框将显示额外信息。 [https://forums.factorio.com/viewtopic.php?p=567834#p567834]
|}


* <code>show_fps</code>
{{C|Main}}
: 显示当前每秒帧数。正常状态下是60. 参见[http://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.speed]。
* <code>show_detailed_info</code>
: 显示鼠标所处位置的[[Tile/zh|格]](以及它的次级单位),[[Chunk/zh|块]]和[[Region/zh|区域]]
: 当前的分辨率和缩放尺度(参见[http://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.take_screenshot])
: 当前屏幕中有多少物体(显卡绘制的数量)
: 游戏中有多少实体,块和路径在使用中。
* <code>show_time_used_percent</code>
: 关于计时的更多重要的内部统计信息。(TODO: more details)
* <code>show_tile_grid</code>
: 在"always"模式下开启也是很有用的。它会显示[[Tile/zh|格]]和[[Chunk/zh|块]]的边界。
* <code>show_collision_rectangles</code>
: 显示每一个实体的碰撞盒(红色)
* <code>show_selection_rectangles</code>
: 在每个实体上显示一个蓝色方块,当鼠标悬浮于其上时,这个实体将会被选中。
* <code>show_paths</code>
: 用不同的颜色显示出外星生物进攻路径。
* <code>show_next_waypoint_bb</code>
: 用绿色显示外星生物的路径点,跟下一个的作用类似。
* <code>show_target</code>
: 用红色显示当前外星生物的目标。
* <code>show_unit_group_info</code>
: biter groups, which belong together (circles and lines belonging together)
* <code>show_unit_stuck_info</code>
: 显示被卡住的敌人 (?)
* <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>
: 显示火车行驶的路径。
* <code>show_rolling_stock_count</code>
: 显示机械臂位置
* <code>show_rail_connections</code>
: 每一段铁路真的都连接起来了么?
* <code>show_rail_segments</code>
: 显示铁路段的边界,可以更容易的看到闭塞区段的边界。
* <code>show_train_stop_point</code>
: 当火车减速时,它将显示火车会在哪儿停下来。
* <code>show_network_connected_entities</code>
: 显示电线杆接入的电网的网络ID。
* <code>show_circuit_network_numbers</code>
: 显示红绿先系统的编号(和颜色)。
* <code>show_energy_sources_networks</code>
: 实体连接的网络ID。
* <code>show_blocked_by</code>
: 显示被阻塞的物品(参见满载传送带的例子)
* <code>show_active_state</code>
: 如果不使用,那机械臂,鱼类,机枪炮塔将会变为被动状态。
* <code>show_active_enemies_on_chunk_counts</code>
: not 100% clear: displays in the map view, how much biter nests (blue) are targetting to which are (red for the number of biters?), green: unknown?
* <code>show_active_chunks</code>
: 显示在地图上,哪些块是“激活”的,没被标注的块是不参与运算的。
* <code>show_enemy_expansion_candidate_chunks</code>
: 哪里给敌人扩张留下空间?
* <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>
: 关闭重叠的边界,你现在可以清楚的看到哪里是陆地,哪里是水域。
* <code>show_fluid_box_fluid_info</code>
: 管道和储油罐中有多少液体,如果管道是空的,则会看到流动方向。
* <code>show_environment_sound_info</code>
: 显示哪个实体发出了多大的声音。

Revision as of 15:22, 9 November 2024

调试模式(Debug mode)主要由开发者和模组制作者用来分析游戏的运行状态。启用调试模式可显示游戏世界的详细信息。启用调试模式的默认键是F5

例如,你可以

  • 查看虫子从哪儿来以及它们计划攻击的目标;
  • 查看光标的位置/坐标;
  • 查看的网格;
  • 查看更多的与游戏无关,但是很有趣的信息。如每秒更新次数和帧率。

注意: 除了这个内部调试工具之外,社区还在Factorio 子论坛上提供了用于mod开发的第三方调试工具。

激活调试模式(Debug mode)

一共有两种调试等级(Debug-levels):

  • Always - 如果没有选择任何模式,这便是默认模式。这里只保留很少的活动选项。
  • Debug - 按F5键切换。允许切换调试覆盖。

配置调试模式(Debug mode)

要配置两种模式,请按F4。这将打开一个包含许多选项的菜单。如果它遮挡了某些有趣的内容,你可以用鼠标移动该菜单。你可以在两个菜单之间切换,对应该调试模式的选项(AlwaysDebug)。每种模式的选项相同,用户可以根据喜好进行配置。不同模式仅为方便使用而设。可按下(CTRL + F)进行搜索。

调试选项以及功能

选项 描述
show-fps 将显示当前的每秒帧数(FPS)和每秒更新次数(UPS)。FPS and UPS. 正常情况下应为 60 左右。
show-clock 显示实时时钟。
show-detailed-info
  • 显示光标在(及其分区)的位置。
  • 当前分辨率和缩放比例。
  • 屏幕上有多少个物体(由显卡绘制)。
  • 游戏中使用了多少实体、块和路径。
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 多人游戏时的延迟信息。
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 隐藏由mod添加的GUI。
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 路径的源位置和长度(?)
show-path-cache-paths
show-rail-paths 火车将沿着哪条路径行驶。
show-rolling-stock-count 显示插入器位置
show-rail-connections 显示铁路连接。
show-rail-joints
show-rail-segment-collision-boxes
show-train-stop-point 当火车减速时,显示计算出可能的停车位置。
show-train-braking-distance 火车以当前速度停下来所需的距离
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 显示每个块上的污染量数字。
show-active-entities-on-chunk-counts

显示每个区块的活动实体数量。它们分为两类:

  • 蓝色 = 当玩家靠近时激活(例如鱼)
  • 绿色 = 当敌方靠近时激活(例如炮塔)
show-active-chunks 在地图视图中显示 “已探索 ”的区块,未标记的区块不计算在内。
show-polluted-chunks 显示哪些块有污染。
hide-chart-tags 隐藏地图标签。
show-enemy-expansion-candidate-chunks 还有什么空间可以繁殖幼虫?从红色(几乎没有空间)到绿色(可以繁殖的空间)。
show-enemy-expansion-candidate-chunk-values 敌人会尝试扩张到哪些区块。
show-bad-attack-chunks
show-tile-variations 显示地图上每个区域所绘制的区块变体(1、2 或 4 个区块大小)。较为混乱,请放大查看具体含义。
show-raw-tile-transitions 关闭陆地和水体的连接纹理,以便更容易区分。
show-fluid-box-fluid-info 管道/储罐中有多少液体,并显示管道中液体的流动情况。
show-environment-sound-info 显示哪个实体正在播放哪个声音,以及音量大小。
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 聊天框将显示额外信息。 [1]