FastPTPAI
Moderator: OpenTTD Developers
FastPTPAI
Hello! I am back!
I have been working on a new train network AI. Along the way, I stumbled on this creation that has entertained me and I think is worthy of being published. It's called FastPTPAI.
As the name implies, it is fast and builds PTP routes. It is very simple, and all it does is build more routes. It does not manage them. It is surprisingly competitive, however.
Pink - FastPTPAI
Blue - Convoy
Red - NoCAB
As with any of my AIs, I am welcome to bug/crash reports, suggestions, etc.
In the future, I hope to add support for multiple trains per route and ro-ro stations. I also need to add slow AI mode. These things should be available for it soon, I just need more time
The .tar download for this AI is below, and it will also be available on bananas.
EDIT: Added attachment player color information
I have been working on a new train network AI. Along the way, I stumbled on this creation that has entertained me and I think is worthy of being published. It's called FastPTPAI.
As the name implies, it is fast and builds PTP routes. It is very simple, and all it does is build more routes. It does not manage them. It is surprisingly competitive, however.
Pink - FastPTPAI
Blue - Convoy
Red - NoCAB
As with any of my AIs, I am welcome to bug/crash reports, suggestions, etc.
In the future, I hope to add support for multiple trains per route and ro-ro stations. I also need to add slow AI mode. These things should be available for it soon, I just need more time
The .tar download for this AI is below, and it will also be available on bananas.
EDIT: Added attachment player color information
- Attachments
-
- FastPTPAI-1.tar
- (54.5 KiB) Downloaded 828 times
Re: FastPTPAI
It seems to have trouble with newgrfs (tested in game with US trainset - it was unable to create a proper train).
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: FastPTPAI
OK. It should go with the most expensive bluk cargo and the fastest train with the biggest wagon for the cargo, but as I said, it is quick and dirty. I will take a look at it again. Thanks.
Re: FastPTPAI
OK, so I tested my AI with ECS cargos. After that, I also tested it with NARS and UKRS. All tests worked. However, when I tested with the 2CC trainset, the train was not able to be built. Unfortunately, I am leaving for vacation today, so I will not be able to resolve the issue until I return.
Re: FastPTPAI
Some trainsets have very fast engines that cannot be joined to wagons with cargo other than mail and passengers. US Set is an example. AIAI handles it so feel free to steal code/ideas.11Runner wrote:the fastest train
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: FastPTPAI
OK. Good to know. Some of my train choosing code was actually based off of MailAI, and i noticed that it handled this problem as well.
Re: FastPTPAI
Also: save and load results in crashed AI due to using undeclared variable saved.
to fix it is enough to replace
with
to fix it is enough to replace
Code: Select all
function FastPTPAI::Load(version,data)
{
saved = true;
}
Code: Select all
function FastPTPAI::Load(version,data)
{
}
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: FastPTPAI
And the next bug report (in mass AI game, without any interventions, I have no idea what happened here):
- Attachments
-
- Bez tytułu.png (254.91 KiB) Viewed 2592 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: FastPTPAI
Sorry for the long wait for reply. I was on vacation.Kogut wrote:And the next bug report (in mass AI game, without any interventions, I have no idea what happened here):
My best guess for the problem is that another AI built a road there while FastPTPAI was building/pathfinding the route, so it failed to build the track for some reason... Error checking for pathfinding is actually not yet supported. I will look into it right after I fix the train issue. Both of which will happen tomorrow (which is probobly 17 hours from now). Thank you for your reports Besides its issues, did the AI perform well for you in your mass AI game test?
Re: FastPTPAI
FastPTPAI v2 has been released!
I have fixed all the bugs reported by Kogut to the best of my ability. Thank you for your reports!
I was having some Bananas upload issues, so if it is not working well for someone, please let me know. Either way, the AI's .tar is also attached to this post.
I have fixed all the bugs reported by Kogut to the best of my ability. Thank you for your reports!
I was having some Bananas upload issues, so if it is not working well for someone, please let me know. Either way, the AI's .tar is also attached to this post.
- Attachments
-
- FastPTPAI-2.tar
- (55.5 KiB) Downloaded 324 times
Re: FastPTPAI
FastPTPAI v3:
* Supports more bulk cargos!
* Fixed some etc. bugs
* Supports more bulk cargos!
* Fixed some etc. bugs
- Attachments
-
- FastPTPAI-3.tar
- (60 KiB) Downloaded 321 times
Re: FastPTPAI
This AI seems to have narrow selection for "good industry". See attached save where it is refusing to make more connections.
- Attachments
-
- picky.sav
- (140.92 KiB) Downloaded 310 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: FastPTPAI
Other problems: train 9, 10 and 4 are on the wrong lines. Train 8 is unable to unload its cargo.
- Attachments
-
- ops.sav
- (199.2 KiB) Downloaded 316 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: FastPTPAI
You are correct about this. I am still working on expanding this AIs compatibility with more cargos. At the moment, however, this AI will only work with cargos marked to be bulk. I should have support for more industries/cargos soon.Kogut wrote:This AI seems to have narrow selection for "good industry". See attached save where it is refusing to make more connections.
I think I know why the trains are on the wrong lines, but I am not sure why train 9 is not unloading its cargo yet. I will be sure to fix these issues if possible by the next release. Thank you for your reportsKogut wrote:Other problems: train 9, 10 and 4 are on the wrong lines. Train 8 is unable to unload its cargo.
Re: FastPTPAI
That is because either station was build too far away from industry (note that it is not accepting coal) or one power station closed and new one was constructed slightly away.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: FastPTPAI
FastPTPAI v4:
This release fixes the bug where trains build on a different track than they are supposed to.
Thanks to Kogut for the bug reports!
This release fixes the bug where trains build on a different track than they are supposed to.
Yeah, I have made sure that the stations for the AI should always be in range, so I am going to go with the second possibility. Unfortunately, this AI does not support maintenance yet, so if an industry closes that it interacts with, it will be unable to react at this time. I will not be fixing bugs like this for awhile.Kogut wrote:That is because either station was build too far away from industry (note that it is not accepting coal) or one power station closed and new one was constructed slightly away.
Thanks to Kogut for the bug reports!
- Attachments
-
- FastPTPAI-4.tar
- (60 KiB) Downloaded 334 times
Re: FastPTPAI
I tried it, I like it.
But often I came across an warning: the AI can't buy an engine type. But I don't use any NewGRF.
And other error: the depot position. I attached the picture...
But often I came across an warning: the AI can't buy an engine type. But I don't use any NewGRF.
And other error: the depot position. I attached the picture...
- Attachments
-
- Wrong depot position
- Screen Shot 2014-01-13 at 11.55.33.png (200.89 KiB) Viewed 2586 times
Sorry my bad english, I don't speak english!
Re: FastPTPAI
Few observations, some of which have been noted already. With the Japan Set (I know, way too exotic...), the AI predictably always builds shinkansens, but is not able to build any cars (no standard gauge freight cars in Japan Set, I believe). However, the AI also connects the stations with low speed standard gauge rail, so the train can't run anyway. (I've made a hobby of cheating to this AI to tweak its networks, cascading its high speed trains to passenger service while preserving its original lines within the network).
I've also noticed in a game with FIRS and OGFX+ trains that the AI does reasonably well, excepting one depot built on a slope so as to be unable to connect to the line, with a train stuck inside, and one case of a line built to collect cargo from a secondary industry that was not being provided with any materials, shown below.
I've also noticed in a game with FIRS and OGFX+ trains that the AI does reasonably well, excepting one depot built on a slope so as to be unable to connect to the line, with a train stuck inside, and one case of a line built to collect cargo from a secondary industry that was not being provided with any materials, shown below.
- Attachments
-
- Screen Shot 2014-01-14 at 5.23.19 PM.png (523.8 KiB) Viewed 2585 times
-
- Tycoon
- Posts: 1396
- Joined: 23 Feb 2014 22:02
Re: FastPTPAI
This AI does fairly well against me,I buy out more successful incarnations...but it does tend to ignore the right angle turn prohibition,and traps its trains in depots in locations from which they can't proceed.
Just bought out the latest in the game I play most actively.It had 73 stations of which 35 were unconnected,and in cases had 3 or 4 by the same industry.Also some cases of linking track to platforms the long way around.
Just bought out the latest in the game I play most actively.It had 73 stations of which 35 were unconnected,and in cases had 3 or 4 by the same industry.Also some cases of linking track to platforms the long way around.
Re: FastPTPAI
I found a small bug: the rail line is inaccessible from the depot.
The AI does very well by the way Who is online
Users browsing this forum: No registered users and 1 guest