Log to file from AI

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
donuber
Engineer
Engineer
Posts: 2
Joined: 28 Jan 2021 11:05

Log to file from AI

Post 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!
donuber
Engineer
Engineer
Posts: 2
Joined: 28 Jan 2021 11:05

Re: Log to file from AI

Post 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.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 9 guests