Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Feb 19, 2018 4:24 am

All times are UTC




Post new topic  Reply to topic  [ 70 posts ]  Go to page 1 2 3 4 Next
Author Message
 Post subject: RoadRunner AI
PostPosted: Thu Apr 29, 2010 4:52 am 
Offline
Engineer
Engineer

Joined: Tue Feb 23, 2010 3:44 pm
Posts: 103
Hi together,

today I want proudly present....



Attachment:
runner.png
runner.png [ 99.28 KiB | Viewed 8400 times ]




An AI, which depends on the Pathzilla AI. First I only want to fix some bugs, to get PathZilla to run with new OpenTTD-Versions, but then I can't stop to change things in this AI...
So here it is, which many improvements:

Transports all kinds of cargo,
Better calculation of the required fleet size,
Better protection of going bankrupt,
and many little other things...

Ok, have fun with it and if you find any bugs (I don't hope so), please report it in this thread. I will try to fix them if possible.

And last but not least many many thanks to George Weller for writing the original AI PathZilla. Good work, guy.


Attachments:
File comment: RoadRunner AI - Version 9
RoadRunner-9.tar [460 KiB]
Downloaded 466 times


Last edited by Steffl on Sun Jun 30, 2013 2:04 pm, edited 23 times in total.
Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Thu Apr 29, 2010 8:32 am 
Offline
Engineer
Engineer

Joined: Thu Mar 25, 2010 3:34 pm
Posts: 24
Sorry to say, but I've already found a bug. In this town RoadRunner builds 2 bus stops and a truck stop, but doesn't check that there is a route through the town.

Just look at the roads in the town and you'll see what I mean.


Attachments:
Unnamed, 12th Nov 1980.png
Unnamed, 12th Nov 1980.png [ 301.22 KiB | Viewed 14148 times ]
Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Thu Apr 29, 2010 2:58 pm 
Offline
Engineer
Engineer

Joined: Tue Feb 23, 2010 3:44 pm
Posts: 103
Hi kirky_D,
thanks for testing my AI and for the bug report.
Have you modified something on the game settings? I always thought all roads inside a town are connected to the center. I can't promise you, that I can fix this bug. I think I would have to make bigger changes in the station placement algorithm. I hope the AI sees, that there is no profit on this bus service and then closes it down.


Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Thu Apr 29, 2010 3:09 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4533
Location: /home/sweden
Actually, the center tile do not always need to be covered road. By default it has road, but it could have been demolished so that a house is placed there later. The player/AI who did that do not need to have done this to be evil.

Another case when you could get the same problem as you got in the screenshot if if the AI find a station location in a nearby town which is not connected by road. This problem has been present both in earlier CluelessPlus and PAXLink versions. You need to do path finding from your bus/truck stops to the tile where you path find from town to town or to the front tile of another bus stop that you know has a road to the road tile that is connected to the other town.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Thu Apr 29, 2010 3:21 pm 
Offline
Engineer
Engineer

Joined: Thu Mar 25, 2010 3:34 pm
Posts: 24
Steffl wrote:
Hi kirky_D,
thanks for testing my AI and for the bug report.
Have you modified something on the game settings? I always thought all roads inside a town are connected to the center. I can't promise you, that I can fix this bug. I think I would have to make bigger changes in the station placement algorithm. I hope the AI sees, that there is no profit on this bus service and then closes it down.


I'm afraid I havn't changed anything in the game. Standard version 1.0.0 release. No newGRF's either.


Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Sun May 23, 2010 5:12 am 
Offline
Engineer
Engineer

Joined: Tue Feb 23, 2010 3:44 pm
Posts: 103
Hi together,
I have changed some things on my AI, so that it should build faster on big maps. The bug reported by kirky_D, with not connected town roads should now also been fixed.
You can download the AI from the first post on this thread. I removed the old version.

One thing to RoadRunnerAI:

It's not its only goal, to make as much profit as possible. It tries for example to make heavy used stations, were some trucks deliver raw materials and other take the produced goods to towns. This often make jams, but I let it, as it is, because I think it looks nicer as separated stations. And it often works very good, especially in the early years.

That's all and sorry for my bad english. :P


Attachments:
RoadRunner.1.tar [310 KiB]
Downloaded 160 times
Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Sun May 23, 2010 7:07 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4533
Location: /home/sweden
Do you handle the case at eg. factories when all loading bays get used by goods trucks that infinitely will try to full load the non-existing goods?

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Mon May 24, 2010 4:45 am 
Offline
Engineer
Engineer

Joined: Tue Feb 23, 2010 3:44 pm
Posts: 103
Hmm, yes the AI checks this. It looks how many trucks are waiting for loading and then reduces the fleet size, if there are too much.
But what you said Zuu is still a big problem, because it always needs time to react to changed situations and so jams can never completely be avoided.

One problem with factorys is, that the monthly production can be very different. If a train delivers things to a factory over longer distances, it has a very high production in one month and nothing in the other months. But how to implement this to an AI is difficult. I think you would have to save the production of all factories to get a value over a longer time. Then the calculation of the required number of trucks would be more exact.

I hope I could answer your question. Thanks for your interest. Bye.


Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Mon May 24, 2010 9:08 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4533
Location: /home/sweden
I keep long term sliding mean of the amount of cargo that is waiting on the stations for adjustment of fleet size as well as long time means of how high usage the station has. (similar to your counting of how many loading slots that are used)

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Sun May 30, 2010 4:57 am 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
road runner


Attachments:
Przechwytywanie.PNG
Przechwytywanie.PNG [ 27.19 KiB | Viewed 13694 times ]

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Mon May 31, 2010 6:35 pm 
Offline
Engineer
Engineer

Joined: Tue Feb 23, 2010 3:44 pm
Posts: 103
Ah my good AI. :-)

Kogut, you have to turn in the AI settings "Build funny, dumb things(yes/no)" from "yes" to "no"
Hope it works :-)


Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Mon Jun 14, 2010 4:50 am 
Offline
Engineer
Engineer

Joined: Tue Feb 23, 2010 3:44 pm
Posts: 103
Today it is time for version 2 of RoadRunner AI.
There are many improvements, like a better handling of bus services, a primitive "ocean detector" and I removed the feature "Build funny, dumb things" (I hope so).

What do you others think of this AI? Is it already good enough to be added to the OpenTTD online content? What could maybe done better?
I know that the code performance and style is very bad. Sorry for that, but I am not really a good programmer. I did it more "just for fun" and the main thing for me is, how it performs in game.


Attachments:
File comment: RoadRunner version 2
RoadRunner.2.tar [320 KiB]
Downloaded 141 times


Last edited by Steffl on Sun Jun 20, 2010 5:39 am, edited 1 time in total.
Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Mon Jun 14, 2010 5:46 am 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
Steffl wrote:
Is it already good enough to be added to the OpenTTD online content?

Yes

Steffl wrote:
What could maybe done better?

I think it may be more competitive.

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


Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Mon Jun 14, 2010 7:20 am 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 875
Erm... I tried RoadRunner v2, and it started to spam a town with tram tracks on its first route. It is OpenTTD 1.0.1, with the Generic Tram Set (and the temperate oil wells only_decrease neutraliser).

EDIT: Always does this when I start a new game with this configuration.


Attachments:
tram tracks!.png
tram tracks!.png [ 220.54 KiB | Viewed 13469 times ]
Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Mon Jun 14, 2010 8:14 am 
Offline
Engineer
Engineer

Joined: Tue Feb 23, 2010 3:44 pm
Posts: 103
Kogut wrote:
I think it may be more competitive.


Hmm, I know the quite slow. But later in game it can reach other AIs. I don't know if I could make it faster because it has still the PathZilla algorithm, which connects first all targets to a network and this is taking some time.

@Brumi: Autsch, this looks like the depot placing algorithm goes mad. I didn't test this version with trams and newGrfs. But I will look what I can do to fix this.


Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Mon Jun 14, 2010 8:28 am 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
Steffl wrote:
@Brumi: Autsch, this looks like the depot placing algorithm goes mad. I didn't test this version with trams and newGrfs. But I will look what I can do to fix this.


There was sth similar with roads, it was unreported due to following crash of openttd.
And I think it sometimes uses too many mail vans/busses causing very interestaing traffic jams.

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


Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Mon Jun 14, 2010 7:43 pm 
Offline
Engineer
Engineer

Joined: Tue Feb 23, 2010 3:44 pm
Posts: 103
Hmm, I can't reproduce this bug. I downloaded the oil wells neutraliser and the Generic Tram Set but the AI still don't make nonsense like in your game..
Have you maybe a save game for me, Brumi?

I know something similar, when the depot placement fails. It searches then many, many places from a depot tile to the station. But it only searches a path and not build roads/trams in my games.
I think it is because the pathfinder tries to connect to the side of an drive through station. I tried to fix this, but it's not working very well.


Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Tue Jun 15, 2010 7:51 am 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 875
OK then, here is a savegame. The strange thing is that I always encounter this problem with this configuration, so it's easily reproducable for me.


Attachments:
roadrunner.sav [313.03 KiB]
Downloaded 138 times
Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Thu Jun 17, 2010 4:49 am 
Offline
Engineer
Engineer

Joined: Tue Feb 23, 2010 3:44 pm
Posts: 103
Thanks Brumi. Now I can see it too. If I found the reason for this bug I will post a new version.


Top
   
 Post subject: Re: RoadRunner AI
PostPosted: Sun Jun 20, 2010 5:37 am 
Offline
Engineer
Engineer

Joined: Tue Feb 23, 2010 3:44 pm
Posts: 103
Bug fixed. The spamming of tram tracks was caused by the depot placing function. It build first the way from depot to station and then the depot. But you can't build a depot on an existing tram track, for a road depot this doesn't matter. So it tries each possible location and the result you can see in Brumi's picture.

@Brumi: I can't reproduce the bug because i usually play maps with smaller cities. And RoadRunner only builds trams if it find a possible connection between two big cities.
And I thank you for reporting this.

One very important function was added. I thought that no good AI could live without a headquarter, so it build one now. I think this is worth the 88$ it costs. :-)

See the attached file as version 2.1.


edit: fixed a little bug


Attachments:
File comment: RoadRunner - A road-only AI
RoadRunner.2.tar [320 KiB]
Downloaded 176 times
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 70 posts ]  Go to page 1 2 3 4 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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.