[AI] Rondje om de kerk (current version: 385)

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Rondje om de kerk (version 1.3 aka svn290)

Post by Bilbo »

Rubidium wrote:
Maninthebox wrote:Our creative use of the constructor is no longer appreciated it seems
That happens when people start to file bugreports about "OpenTTD hanging" because of AIs being "creative"; people do not appreciate it if they have to wait long (without progress indication).
Well, perhaps popping up some message like "AI 'Rondje' is loading, please wait ..." during run of the constructor would reduce these bug reports.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)

Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Rondje om de kerk (version 1.3 aka svn290)

Post by Roujin »

Bilbo wrote:
Rubidium wrote:
Maninthebox wrote:Our creative use of the constructor is no longer appreciated it seems
That happens when people start to file bugreports about "OpenTTD hanging" because of AIs being "creative"; people do not appreciate it if they have to wait long (without progress indication).
Well, perhaps popping up some message like "AI 'Rondje' is loading, please wait ..." during run of the constructor would reduce these bug reports.
It has already been "taken care of": http://hg.openttd.org/openttd/trunk.hg/rev/e05cf0afd8b0
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage

Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Rondje om de kerk (version 1.3 aka svn290)

Post by Roujin »

Hey guys, I'm planning to do another AI battle royale, but I can't get your AI to run. I thought you changed it so it wouldn't take too long to initialized, but still it always says "This AI took too long to initialize. AI is not started."

I'm using a 512x512 map and start your AI via the console right at start of game.
edit: I also made sure I have the latest version of your AI, even deleted it from the content_download folder and downloaded it from this thread, no use. Also pressing the 'restart' button results in the same message again.
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage

Maninthebox
Engineer
Engineer
Posts: 107
Joined: 08 Aug 2008 11:35
Contact:

Re: Rondje om de kerk (version 1.3 aka svn290)

Post by Maninthebox »

That was a known problem, which I fixed a while ago, but forgot to upload. But with recent (aka: today) tests I ran into some new errors: we're not allowed to call do-commands in valuators and stuff and not allowed to sleep in them either. I don't see where we are doing this yet and whether this is just an issue with nightly or also in 0.7.1.
Hopefully more on this today/tomorrow.

User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: Rondje om de kerk (version 1.3 aka svn290)

Post by Dustin »

Maninthebox wrote:That was a known problem, which I fixed a while ago, but forgot to upload. But with recent (aka: today) tests I ran into some new errors: we're not allowed to call do-commands in valuators and stuff and not allowed to sleep in them either. I don't see where we are doing this yet and whether this is just an issue with nightly or also in 0.7.1.
Hopefully more on this today/tomorrow.
Fanoiz has a way to do this in his library. You need to pass "this" to the valuators since they get run in another context and that's why you get those errors. I am not clear on how to do it, since my AI started after that restriction was in place.

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Rondje om de kerk (version 1.3 aka svn290)

Post by Zuu »

I can only wish you good luck on finding the places to fix. Having fixed three AIs for the DoCommand/Sleep restrictions, yet I can't point out a specific procedure other than adding lot of debug prints for finding out where to detail study the code. Commenting away all sleep calls and usage of valuators with do-commands and then add them back one at a time may also help.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

Maninthebox
Engineer
Engineer
Posts: 107
Joined: 08 Aug 2008 11:35
Contact:

Re: [AI] Rondje om de kerk (current version: 308)

Post by Maninthebox »

The problem didn't turn out to be in our code, but a minor bug in openttd. Thanks Yexo for the help in spotting and fixing the bug :) Now with a few other minor modifications (e.g.: we had to adopt to the fact we no longer get payed if we only kick out one passenger and sell the others together with the bus :( ) it's working in any nightly equal to or newer than r17500. Have fun playing with it!

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [AI] Rondje om de kerk (current version: 309)

Post by Zuu »

I wanted to see how Rondje handles AIs like CluelessPlus which only transport passengers. And it turned out that they kept up with each other very good. Rondje got a little bit ahead in company value but by income they followed each other very closely. In addition I also included PAXLink in the game. It is not very good at getting of early and took quite a while before it took of and accidentally got enough money to buy its third aircraft and then took off (in the economy graphs). PAXLink then crashed in the beginning of 1982 (after 7 years) because of a bug that should only has existed in my development version of PAXLink. Still it managed to get the first place in income/profit and value graphs before year 10.

The game ran from 1975 to 1985. If it would have ran from 1950 to 1960 I would guess PAXLink would have got worse results since it doesn't handle the transition from small to big airports other than making sure not to land big airplanes on small airports.

Getting back to Rondje, it is not surprising that it doesn't do better compared to CluelessPlus since with passengers the benefit of only driving buses oneway is much smaller than with industries. It should have got a benefit in station rating because it used newer vehicles though and it seams to be quite good at balancing the flow of vehicles to the demand.
Unnamed, 18th Jun 1981.png
Graphs of first 5 year. Quite messy shot.
(79.59 KiB) Downloaded 39 times
Unnamed, 7th Jan 1985.png
Year 5-10
(111.47 KiB) Downloaded 38 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [AI] Rondje om de kerk (current version: 309)

Post by Zuu »

While being evil to Rondje I found this error. If you hit reload AI in the attached savegame the error occurs again, so that might help you if it is not just a typo in the code.
PAXLink, 6th Sep 1982.png
(58.74 KiB) Downloaded 44 times
Rondje.sav
r17536
AIs: Rondje, PAXLink, TownCars but it should probably crash your AI even if you don't have the other two AIs.
(442.15 KiB) Downloaded 58 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

User avatar
exelsiar
Engineer
Engineer
Posts: 19
Joined: 04 Nov 2007 14:17
Location: Fleet, Hampshire, UK
Contact:

Re: [AI] Rondje om de kerk (current version: 309)

Post by exelsiar »

got this error after i started building a route hope it helps you guys, i love the idea of this kind of AI, but really not my thing.. plus i never use road ;)

using version 7.3
Attachments
McIntosh & Co., 21st Nov 1944.png
(225.96 KiB) Downloaded 1 time
Another unspeakably horrible act commited by:
Image

Roel
Engineer
Engineer
Posts: 9
Joined: 28 Jan 2009 22:20

Re: [AI] Rondje om de kerk (current version: 309)

Post by Roel »

I have the same error as exelsiar, also running OpenTTD version 7.3
Webhosting - http://www.ejac.nl

Maninthebox
Engineer
Engineer
Posts: 107
Joined: 08 Aug 2008 11:35
Contact:

Re: [AI] Rondje om de kerk (current version: 311)

Post by Maninthebox »

It's fixed in the latest version in bananas now. I was using aiSubsidy calls only available in trunk, but not in 0.7.3.

BTW: bananas does not allow 0.7.3 as minimum version yet, so the minimum is set to 0.7.2, which is known to not work with rondje.

Maninthebox
Engineer
Engineer
Posts: 107
Joined: 08 Aug 2008 11:35
Contact:

Re: [AI] Rondje om de kerk (current version: 313)

Post by Maninthebox »

New minor update: fix call to not existing function. Thanks to jeremybennett for finding the bug.

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9415
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: [AI] Rondje om de kerk (current version: 313)

Post by planetmaker »

I just run a test round with a few AIs. This AI performed outstandingly well - until it encountered an error and sold over half of its vehicles and depoted some others and since then runs on a deficit.

EDIT: re-loading the game the next day seemed to have failed fatally:

Code: Select all

dbg: [ai] [10] [S] Your script made an error: wrong number of parameters
dbg: [ai] [10] [S] 
dbg: [ai] [10] [S] 
dbg: [ai] The AI died unexpectedly.
Attachments
error msg part1
error msg part1
error msg part2
error msg part2

User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 313
Joined: 13 Jul 2008 00:57
Contact:

Re: [AI] Rondje om de kerk (current version: 313)

Post by Michiel »

We'll have a look!

Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: [AI] Rondje om de kerk (current version: 313)

Post by Kogut »

It appeared multiple times in debug window.
Attachments
Przechwytywanie.PNG
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD

Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: [AI] Rondje om de kerk (current version: 313)

Post by Kogut »

...
Attachments
Przechwytywanie.PNG
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD

Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: [AI] Rondje om de kerk (current version: 313)

Post by Samu »

Sem nome, 1983-03-25.png
Sem nome, 1983-03-25.png (18.64 KiB) Viewed 2642 times
Hi. I think Rondje is stuck on Oil, it doesn't sell any vehicles, he has more than half of his vehicles stopped on their depots because of that Oil problem.
Attachments
Sem nome, 1983-03-25.png
Sem nome, 1983-03-25.png (18.64 KiB) Viewed 2642 times

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9415
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: [AI] Rondje om de kerk (current version: 313)

Post by planetmaker »

A small comment dedicated to this AI as based from my (short) competitive run with a number of other AIs: you did very well, but with increasing game time, you loose ground on other more competitive AIs.

Best areas of improvements now seem to be from this brief test: station rating consideration / vehicle management need some tweaks. There are stations with dozens of people waiting to be transported - but all your bus station within that town are not visited by a single bus.

Attached a screenshot which compares this AI with the best AI (AIAI) and the best train-using AI (simpleAI)

All in all: kudos, you did a great job :-)
Attachments
rondje.png
rondje2.png
rondje2.png (67.94 KiB) Viewed 2551 times

User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 313
Joined: 13 Jul 2008 00:57
Contact:

Re: [AI] Rondje om de kerk (current version: 313)

Post by Michiel »

Thanks for the feedback! It's quite usual to have unserviced bus stations, because it only builds vehicles for the most profitable routes. As you may recall, Rondje sells its vehicles on arrival, until it no longer has enough ticks to do so. In that case, you will see some busses going back and forth, but even then, it's likely they'll be on other routes.

I think you are correct about the length of the game. It won't keep up in longer games, because it takes too much time to keep rescanning the map. I'm afraid its glory days are over, now it has to compete with train and plane AIs. Still, we had a good run :D

Thanks for running the tournament, and especially for taking the time for feedback!

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests