7
7
* User mods can be enabled by using -enableMods (Useful for modpack benchmarking)
8
8
* Loading of benchmarked savefiles via -savePath
9
9
* Regex pattern can be used to further limit which saves are benchmarked via -pattern "some pattern"
10
- * Verbose result mode via -verboseResult allows creation of an excel file where
11
- separate run results are saved to their own sheets with tick based update
12
- times
10
+ * Verbose result mode via -verboseResult allows creation of an xlsx file where
11
+ separate run results are saved to their own sheets with tick based update times
13
12
* Cpu Priority selection via -cpuPriority, defaults to "High"
14
13
15
14
Various other command line options and flags for customizing functionality.
@@ -36,8 +35,14 @@ all the possible flags please run this in powershell:
36
35
37
36
## Dependencies
38
37
39
- Verbose mode depends on [ Import-Excel] ( https://github.com/dfinke/ImportExcel )
40
- to create the output excel file with runs in their own sheets.
38
+ Better output files depend on
39
+ [ Import-Excel] ( https://github.com/dfinke/ImportExcel ) to create output .xlsx
40
+ files.
41
+
42
+ Verbose output is possible with per-tick runs all in their own sheets.
43
+
44
+ Regular output file handles better localization and easier import to
45
+ spreadsheet software (doesn't have to be excel).
41
46
42
47
Install it by running the following command in powershell:
43
48
@@ -49,9 +54,6 @@ Script will ask ticks and runs and benchmarks all savefiles found in default sav
49
54
50
55
.\benchmark.ps1
51
56
52
- cmdlet benchmark.ps1 at command pipeline position 1
53
- Supply values for the following parameters:
54
- (Type !? for Help.)
55
57
ticks: 6000
56
58
runs: 1
57
59
@@ -132,6 +134,144 @@ Execute using verbose output. This will output an excel file with per-tick data.
132
134
The script doesn't generate graphs but this is an example of what's possible by
133
135
using per-tick data.
134
136
137
+ ## Full Parameter List
138
+
139
+ ### -ticks Int32
140
+
141
+ Specify the amount of ticks of simulation for each benchmark savefile run
142
+
143
+ ### -runs Int32
144
+
145
+ Specify the amount of times to repeat each benchmark savefile
146
+
147
+ ### -pattern String
148
+
149
+ Benchmark filenames can be filtered using this pattern
150
+ Defaults to all savefiles found in ### -savepath
151
+
152
+ This setting is by default also used as a prefix to the result files
153
+ See -removePatternAsOutputPrefix
154
+
155
+ ### -configpath String
156
+
157
+ Factorio config path
158
+ Defaults to $env: APPDATA \Factorio\ (Default Factorio config folder)
159
+
160
+ ### -savepath String
161
+
162
+ Factorio save path
163
+ Savefiles are collected recursively from this path
164
+ Defaults to $env: APPDATA \Factorio\saves (Default Factorio save folder)
165
+
166
+ ### -executable String
167
+
168
+ Factorio executable path
169
+ Defaults to ${env: ProgramFiles (x86)}\Steam\steamapps\common\Factorio\bin\x64\factorio.exe (Default Steam installation folder)
170
+
171
+ ### -platform String
172
+
173
+ Logging string that is used in the regular output file
174
+ Defaults to WindowsSteam
175
+ This is just for convention/convenience and is not used in any logic
176
+
177
+ ### -notes String
178
+
179
+ Logging string that is used in the regular output file
180
+ Add whatever notes you would like to be included for the given runs
181
+ This is just for convention/convenience and is not used in any logic
182
+
183
+ ### -outputName String
184
+
185
+ Base output filename (csv/xlsx)
186
+ Default is results
187
+
188
+ ### -outputNameVerbose String
189
+
190
+ Base verbose output filename (always xlsx)
191
+ Default is verbose
192
+
193
+ ### -outputFolder String
194
+
195
+ Output results folder
196
+
197
+ ### -forceCSV
198
+
199
+ Script will default to using xlsx output if Export-Excel dependency is
200
+ installed. You may force the non-verbose output file to always be CSV with
201
+ this if you so wish.
202
+
203
+ Note: Usage of Excel specifically is not mandatory even with .xlsx files.
204
+ Spreadsheet software just tend to import the data better in more rigid
205
+ file formats than .csv which has issues with localization for example with
206
+ decimal separators.
207
+
208
+ ### -noOutputPrefix
209
+
210
+ By default the -pattern argument is used as a prefix in output filenames
211
+ Use this flag to disable this behaviour
212
+
213
+ This is useful if you never want separate results files ever and just want
214
+ to collect all results into one place regardless of your way of selecting
215
+ benchmark files
216
+
217
+ ### -keepLogs
218
+
219
+ If given preserve the raw logs produced by factorio.exe
220
+
221
+ ### -clearOutputFile
222
+
223
+ If given and -output file exists clear it before running
224
+
225
+ ### -enableMods
226
+
227
+ If given use user's normal mods
228
+ By default a separate mod folder is used
229
+ This separate mod folder can be specified with -benchmarkModFolder
230
+
231
+ ### -benchmarkModFolder String
232
+
233
+ If -enableMods isn't given use this folder as the target for benchmarking mods
234
+ Defaults to ./benchmark-mods/
235
+ Note factorio expects this path in unix format with forward slashes for separators
236
+
237
+ ### -verboseResult
238
+
239
+ If given enables verbose mode which logs per-tick benchmarks and outputs
240
+ an xlsx file
241
+
242
+ ### -verboseItems String
243
+
244
+ Specify the list of items included in verbose -verboseResult output. Valid items are:
245
+
246
+ tick,timestamp,wholeUpdate,latencyUpdate,gameUpdate,circuitNetworkUpdate,transportLinesUpdate,fluidsUpdate,heatManagerUpdate,entityUpdate,particleUpdate,mapGenerator,mapGeneratorBasicTilesSupportCompute,mapGeneratorBasicTilesSupportApply,mapGeneratorCorrectedTilesPrepare,mapGeneratorCorrectedTilesCompute,mapGeneratorCorrectedTilesApply,mapGeneratorVariations,mapGeneratorEntitiesPrepare,mapGeneratorEntitiesCompute,mapGeneratorEntitiesApply,crcComputation,electricNetworkUpdate,logisticManagerUpdate,constructionManagerUpdate,pathFinder,trains,trainPathFinder,commander,chartRefresh,luaGarbageIncremental,chartUpdate,scriptUpdate,
247
+
248
+ tick must be one of the selected items, otherwise the script won't work
249
+
250
+ ### -cpuPriority String
251
+
252
+ Specify which CPU priority to use. Valid values are:
253
+
254
+ Idle, BelowNormal, Normal, AboveNormal, High, or RealTime
255
+
256
+ Defaults to High
257
+
258
+ ### -cpuAffinity Int32
259
+
260
+ Specify CPU affinity. Valid values between 0 - 255
261
+
262
+ Sum the numbers associated with the cores to specify the cores you want factorio to run in.
263
+ Core 1 = 1
264
+ Core 2 = 2
265
+ Core 3 = 4
266
+ Core 4 = 8
267
+ Core 5 = 16
268
+ Core 6 = 32
269
+ Core 7 = 64
270
+ Core 8 = 128
271
+ Eg. enabling core 1, 3 and 5 is 1 + 4 + 16 = 21
272
+
273
+ Defaults to 0 which disables affinity specification altogether
274
+
135
275
## Contributors
136
276
137
277
Thanks to KnightElite from the Technical Factorio Discord for the base script!
0 commit comments