Way are my AIs "giving up"

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

Post Reply
defaultluser
Engineer
Engineer
Posts: 34
Joined: 01 Mar 2009 19:56

Way are my AIs "giving up"

Post by defaultluser »

Okay, I played a game with many different AIs, and the Convoy and NoCAB were keeping pace with me for a long time, building massive road networks. But then, after about 20 years, the AIs stopped doing anything. They stopped expanding, and didn't replace ancient road vehicles that were %0 reliable. The AIs even had money in their accounts to replace the vehicles and build more networks!

NoCAB eventually recovered, but Convoy never recovered, and is still a dead weight. Hundreds of vehicles are stopped in depots, and hundreds more are limping along. I'm sure all the other AIs love this, because his broken-down fleet is clogging all the roads.

Can anyone figure what's going on here? I was just playing a regular game over several days with Beta 0.7, saving and picking it back up.
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: Way are my AIs "giving up"

Post by Morloth »

Hi defaultuser,

Thanks for testing the AIs, I'm glad NoCAB could keep up but you're right to state it doesn't 'upgrade' its existing connections and vehicles. It is something I'm working on this moment and should be fixed in version 2.0 of NoCAB. At the moment I also use a nondeterministic algorithm to determine which connection to build and due to its random nature it will overlook certain connections and might need a couple of tries before it finds them. In the beginning this isn't a problem as new connections are easy to find, but later on it will get more though. I'm currently working to improve this behaviour so NoCAB should be able to catch up much faster once I release the new version.

By any chance, do you have a save game / screenshots to show the results? I'm quite interested in the results of your experiment.

Thanks! :)
defaultluser
Engineer
Engineer
Posts: 34
Joined: 01 Mar 2009 19:56

Re: Way are my AIs "giving up"

Post by defaultluser »

Okay, now that I've looked back it's only Convoy that gave-up. The reason I misinterpreted is because Convoy was in the lead, and had hundreds of vehicles on the road; by giving-up, he stopped traffic for all AIs, so they couldn't compete. NoCAB did continue to upgrade their lines, but couldn't generate the revenue growth they had previously.

In the save I have attached, Convoy was matching me, and NoCAB 2 was on a steady growth. Then Convoy stopped replacing vehicles, and stopped spending money - he had 7 million in the bank as of this save, and a ton of older vehicles running.

Here is a screenshot and save game from 1970. Note that the large dip in my profits (blue) is from the recession. Could this have done something to Convoy?
Attachments
Reston Transport, 5th Sep 1970.png
Reston Transport, 5th Sep 1970.png (165.35 KiB) Viewed 859 times
Reston Transport, 5th Sep 1970.sav
(190.78 KiB) Downloaded 206 times
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: Way are my AIs "giving up"

Post by Morloth »

defaultluser wrote:Okay, now that I've looked back it's only Convoy that gave-up. The reason I misinterpreted is because Convoy was in the lead, and had hundreds of vehicles on the road; by giving-up, he stopped traffic for all AIs, so they couldn't compete. NoCAB did continue to upgrade their lines, but couldn't generate the revenue growth they had previously.

In the save I have attached, Convoy was matching me, and NoCAB 2 was on a steady growth. Then Convoy stopped replacing vehicles, and stopped spending money - he had 7 million in the bank as of this save, and a ton of older vehicles running.

Here is a screenshot and save game from 1970. Note that the large dip in my profits (blue) is from the recession. Could this have done something to Convoy?
Thanks for the save game,

It could very well have been that the cities were already saturated and that would be a reason for Convoy to stop expanding. Remember that Convoy doesn't handle any connections between industries (yet?). It's spectacular to see how well Convoy handles cities and towns :).

I would like to advise you however not to use two of the same AIs in a map, in almost all cases the AIs will select the same industries / towns to server and will effectively compete each other to bankruptcy. I think each AI performs best on its own against other AIs / humans.

thanks again :)
defaultluser
Engineer
Engineer
Posts: 34
Joined: 01 Mar 2009 19:56

Re: Way are my AIs "giving up"

Post by defaultluser »

Morloth wrote:
defaultluser wrote:Okay, now that I've looked back it's only Convoy that gave-up. The reason I misinterpreted is because Convoy was in the lead, and had hundreds of vehicles on the road; by giving-up, he stopped traffic for all AIs, so they couldn't compete. NoCAB did continue to upgrade their lines, but couldn't generate the revenue growth they had previously.

In the save I have attached, Convoy was matching me, and NoCAB 2 was on a steady growth. Then Convoy stopped replacing vehicles, and stopped spending money - he had 7 million in the bank as of this save, and a ton of older vehicles running.

Here is a screenshot and save game from 1970. Note that the large dip in my profits (blue) is from the recession. Could this have done something to Convoy?
Thanks for the save game,

It could very well have been that the cities were already saturated and that would be a reason for Convoy to stop expanding. Remember that Convoy doesn't handle any connections between industries (yet?). It's spectacular to see how well Convoy handles cities and towns :).

I would like to advise you however not to use two of the same AIs in a map, in almost all cases the AIs will select the same industries / towns to server and will effectively compete each other to bankruptcy. I think each AI performs best on its own against other AIs / humans.

thanks again :)
That's great advice, but there are only so many AIs available for download. I had Admiral AI and PAX in the game I posted, but neither could compete. To be hones, PAX sucks unless you give it tons of seed money, and Admiral blows all it's money trying to do too many things at the start (several abandoned stations and construction attempts, including several train lines), and then always defaults to road vehicles once all the money is blown.

Do you know of any other AI worth my time? If so, how do you install them?

I suppose it would benefit me if I limited the number of AI and assigned them explicitly.
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: Way are my AIs "giving up"

Post by Morloth »

defaultluser wrote: That's great advice, but there are only so many AIs available for download. I had Admiral AI and PAX in the game I posted, but neither could compete. To be hones, PAX sucks unless you give it tons of seed money, and Admiral blows all it's money trying to do too many things at the start (several abandoned stations and construction attempts, including several train lines), and then always defaults to road vehicles once all the money is blown.

Do you know of any other AI worth my time? If so, how do you install them?

I suppose it would benefit me if I limited the number of AI and assigned them explicitly.
I'm afraid all AIs you can currently use are few. But if you want you can take a look at the latest SVN version of NoCAB, it has several improvements over 1.10 and is quite good (I think) on larger maps. So try it out on a 512x512 map and see if you can win from it :).

Good luck, let me know what happens 8).

P.S. To install it, drop it in your Documents/OpenTTD/ai map and delete the NoCAB folder there.
Attachments
NoCAB.tar
NoCAB - SVN revision 268
(270 KiB) Downloaded 179 times
defaultluser
Engineer
Engineer
Posts: 34
Joined: 01 Mar 2009 19:56

Re: Way are my AIs "giving up"

Post by defaultluser »

Okay, I loaded your latest NoCAB, and played a game on Hard settings, 512x512. As a concession, I bumped-up the initial loan to $300,000, just to see if AdmiralAI would build trains, and also to see if PAX would SURVIVE.

My first update: 1956. So-far, it's been AdmiralAI vs NoCAB, and NoCAB is winning. AdmitalAI is building pure road vehicles, AGAIN. I'm impressed that NoCAB has built a shipping route, that's the first time I've EVER seen a TT AI do that :)

Unfortunately, the bountiful resources (and their aversion to trains) also mean that the AIs can't compete with me.

But we'll see what the future brings. Convoy has a solid first line built, and PAX has just entered the game. Hopefully, Convoy won't stop responding like in the last game. I'll play more tomorrow, and post more progress.
Attachments
Fenhill Transport, 24th Feb 1956.png
Fenhill Transport, 24th Feb 1956.png (172.79 KiB) Viewed 803 times
Fenhill Transport, 8th Feb 1956.sav
(375.82 KiB) Downloaded 206 times
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: Way are my AIs "giving up"

Post by Morloth »

Not happy about it performance, but thanks for testing :).

A couple of tips though, set the setting 'Construction speed of compeditors' to 'Very fast'. This gives a boost to the speed of AIs which just might make a difference.

I've adjusted a couple of things in NoCAB, most notably its decision making speed and it now takes into account local authorities. I noticed you put the construction costs on high, which means that NoCAB will sometimes create a line without the chance to place road stations. But for your setup trains are very suited and I'm afraid my AI won't be able to compete unless I teach it how to use trains and that might take a little while :/.

Nonetheless here is the latest nightly, feel free to test it :).
- Bram
Attachments
NoCAB.tar
NoCAB - SVN 271
(270 KiB) Downloaded 188 times
defaultluser
Engineer
Engineer
Posts: 34
Joined: 01 Mar 2009 19:56

Re: Way are my AIs "giving up"

Post by defaultluser »

Okay Morloth, I got a chance to play tonight. Same game settings, with SVN 271. I also added Fan AI just for a little more fun.

I also decided to start the game pure vehicles, then expand into trains later.

The AIs are keeping pace with me, except for the usual poor performance of PAX (And Fan, but it's new). NoCAB is doing very well, and is coming back from behind to challenge even Convoy :)

Convoy is destroying me, just like it has in previous games, but I will play this one through this time so I can see if it give-up again.
Attachments
Kinston Transport, 9th Dec 1958.png
Kinston Transport, 9th Dec 1958.png (153.62 KiB) Viewed 770 times
Kinston Transport, 20th Nov 1958.sav
(383.89 KiB) Downloaded 169 times
defaultluser
Engineer
Engineer
Posts: 34
Joined: 01 Mar 2009 19:56

Re: Way are my AIs "giving up"

Post by defaultluser »

An interesting development: in the game above, Convoy has already stopped responding. Take a look at this from 1961: three full years with no construction or expansion.

NoCAB is looking good though :)
Attachments
Kinston Transport, 14th Apr 1961.png
Kinston Transport, 14th Apr 1961.png (143.9 KiB) Viewed 862 times
Kinston Transport, 31st Mar 1961.sav
(397.81 KiB) Downloaded 238 times
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: Way are my AIs "giving up"

Post by Morloth »

I'm always a little confused by your screens. The name of the NoCAB company is always terminated with a '#2' which indicated there was another NoCAB AI earlier in the game. What happened with it of is it some kind of funny coding error on my part? :x

But thanks for your tests, will be very useful for the next release :).
X_stream
Engineer
Engineer
Posts: 18
Joined: 04 Nov 2004 13:29
Location: Bussum => Netherlands
Contact:

Re: Way are my AIs "giving up"

Post by X_stream »

A small reply from my part, I believe that some AI's (convoy maybe) don't have a working save/load function.
So when you save the game, exit and load it again later, those AI's may not be able to pick up again, and will do nothing instead.
Maybe this is an explanation for the "giving up" of some AI's.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Way are my AIs "giving up"

Post by Zuu »

If an AI stops after save/load then the author has added code that stops the AI from doing anything if it loads a game. This is a good thing I would say, as else without proper save/load code it would not remember its old routes or other information it stores that it is not able to read from the map.

The only AI I know that handles save/load is my PAXLink since I have designed it so it will not need to do anything in the save/load functions as it reads everything from the map using the API. The AI is more a test of a concept than a good working AI at least in terms of making profit. But also it doesn't make sure its airport stations are built properly from time to time. Neither does it check that the "grid bus stations" have a route to each other. It simply assumes that all road in a town is connected with all parts.

There might be other AIs that have implemented save/load that I am not aware of.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Re: Way are my AIs "giving up"

Post by GeekToo »

Convoy does not do save /load ( Admiral does, I believe), but the funny thing is that when I load your savegame the yellow company is named Convoy, but in the AI debug window ( under the question mark), in fact it is another AI.
Maybe there was a problem when loading the savegame and a random AI started. If you're sure it is Convoy, could you show the AIdebug window, to show what the AI is doing? Because Convoy does not save/load, but it should continue constructing (provided some connections can be made). Renewal of vehicles is not (yet) implemented for Convoy.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 5 guests