Page 2 of 4

Re: trAIns: An AI that play only with trains

Posted: 26 Aug 2009 14:17
by cmoiromain
Actually, one more thing.

A couple of minutes later, the AI decided to link that second coal mine that was right next to an already existing station (see screenshot n°6). Here is what it did:
weird7.png
weird7.png (171.66 KiB) Viewed 757 times
Why didn't it link directly to the already existing line? The line it built instead is very strange; it uses bridges to go over town roads instead of going around them, and it goes over already existing track to link to the same main line immediately afterwards. Moreover, as I already pointed out, it would have been more clever to link to the mainline closer to the destination (ie at the bottom of the screen) than further away.

EDIT:

There seems to be a lot of places where the AI could have reused existing track and doesn't. I think what causes that is that the AI choses where it will connect the line and then tries to figure out how to connect the two places. This results in strange behaviours sometimes.
weird8.png
weird8.png (428.9 KiB) Viewed 748 times
The AI tried to link the green line to the place circled in blue. Something went wrong obviously, because it stopped building during the process. I could have linked it to the place circled in red (it seems more logic to me...).

Also, it seems that the AI doesn't like to use the same rail for two different cargos. At some places on the map there are for or six tracks instead of two, simply because it transports two or three different cargos, despite them traveling roughly the same route.

I will post the savegame once I think the game is over.

On a side note, is an option for trains to drive on the right a possibility?

Re: trAIns: An AI that play only with trains

Posted: 26 Aug 2009 15:03
by lhrios
cmoiromain wrote:Hi

First of all, I really love your AI. Other train building AIs are nice, but none have the building style which I like to see in my games.

I just decided to run a game with only trAIns, nothing else, to see how it goes. Immediately it started to build pretty networks all over the map.
Thanks!
cmoiromain wrote: Here are a few remarks I want to point out, to make the pathfinding even better.
weird1.png
Here, I think the AI is trying to link the coal mine at the bottom left to the power plant at the top. IMO it should instead link the coal mine to the power plant that is at the end of the line that disappears at the bottom of the screen (as it did with the other three coal mines already linked to is).
This happens because the distance between the coal mine and the power station is too long. So, it can not connect the industries. I can extend this limit but things like that will always exist.
cmoiromain wrote:
weird2.png
This is a closeup on where the three lines merge. I think some improvement can be made there. The bottom one could have this tight turn removed, and the top one could have been replaced by a straight line, connecting to the main line closer to where the bottom one links.
This is complicated because it needs to know the junction point before it can compute the path. It just knows that the junction point is not the better after compute the path.
cmoiromain wrote:
weird3.png
I think those bridges are unnecessary, it would be better tu go arround the lake rather than over it. OTOH, I don't know which of the two is cheaper.

More on the following post.
There is a trade off between good railways (straight lined) and computing the path fast. I chose to compute the path fast instead of create always straight lined paths. Is also expensive try to avoid bridges.

Re: trAIns: An AI that play only with trains

Posted: 26 Aug 2009 15:08
by lhrios
cmoiromain wrote:Actually, one more thing.

A couple of minutes later, the AI decided to link that second coal mine that was right next to an already existing station (see screenshot n°6). Here is what it did:
weird7.png
Why didn't it link directly to the already existing line? The line it built instead is very strange; it uses bridges to go over town roads instead of going around them, and it goes over already existing track to link to the same main line immediately afterwards. Moreover, as I already pointed out, it would have been more clever to link to the mainline closer to the destination (ie at the bottom of the screen) than further away.

EDIT:

There seems to be a lot of places where the AI could have reused existing track and doesn't. I think what causes that is that the AI choses where it will connect the line and then tries to figure out how to connect the two places. This results in strange behaviours sometimes.
weird8.png
The AI tried to link the green line to the place circled in blue. Something went wrong obviously, because it stopped building during the process. I could have linked it to the place circled in red (it seems more logic to me...).

Also, it seems that the AI doesn't like to use the same rail for two different cargos. At some places on the map there are for or six tracks instead of two, simply because it transports two or three different cargos, despite them traveling roughly the same route.

I will post the savegame once I think the game is over.

On a side note, is an option for trains to drive on the right a possibility?
This really needs to be fixed!

Re: trAIns: An AI that play only with trains

Posted: 26 Aug 2009 16:54
by cmoiromain
Here is the end of the game. The AI didn't seem to build anymore.

Attached are a screenshot of the middle of the map at the end (year 1984, started in 1950), the statistics of the company, and the save (created with r17287).

If you scrollaround the map, you will find quite a few places where the track is built in a strange way. Also, in many cases, as I said before, there a duplicate tracks where it could have been one track for many trains.

Suggestions for later:

Enlarge stations (one power plant station became too crowded at one point, and two platforms wasn't enough).

Use already existing tracks more often, and then enlarge the main lines to 2*2 instead of 2*1 tracks. I don't know how complicated that would be... It would require to classify tracks as main line, secondary line etc...

Transport passengers, oil, mail, goods and valuables.

At farms, transport both grain and cows.

At factories, use only one drop off station for all cargos, and add platforms when needed.

Good luck with improving it. I look forward to the next release =)

Re: trAIns: An AI that play only with trains

Posted: 27 Aug 2009 20:35
by Roujin
OT, but I think you've stumbled across a little bug in stats.png. The red Months in the "Operating profit graph" window. Care to file a bug report on bugs.openttd.org?

Re: trAIns: An AI that play only with trains

Posted: 27 Aug 2009 22:53
by cmoiromain
No, this is because my company was in the red (I switched it off from the graphs for the screenshots). The reason for this is that I just did the money cheat so I wouldn't go bankrupt, and just let the game go fast forward. Even with all the money reimbursed to the bank, there are some magic costs appearing from nowhere (taxes? =S ) that make me have negative profit.

Re: trAIns: An AI that play only with trains

Posted: 28 Aug 2009 13:27
by Wold
Not exactly checked :

Re: trAIns: An AI that play only with trains

Posted: 28 Aug 2009 15:09
by cmoiromain
Isn't that caused by the lack of save/load implementation?

Re: trAIns: An AI that play only with trains

Posted: 29 Aug 2009 21:53
by SmatZ
Why isn't it available via BaNaNaS yet? :-)

Re: trAIns: An AI that play only with trains

Posted: 31 Aug 2009 14:15
by lhrios
SmatZ wrote:Why isn't it available via BaNaNaS yet? :-)
How can I do it?

Re: trAIns: An AI that play only with trains

Posted: 31 Aug 2009 14:53
by Roujin
Via the web interface at content.openttd.org
Here's more information: http://wiki.openttd.org/Content_Service

Re: trAIns: An AI that plays only with trains

Posted: 09 Oct 2009 21:16
by Menno
I tried a game with TrAIns v1 among other AI's.
It performed very good. It achieved high income, comp value & profit with relatively low cargo transported. Apart from that its tracks and networks look like I made them myself, straightforward and without refraining from using | and - pieces which other train-based AI's tend to do. There was one small glitch however:
I started it in 1977, when it began building trains with BR125 engines. After some 10 years, it decided to upgrade most (not all!) of these to TGV's, and put the BR125s all in depots for some 2 years, without upgrading. Then suddenly the stopped trains were all upgraded and running again. I was thinking it might have been a money problem, but as far as I have kept track of it, it shouldn't have been an issue as there were some 20 trains stopped, TGV cost only 90k GBP (20*90=1.8M) and it owned several millions of GBP at that moment.
See attached save game and screenshot.
OpenTTD 0.7.3
NewGRFs: OpenGFX, better vehicles names, Av8 1.501

(I will post comparable posts in the other AI's topics)

EDIT: btw I really like this AI :)

Re: trAIns: An AI that plays only with trains

Posted: 12 Oct 2009 12:25
by lhrios
Menno wrote:I tried a game with TrAIns v1 among other AI's.
It performed very good. It achieved high income, comp value & profit with relatively low cargo transported. Apart from that its tracks and networks look like I made them myself, straightforward and without refraining from using | and - pieces which other train-based AI's tend to do. There was one small glitch however:
I started it in 1977, when it began building trains with BR125 engines. After some 10 years, it decided to upgrade most (not all!) of these to TGV's, and put the BR125s all in depots for some 2 years, without upgrading. Then suddenly the stopped trains were all upgraded and running again. I was thinking it might have been a money problem, but as far as I have kept track of it, it shouldn't have been an issue as there were some 20 trains stopped, TGV cost only 90k GBP (20*90=1.8M) and it owned several millions of GBP at that moment.
See attached save game and screenshot.
OpenTTD 0.7.3
NewGRFs: OpenGFX, better vehicles names, Av8 1.501

(I will post comparable posts in the other AI's topics)

EDIT: btw I really like this AI :)
Thanks for trying trAIns. This problem will be fixed in next AI release.

Re: trAIns: An AI that plays only with trains

Posted: 12 Oct 2009 13:10
by SirkoZ
Just a confirmation - I also observed delayed locomotive replacement.

I played a subtropic game with trAIns, some SimpleAI's and a NiceCAB (for ships and planes) and trAIns took a good half year to replace Wills 2-8-0's with the CS4000 although it did replace them. It's like it just falls asleep when all the trains are in depot and then after some rest suddenly awakens and gets back to work. :-)

Re: trAIns: An AI that plays only with trains

Posted: 08 Dec 2009 20:49
by Felix Atagong
I start my games very early , using the horses from eGRTVS and the American trainset that has some simple trains starting from the 1830s, with an initial loan of 10,000 £ (5,900,000 BEF)...

After some computing TrAIns mostly builds 2 far-away stations and only checks afterwards if a path can be build between them. In most games this is not the case, but TrAIns start building rails and stations anyway. When it is found out that a closed track will never be realised all rails is deleted, so are the station with the result that from the initial loan there is only 10% left, enough to survive for another year or so, sometimes 2. After that TrAIns goes bankrupt. The screenshot shows that only 871,499 BEF has been recuperated from the 10,766,025 that was used for building the stations and rails.

Why don't TrAIns checks first if there is enough money before starting to build rails, stations (and then it still needs some money to buy a train), especially in the 1800's only small, rather short tracks are profitable...

Just a thought...

Re: trAIns: An AI that plays only with trains

Posted: 08 Dec 2009 21:07
by Zuu
It is quite hard to get an exact figure of how much it would cost, even if a path has been searched it is still not trivial to calculate the cost exactly. Before a path has been found it is even harder to make a good estimate of the cost.

So while I can agree that it would be good to check the cost it is a far from trivial task.

Though, I think most AI authors like to get some feedback so it is still nice of you to post your though. Doing some kind of cost estimation is not impossible, just not trivial.

Re: trAIns: An AI that plays only with trains

Posted: 10 Dec 2009 19:51
by Felix Atagong
A couple of posts I told how TrAIns will build stations even it if can't join them, and start building tracks even if it doesn't have enough money.
Same game, a couple of decades further and TrAIns manages to connect two stations and then...
Atagong Transport, 22 Aug 1868.png
Atagong Transport, 22 Aug 1868.png (3.22 KiB) Viewed 4736 times
Bigger screenshot with the beginning of the errors attached as well...

Re: trAIns: An AI that plays only with trains

Posted: 10 Dec 2009 20:59
by petert
Unfortunately, that error message is of little use to Ihrios because the line number where the error occured (the [xxx] at the end of each line) is not visible. Wait for another crash and catch the [xxx] line numbers.

Re: trAIns: An AI that plays only with trains

Posted: 15 Dec 2009 08:02
by Lord Aro
telling him that is isn't that useful as it's fairly obvious that he's enlarged the AI debug window as large as he can anyway :roll:

Re: trAIns: An AI that plays only with trains

Posted: 15 Dec 2009 08:19
by Gremnon
It's possible to move even a window like that off the edge, in order to widen it enough to find out the last chunks of those errors, so yes, it is useful to know that.

A little common sense.