trAIns: An AI that plays only with trains (v2)
Moderator: OpenTTD Developers
- cmoiromain
- Chief Executive
- Posts: 655
- Joined: 15 Jan 2007 21:45
- Location: FRANCE
- Contact:
Re: trAIns: An AI that play only with trains
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:
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.
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?
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:
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.
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?
I am little, ugly, and nasty. How do you do?
Re: trAIns: An AI that play only with trains
Thanks!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.
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: Here are a few remarks I want to point out, to make the pathfinding even better.
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 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: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.
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.cmoiromain wrote: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.
Re: trAIns: An AI that play only with trains
This really needs to be fixed!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:
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.
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?
- cmoiromain
- Chief Executive
- Posts: 655
- Joined: 15 Jan 2007 21:45
- Location: FRANCE
- Contact:
Re: trAIns: An AI that play only with trains
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 =)
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 =)
- Attachments
-
- overall.png
- (316.02 KiB) Downloaded 79 times
-
- stats.png (42.38 KiB) Viewed 759 times
-
- trAIns03.sav
- (333.91 KiB) Downloaded 176 times
I am little, ugly, and nasty. How do you do?
Re: trAIns: An AI that play only with trains
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?
- cmoiromain
- Chief Executive
- Posts: 655
- Joined: 15 Jan 2007 21:45
- Location: FRANCE
- Contact:
Re: trAIns: An AI that play only with trains
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.
I am little, ugly, and nasty. How do you do?
Re: trAIns: An AI that play only with trains
Not exactly checked :
- Attachments
-
- trains1.png (49.32 KiB) Viewed 775 times
- cmoiromain
- Chief Executive
- Posts: 655
- Joined: 15 Jan 2007 21:45
- Location: FRANCE
- Contact:
Re: trAIns: An AI that play only with trains
Isn't that caused by the lack of save/load implementation?
I am little, ugly, and nasty. How do you do?
Re: trAIns: An AI that play only with trains
How can I do it?SmatZ wrote:Why isn't it available via BaNaNaS yet?
Re: trAIns: An AI that play only with trains
Via the web interface at content.openttd.org
Here's more information: http://wiki.openttd.org/Content_Service
Here's more information: http://wiki.openttd.org/Content_Service
Re: trAIns: An AI that plays only with trains
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
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
- Attachments
-
- AI game.sav
- (658.84 KiB) Downloaded 140 times
-
- replacing for tgvs.png
- (277.53 KiB) Downloaded 1 time
*hmz*
Re: trAIns: An AI that plays only with trains
Thanks for trying trAIns. This problem will be fixed in next AI release.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
Re: trAIns: An AI that plays only with trains
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.
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.
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
-
- Engineer
- Posts: 45
- Joined: 16 Apr 2007 19:50
- Location: Louvain
- Contact:
Re: trAIns: An AI that plays only with trains
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...
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...
- Attachments
-
- Atagong Transport, 30 Sep 1851.png (15.55 KiB) Viewed 4778 times
Felix Atagong
The Holy Church of Iggy the Inuit
The Holy Church of Iggy the Inuit
Re: trAIns: An AI that plays only with trains
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.
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.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
-
- Engineer
- Posts: 45
- Joined: 16 Apr 2007 19:50
- Location: Louvain
- Contact:
Re: trAIns: An AI that plays only with trains
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...
Bigger screenshot with the beginning of the errors attached as well...
Same game, a couple of decades further and TrAIns manages to connect two stations and then...
Bigger screenshot with the beginning of the errors attached as well...
Felix Atagong
The Holy Church of Iggy the Inuit
The Holy Church of Iggy the Inuit
Re: trAIns: An AI that plays only with trains
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
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
AroAI - A really feeble attempt at an AI
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
Re: trAIns: An AI that plays only with trains
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.
A little common sense.
Who is online
Users browsing this forum: No registered users and 27 guests