Page 4 of 4
Re: AI Battle Royale
Posted: 03 Jul 2010 14:58
by Michiel
Well that kinda sucks...
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.
Re: AI Battle Royale
Posted: 03 Jul 2010 15:23
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...
Re: AI Battle Royale
Posted: 03 Jul 2010 16:09
by Brumi
I wonder how SimpleAI could even survive with so many NewGRFs...

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'...
Re: AI Battle Royale
Posted: 03 Jul 2010 16:20
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

Re: AI Battle Royale
Posted: 03 Jul 2010 18:04
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.
Re: AI Battle Royale
Posted: 03 Jul 2010 18:27
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.
Re: AI Battle Royale
Posted: 03 Jul 2010 18:45
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.
Re: AI Battle Royale
Posted: 04 Jul 2010 23:42
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.
Re: AI Battle Royale
Posted: 05 Jul 2010 10:28
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

.