Page 1 of 1

Log to file from AI

Posted: 28 Jan 2021 14:09
by donuber
Hi all, I am developing an OpenTTD AI as a learning project. I want to tune some parameters by running some simulations on a variety of different maps.

For this, I wondered if it is possible to save all AILog output to a file? So that I can analyse it afterwards.

Thanks in advance!

Re: Log to file from AI

Posted: 31 Jan 2021 08:23
by donuber
Found a solution, so I thought I would share:

Run

Code: Select all

./openttd -d script=5 &> ~/log.txt
This will log AILog output to the console and save it to a file.

For MacOS 'cd' into OpenTTD.app/Contents/MacOS to get to the executable. I do not have a Windows machine, so I do not know if the solution is workable on Windows as well.