Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sat Nov 17, 2018 2:08 pm

All times are UTC




Post new topic  Reply to topic  [ 31 posts ]  Go to page 1 2 Next
Author Message
 Post subject: FastPTPAI
PostPosted: Wed Jul 10, 2013 5:04 pm 
Offline
Engineer
Engineer

Joined: Thu Sep 01, 2011 7:23 pm
Posts: 92
Location: Oregon, USA
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.

Attachment:
Company-Stats.png [159.15 KiB]
Downloaded 15 times

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 491 times
Top
   
 Post subject: Re: FastPTPAI
PostPosted: Wed Jul 10, 2013 6:50 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
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


Top
   
 Post subject: Re: FastPTPAI
PostPosted: Wed Jul 10, 2013 7:05 pm 
Offline
Engineer
Engineer

Joined: Thu Sep 01, 2011 7:23 pm
Posts: 92
Location: Oregon, USA
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.


Top
   
 Post subject: Re: FastPTPAI
PostPosted: Wed Jul 10, 2013 7:51 pm 
Offline
Engineer
Engineer

Joined: Thu Sep 01, 2011 7:23 pm
Posts: 92
Location: Oregon, USA
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.


Top
   
 Post subject: Re: FastPTPAI
PostPosted: Wed Jul 10, 2013 8:08 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
11Runner wrote:
the fastest train

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.

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD


Top
   
 Post subject: Re: FastPTPAI
PostPosted: Wed Jul 10, 2013 8:26 pm 
Offline
Engineer
Engineer

Joined: Thu Sep 01, 2011 7:23 pm
Posts: 92
Location: Oregon, USA
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.

_________________
Image

SynTrans - A Synaptic Networking AI for OpenTTD


Top
   
 Post subject: Re: FastPTPAI
PostPosted: Thu Jul 11, 2013 7:24 am 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
Also: save and load results in crashed AI due to using undeclared variable saved.

to fix it is enough to replace

Code:
function FastPTPAI::Load(version,data)
{
   saved = true;
}


with

Code:
function FastPTPAI::Load(version,data)
{
}

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD


Top
   
 Post subject: Re: FastPTPAI
PostPosted: Thu Jul 11, 2013 1:18 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
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]
Downloaded 13 times

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Top
   
 Post subject: Re: FastPTPAI
PostPosted: Mon Jul 29, 2013 2:18 am 
Offline
Engineer
Engineer

Joined: Thu Sep 01, 2011 7:23 pm
Posts: 92
Location: Oregon, USA
Kogut wrote:
And the next bug report (in mass AI game, without any interventions, I have no idea what happened here):


Sorry for the long wait for reply. I was on vacation.

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?

_________________
Image

SynTrans - A Synaptic Networking AI for OpenTTD


Top
   
 Post subject: Re: FastPTPAI
PostPosted: Tue Jul 30, 2013 12:33 am 
Offline
Engineer
Engineer

Joined: Thu Sep 01, 2011 7:23 pm
Posts: 92
Location: Oregon, USA
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.


Attachments:
FastPTPAI-2.tar [55.5 KiB]
Downloaded 170 times
Top
   
 Post subject: Re: FastPTPAI
PostPosted: Tue Aug 06, 2013 3:06 am 
Offline
Engineer
Engineer

Joined: Thu Sep 01, 2011 7:23 pm
Posts: 92
Location: Oregon, USA
FastPTPAI v3:

* Supports more bulk cargos!
* Fixed some etc. bugs


Attachments:
FastPTPAI-3.tar [60 KiB]
Downloaded 171 times
Top
   
 Post subject: Re: FastPTPAI
PostPosted: Thu Aug 08, 2013 5:43 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
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 157 times

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Top
   
 Post subject: Re: FastPTPAI
PostPosted: Thu Aug 08, 2013 6:10 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
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 161 times

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Top
   
 Post subject: Re: FastPTPAI
PostPosted: Sun Aug 11, 2013 10:07 pm 
Offline
Engineer
Engineer

Joined: Thu Sep 01, 2011 7:23 pm
Posts: 92
Location: Oregon, USA
Kogut wrote:
This AI seems to have narrow selection for "good industry". See attached save where it is refusing to make more connections.


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:
Other problems: train 9, 10 and 4 are on the wrong lines. Train 8 is unable to unload its cargo.


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 reports :)


Top
   
 Post subject: Re: FastPTPAI
PostPosted: Mon Aug 12, 2013 9:07 am 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
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


Top
   
 Post subject: Re: FastPTPAI
PostPosted: Tue Aug 13, 2013 12:13 am 
Offline
Engineer
Engineer

Joined: Thu Sep 01, 2011 7:23 pm
Posts: 92
Location: Oregon, USA
FastPTPAI v4:

This release fixes the bug where trains build on a different track than they are supposed to.

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.


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.

Thanks to Kogut for the bug reports! :)


Attachments:
FastPTPAI-4.tar [60 KiB]
Downloaded 176 times
Top
   
 Post subject: Re: FastPTPAI
PostPosted: Mon Jan 13, 2014 12:42 pm 
Offline
Engineer
Engineer

Joined: Mon Jun 21, 2010 11:54 am
Posts: 58
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...


Attachments:
File comment: Wrong depot position
Screen Shot 2014-01-13 at 11.55.33.png [200.89 KiB]
Downloaded 7 times

_________________
Sorry my bad english, I don't speak english!
Top
   
 Post subject: Re: FastPTPAI
PostPosted: Tue Jan 14, 2014 10:33 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Feb 21, 2010 12:15 am
Posts: 1031
Location: Fitzroy North - 96
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.


Attachments:
Screen Shot 2014-01-14 at 5.23.19 PM.png [523.8 KiB]
Downloaded 6 times

_________________
Image
Trolleybi! Trucks and Buses -- Docklands -- Unspooled -- MLSS
Top
   
 Post subject: Re: FastPTPAI
PostPosted: Sun Mar 09, 2014 2:40 pm 
Offline
Tycoon
Tycoon

Joined: Sun Feb 23, 2014 10:02 pm
Posts: 1274
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.


Top
   
 Post subject: Re: FastPTPAI
PostPosted: Sat Mar 15, 2014 12:57 pm 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 886
I found a small bug: the rail line is inaccessible from the depot.
Attachment:
bad depot.png
bad depot.png [ 63.66 KiB | Viewed 6410 times ]


The AI does very well by the way :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 31 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.