[AI] RailwAI

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

User avatar
Posts: 33
Joined: 22 Jul 2018 20:30
Location: Headquarters

Re: [AI] RailwAI

Post by RailwAI » 31 Oct 2019 20:02

The NoAI framework doesn't support to let an AI know much about available road types such as rattroads. Currently RailwAI assumes there can be 2 types of road (as per default): roads and tramways. I can try to let it work with rattroads, but it will always be a guess: The characteristics of other road types than the defaults can not be determined by an AI, while I want to treat roads and tramways differently.
Edit: my statement might be incorrect starting from openttd 1.10.0, let's wait if it will improve :-)

User avatar
Posts: 991
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: [AI] RailwAI

Post by 3iff » 05 Nov 2019 10:36

Quite impressed by this. A couple of issues discovered that I'd like to mention. Running version 20 on JGR 29

The AI linked an iron ore mine to a steel mill via roads then proceeded to build 3 truck services within a few months. That's hardly an efficient way to do it as only 2 stations will be getting resources. However, all three services are still active after 10 years - and it does tend to block other companies from setting up a service!

The double tracked rail lines set their signals so trains drive on the right. I always set my trains to drive on the left. I had a quick look at the code and basically didn't understand most of it. I'm guessing it's not an easy thing to change this but if you think it's possible if you could perhaps give me a few pointers so I might change it... I'm NOT asking you to make any changes (I really wouldn't expect you to do so). I'm pretty sure that players who have trains driving on the left are few in number, but I'd like to change it for myself if I possibly can. It only becomes relevant when I take over such a company and I can live with it how it is at the moment.

I do like the fact that there are shared vehicles which makes it so much easier after takeovers. Bigger rail stations are also appreciated.


Actually, on further inspection, the signalling is way more complex than I first thought. There's a strange combination of single, path and one-way stuff. It mostly works except for one instance where a train went the wrong way (on a line that connected another service and the AI ended with 4 trains stuck).

It's also slightly annoying that if a rail service closes that the associated track is left in place - but I can understand the situation when services share some common track.

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Google [Bot] and 3 guests