切换语言: Deutsch English 日本語 Polski Русский Türkçe

Application directory/zh: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
GhosterFT (talk | contribs)
Created page with "{{Languages}} == Overview == Depending on your installation method and OS, you will have one or two directories that contain Factorio assets. == Application directory == T..."
 
Cardinal (talk | contribs)
m Translation verification.
 
(11 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Languages}}
{{Languages}}{{Translation verification|revisionID=211668}}
== 概述 ==
根据游戏的安装方式和操作系统的不同,可能会有一到两个文件夹用于存储异星工厂的游戏资源,以及一个存储用户数据(如存档和模组)的文件夹。


== Overview ==  
== 用户数据目录 ==
用户数据目录储存了用户的个人数据,包括以下文件:
* 游戏存档,<code>./saves</code>
* 模组,<code>./mods</code>
* 脚本输出内容,例如截图,<code>./script-output</code>
* 本地[[scenario system/zh|场景]],<code>./scenarios</code>
* 本地用户设置,<code>./config/config.ini</code>
* {{L|Log file}},<code>factorio-*.log</code>
* 崩溃转储文件,<code>factorio-dump-*.dmp</code>


Depending on your installation method and OS, you will have one or two directories that contain Factorio assets.
=== 文件位置 ===
可以在计算机中搜索目录位置,或直接在文件资源管理器的地址栏中输入路径。


== Application directory ==
* Windows系统:
The application directory stores three things:
%appdata%\Factorio
* Factorio executables (./bin)
:<code>%appdata%</code>对应系统本地的<code>[系统盘]:\Users\[用户名]\AppData\Roaming</code>文件夹。
* Data for vanilla Factorio (./data)
* API documentation


== User Data directory ==
* macOS X系统:
The save directory is where user-personal files are stored, such as world saves. A list of all things found here:
~/Library/Application Support/factorio


* Save games (as zip files)
* Linux系统及其各类发行版:
* User-installed/created [[Mods]].
~/.factorio
* User-installed/created scenarios.
:如果使用Flatpak版本的Steam,所有路径将以<code>~/.var/app/com.valvesoftware.Steam/</code>开头。
* User configuration and settings storage
* [[Log File]] (factorio-*.log)
* Player data (player-data.json)


Note: Deleting the configuration file will result in a default replacement being generated upon the next Factorio launch.
如果使用Windows版本的Steam,则config.ini、achievements.dat、modded-achievements.dat和player-data.json位于以下地址:
C:\Program Files (x86)\Steam\userdata\[SteamID]\427520\remote


It is recommended to create backups from this directory (of saves, config, etc) before installing a new version, or installing mods.
在macOS系统中,上述文件的位置是:
  ~/Library/Application Support/Steam/userdata/[SteamID]/427520/remote


== Directory locations by OS and installation method ==
在Liunx中,上述文件的位置是:
=== Windows ===
~/.steam/steam/userdata/[SteamID]/427520/remote
==== Installation via [http://steampowered.com Steam] ====
Application directory:
C:\Program Files (x86)\Steam\steamapps\common\Factorio


User data directory:
如果使用Steam安装器安装从其它网站下载的blueprint-storage-2.dat文件,在安装前需要禁用Steam云存档功能,并在"远程"选项中删除原有的blueprint-storage-2.dat文件。安装过程中需要全程禁用云存档,以防下载的蓝图文件被自动覆盖。
%appdata%\factorio


==== Installation by Zip-package ====
== 应用程序目录 ==
Application directory and User data directory will be the location to which Factorio was unpacked.
应用程序目录存储下列三类文件:
* 可执行文件,<code>./bin</code>
* 游戏资源文件,<code>./data</code>
* API文档,<code>./doc-html</code>


:For example, if you unpacked the zip to:
=== 文件位置 ===
  C:\Factorio
* Windows系统:
:Then your saves can be found in:
  C:\Program Files (x86)\Steam\steamapps\common\Factorio
  C:\Factorio\saves
  C:\Program Files\Factorio
:and mods in:
C:\Factorio\mods


==== Installation via native Installer ====
* macOS X系统:
Application directory:
~/Library/Application Support/Steam/steamapps/common/Factorio/factorio.app/Contents
C:\Users\<username>\AppData\Roaming\Factorio
  /Applications/factorio.app/Contents
User data directory:
  %appdata%\factorio


=== Mac OSX ===
* Linux系统
~/.steam/steam/steamapps/common/Factorio
~/.factorio


==== Installation via Steam ====
== 更改用户数据目录 ==
Application directory:
用户可在任意文件夹内创建<code>config-path.cfg</code>文件来进行游戏配置。


<code>/Users/<replace with your username>/Library/Application Support/Steam/steamapps/common/Factorio/factorio.app/Contents/</code>
要更改用户数据目录,用户需要修改<code>[游戏安装目录]/config/config.ini</code>文件中"write-data"条目的内容。这会影响模组文件、场景文件和临时文件的存储位置。


==== Installation via Installer ====
==== macOS ====
The application should be by default installed in the Apps-folder.
在macOS系统中有两种方法更改用户数据目录的位置。一种方法是直接修改应用程序文件夹中'''factorio.app'''文件的内容。此方法比较简单,但macOS系统可能会阻止修改后的应用程序在某些情况下运行。另一种方法是用特殊的配置文件重新打包'''factorio.app'''文件,然后以特殊方式运行游戏。这比较复杂,但不会引起macOS系统的运行问题。


Whereas the data is stored under
这里进行一些简单的原理解释。虽然'''factorio.app'''看起来是一个单独的文件,但它实际上是一个包含多个文件的"应用包"(app bundle),可以将其视为一种经过压缩的特殊文件夹。在"访达"(Finder)中使用正确的命令可以打开应用包,并编辑其中的文件和目录。然而,macOS内置了名为[https://support.apple.com/en-ca/guide/security/sec5599b66df/web Gatekeeper]的安全系统。在某些情况下,Gatekeeper会检查应用包是否与其原始内容完全相同,并监测对应用包的任何修改。如果发现任何修改行为,就可能导致macOS系统拒绝运行该应用。Gatekeeper的监测时间和频率取决于macOS的版本和系统设置。在首次运行应用程序时,系统很可能会进行检查。在新版本的macOS,如macOS Sequoia 15中,系统会在程序包首次运行后更频繁地进行检查。
/users/<replace with your username>/Library/Application Support/factorio


Which is equivalent to
如果需要修改游戏应用包,可以创建<code>factorio.app/config-path.cfg</code>文件,并包含以下内容:
  ~/Library/Application Support/factorio
  config-path=__PATH__executable__/../config
You can type in this into the Finder (press SHIFT-COMMAND-G for goto folder) and put in exactly this line.'
use-system-read-write-data-directories=false
Or you can use in Finder the 'Find a folder' and write '~/Library/Application Support' (See [http://www.factorioforums.com/forum/viewtopic.php?f=49&t=9345 Can't find Mods folder]).


The factorio internal application-data can be found (when you have installed it) in
更改<code>factorio.app/Contents/config/config.ini</code>文件:
 
/Applications/factorio.app/Contents/data
[path]
 
read-data=__PATH__executable__/../data
Same directory structure as in Application support.
write-data=__PATH__executable__/..
 
=== Linux ===
 
Data is stored under <code>~/.factorio</code>.
 
==== Installation via Steam ====
Data is stored under <code>~/.factorio</code>.
 
====Changing the application directory====


You can create a file <code>config-path.config</code> to configure Factorio to any directory.
如果不希望修改游戏应用包,可以参阅'''[http://www.factorioforums.com/forum/viewtopic.php?f=49&t=12819&p=87281#p87281 官方社区]'''中的说明。(英文)
 
'''[http://www.factorioforums.com/forum/viewtopic.php?f=49&t=12819&p=87281#p87281 Please see this discussion]''' (for MacOS, but should work on any other OS).
 
In order to change the application directory, user must edit the location of the "write-data" entry in the file <code>__Game_Install_directory/config/config.ini</code>. This affects the location of mods, scenario and temp.
 
If you want to move only the location of your save files you can '''[[Application_Directory/Changing_the_save_directory|change the the save directory using symlinks]]''' but this still means that all users of the computer will share the same data, including settings.


====Linux====
====Linux====
Update <code>__Game_Install_directory/config-path.cfg</code>  
更改 <code>[游戏安装目录]config-path.cfg</code>文件:
 
  use-system-read-write-data-directories=true
  use-system-read-write-data-directories=true


Update <code>__Game_Install_directory/config/config.ini</code>
更改 <code>[游戏安装目录]/config/config.ini</code>文件:
 
  [path]
  [path]
  read-data=__PATH__executable__/../../data
  read-data=__PATH__executable__/../../data
  write-data=.local/share/factorio
  write-data=.local/share/factorio


You could set the <code>write-data</code> value to '''<code>.factorio</code>''' if you prefer.
如有需要,可以将 <code>write-data</code> 的值设置为 '''<code>.factorio</code>'''
 
一旦完成以上操作,可以将游戏安装目录中所有文件设置为只读,'''除了'''<code>config/config.ini</code>文件,它必须对所有希望进行游戏的用户可写。
 
注意:如果某个用户在游戏中更改任何设置,这些变更会影响到所有在同一台计算机上进行游戏的用户。
 
== 通过Zip文件安装 ==
首先需要解压Zip压缩文件,会得到一个文件夹,其中包含:
* 游戏存档(zip文件)。
* 用户安装/创建的{{L|Modding}}。
* 用户安装/创建的场景。
* 用户的个人设置。
* {{L|Log file}}(factorio-*.log)。
* 玩家数据(player-data.json)。
 
注意:如果删除配置文件,下一次游戏启动时会自动生成默认配置。


Once you have done this, you can remove write permissions to the entire game installation directory '''except''' for <code>config/config.ini</code>, which '''must''' be writable by all people who wish to play the game.
建议在安装新版本前备份存档以及配置文件


Note that if someone changes any options, in-game, those option changes will apply to everyone who plays on the same computer.
== 参见 ==
* {{L|Install guide}}
* [[Modding/zh|模组安装]]
* [http://www.factorioforums.com/forum/viewtopic.php?f=5&t=8294 Linux版 - 在 $HOME 目录中保存游戏]


== See also ==
{{C|Main}}
* [[Download and Installation]]
* [[Install Guide]]
* [[Mods]]
* [[Installing Mods]]
* [http://www.factorioforums.com/forum/viewtopic.php?f=34&t=3389 Forum discussion]
* [http://www.factorioforums.com/forum/viewtopic.php?f=5&t=8294 Linux Version - Save games in $HOME somewhere]

Latest revision as of 04:29, 7 May 2025

概述

根据游戏的安装方式和操作系统的不同,可能会有一到两个文件夹用于存储异星工厂的游戏资源,以及一个存储用户数据(如存档和模组)的文件夹。

用户数据目录

用户数据目录储存了用户的个人数据,包括以下文件:

  • 游戏存档,./saves
  • 模组,./mods
  • 脚本输出内容,例如截图,./script-output
  • 本地场景./scenarios
  • 本地用户设置,./config/config.ini
  • 日志文件factorio-*.log
  • 崩溃转储文件,factorio-dump-*.dmp

文件位置

可以在计算机中搜索目录位置,或直接在文件资源管理器的地址栏中输入路径。

  • Windows系统:
%appdata%\Factorio
%appdata%对应系统本地的[系统盘]:\Users\[用户名]\AppData\Roaming文件夹。
  • macOS X系统:
~/Library/Application Support/factorio
  • Linux系统及其各类发行版:
~/.factorio
如果使用Flatpak版本的Steam,所有路径将以~/.var/app/com.valvesoftware.Steam/开头。

如果使用Windows版本的Steam,则config.ini、achievements.dat、modded-achievements.dat和player-data.json位于以下地址:

C:\Program Files (x86)\Steam\userdata\[SteamID]\427520\remote

在macOS系统中,上述文件的位置是:

 ~/Library/Application Support/Steam/userdata/[SteamID]/427520/remote

在Liunx中,上述文件的位置是:

~/.steam/steam/userdata/[SteamID]/427520/remote

如果使用Steam安装器安装从其它网站下载的blueprint-storage-2.dat文件,在安装前需要禁用Steam云存档功能,并在"远程"选项中删除原有的blueprint-storage-2.dat文件。安装过程中需要全程禁用云存档,以防下载的蓝图文件被自动覆盖。

应用程序目录

应用程序目录存储下列三类文件:

  • 可执行文件,./bin
  • 游戏资源文件,./data
  • API文档,./doc-html

文件位置

  • Windows系统:
C:\Program Files (x86)\Steam\steamapps\common\Factorio
C:\Program Files\Factorio
  • macOS X系统:
~/Library/Application Support/Steam/steamapps/common/Factorio/factorio.app/Contents
/Applications/factorio.app/Contents
  • Linux系统
~/.steam/steam/steamapps/common/Factorio
~/.factorio

更改用户数据目录

用户可在任意文件夹内创建config-path.cfg文件来进行游戏配置。

要更改用户数据目录,用户需要修改[游戏安装目录]/config/config.ini文件中"write-data"条目的内容。这会影响模组文件、场景文件和临时文件的存储位置。

macOS

在macOS系统中有两种方法更改用户数据目录的位置。一种方法是直接修改应用程序文件夹中factorio.app文件的内容。此方法比较简单,但macOS系统可能会阻止修改后的应用程序在某些情况下运行。另一种方法是用特殊的配置文件重新打包factorio.app文件,然后以特殊方式运行游戏。这比较复杂,但不会引起macOS系统的运行问题。

这里进行一些简单的原理解释。虽然factorio.app看起来是一个单独的文件,但它实际上是一个包含多个文件的"应用包"(app bundle),可以将其视为一种经过压缩的特殊文件夹。在"访达"(Finder)中使用正确的命令可以打开应用包,并编辑其中的文件和目录。然而,macOS内置了名为Gatekeeper的安全系统。在某些情况下,Gatekeeper会检查应用包是否与其原始内容完全相同,并监测对应用包的任何修改。如果发现任何修改行为,就可能导致macOS系统拒绝运行该应用。Gatekeeper的监测时间和频率取决于macOS的版本和系统设置。在首次运行应用程序时,系统很可能会进行检查。在新版本的macOS,如macOS Sequoia 15中,系统会在程序包首次运行后更频繁地进行检查。

如果需要修改游戏应用包,可以创建factorio.app/config-path.cfg文件,并包含以下内容:

config-path=__PATH__executable__/../config
use-system-read-write-data-directories=false

更改factorio.app/Contents/config/config.ini文件:

[path]
read-data=__PATH__executable__/../data
write-data=__PATH__executable__/.. 

如果不希望修改游戏应用包,可以参阅官方社区中的说明。(英文)

Linux

更改 [游戏安装目录]config-path.cfg文件:

use-system-read-write-data-directories=true

更改 [游戏安装目录]/config/config.ini文件:

[path]
read-data=__PATH__executable__/../../data
write-data=.local/share/factorio

如有需要,可以将 write-data 的值设置为 .factorio

一旦完成以上操作,可以将游戏安装目录中所有文件设置为只读,除了config/config.ini文件,它必须对所有希望进行游戏的用户可写。

注意:如果某个用户在游戏中更改任何设置,这些变更会影响到所有在同一台计算机上进行游戏的用户。

通过Zip文件安装

首先需要解压Zip压缩文件,会得到一个文件夹,其中包含:

  • 游戏存档(zip文件)。
  • 用户安装/创建的模组
  • 用户安装/创建的场景。
  • 用户的个人设置。
  • 日志文件(factorio-*.log)。
  • 玩家数据(player-data.json)。

注意:如果删除配置文件,下一次游戏启动时会自动生成默认配置。

建议在安装新版本前备份存档以及配置文件

参见