AI Battle Royale

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
Michiel
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 13 Jul 2008 00:57
Contact:

Re: AI Battle Royale

Post by Michiel »

Well that kinda sucks... :P

I'll check out the savegame, see what happened to ChooChoo. I don't test with any newgrfs, so it may be due to 2cc. A mountaineous map may be difficult now that I've increased the size of stations, but other than that, I can't see why it wouldn't build anything.
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 13 Jul 2008 00:57
Contact:

Re: AI Battle Royale

Post by Michiel »

Well, I found something right away when loading the savegame: seems it couldn't find an engine to build. It selects the newest available rail type, which in this case is monorail and with 2cc, that has no cargo locomotives. I think that's fixable :)

Also: it's not very happy about a map with so little towns. It picks a random tile, evaluates whether it can connect at least three towns if it were to place a crossing there, and if not, picks another. This went on for several months before it managed to find a tile that meets the criteria... I guess I'll have to extend the maximum distance it'll search for towns, since I don't really want to remove the randomness. It would be much more competitive if I did, but then it wouldn't play as nicely with multiple ChooChoos in the same game. Choices, choices...
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI Battle Royale

Post by Brumi »

I wonder how SimpleAI could even survive with so many NewGRFs... :D It is surprising to see that it has successfully used the 2cc trainset! Although 2cc for SimpleAI is the typical 'use it at your own risk'...
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: AI Battle Royale

Post by planetmaker »

Michiel wrote:Well, I found something right away when loading the savegame: seems it couldn't find an engine to build. It selects the newest available rail type, which in this case is monorail and with 2cc, that has no cargo locomotives. I think that's fixable :)

Also: it's not very happy about a map with so little towns.
Oh, well, using always the newest track type definitely is not the best choice around; this is true even more so since the advent of rail types where there may be many track types, but the cheapest or earliest may still be the best choice when it comes to starting a game.

Concerning number of towns: true, the setting I use as default is something like "low"; but that's definitely not uncommon and it's a default map which an AI should be able to handle in that respect. More towns and the whole map is covered with them with no countryside between :-)
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 13 Jul 2008 00:57
Contact:

Re: AI Battle Royale

Post by Michiel »

planetmaker wrote:Oh, well, using always the newest track type definitely is not the best choice around; this is true even more so since the advent of rail types where there may be many track types, but the cheapest or earliest may still be the best choice when it comes to starting a game.
Unfortunately, the API gives you no information about the different rail types, except build cost. There's no way to check for speed, whether it's electrified, etc. You can't even reliably tell which one is the "basic" type if there is more than one, though you could pick the cheapest.
planetmaker wrote:Concerning number of towns: true, the setting I use as default is something like "low"; but that's definitely not uncommon and it's a default map which an AI should be able to handle in that respect. More towns and the whole map is covered with them with no countryside between :-)
I'm afraid I'm gonna forfeit on this map - there's just not enough viable towns for ChooChoo's building style. However, I'll test with a low number of towns.
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: AI Battle Royale

Post by Morloth »

Michiel wrote:
planetmaker wrote:Oh, well, using always the newest track type definitely is not the best choice around; this is true even more so since the advent of rail types where there may be many track types, but the cheapest or earliest may still be the best choice when it comes to starting a game.
Unfortunately, the API gives you no information about the different rail types, except build cost. There's no way to check for speed, whether it's electrified, etc. You can't even reliably tell which one is the "basic" type if there is more than one, though you could pick the cheapest.
Not entirely true, you can check for the max speed of a rail track (http://noai.openttd.org/api/trunk/class ... 452991ed58). For engines you can check if they can run on a rail type. That should you give all the information you'll need to use the correct rail type I think.
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 13 Jul 2008 00:57
Contact:

Re: AI Battle Royale

Post by Michiel »

Nice! Unfortunately, that's only in trunk, it's not listed in http://noai.openttd.org/api/1.0.0/classAIRail.html. For now, I'm just picking the cheapest (> 0) for cargo and the newest for passenger networks.
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 13 Jul 2008 00:57
Contact:

Re: AI Battle Royale

Post by Michiel »

I'm afraid I'll have to put 2cc support on hold until a bug fix arrives. I think it's affecting NoCAB too, by the way, and probably all train AIs.
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: AI Battle Royale

Post by Morloth »

Michiel wrote:I'm afraid I'll have to put 2cc support on hold until a bug fix arrives. I think it's affecting NoCAB too, by the way, and probably all train AIs.
That's right, hope a bug fix arrives soon :).
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 9 guests