[AI] AAAHogEx

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

muppet9010
Engineer
Engineer
Posts: 3
Joined: 14 Jun 2022 13:48

Re: [AI] AAAHogEx

Post by muppet9010 »

Does the AI consider how much of an industry's resources are already being taken, or just the industries potential max production (regardless of how many companies are currently taking them) ?
I ask as am surprised how it often chooses to directly compete with me vs empty areas of the map that look to have approximate the same production rates and distances involved.

Really like the AI's strategy approach, transfer ideas and how it enlarges its routes over time. Did notice a few things that are less ideal below.

Also if you have multiple instances of this AI then they all seem to build exactly the same routes. Example is with 3 of the AI each set to start 30 days apart.
They each build between the same 2 towns and even after up and running they all made near 0 income. I restarted 2 of the AI's and they rebuilt between the same town again lol.
To kick start them I gave them a few hundred thousand each, but a year apart. The first built a coal line and then a year later the second built the exact same line that the first was servicing.

If you set the starting loan lower (£200,000 or lower) with medium costs and infrastructure cost enabled the AI's often run out of cash on their first build. Or they end up building a rubbish starting train as they are short of cash. They do seem to get their bus routes built in towns they pass and in a passenger city they are going to service. So it looks like they need to build all their stations (including passing towns) and track, then build their actual money making trains, then they can build their buses to maintain local authority reputation and to ferry passengers in the towns later once they have the proper cash starting to come in.

EDIT:
Here's the save for my post.
AAA Hog Ex.sav
(1.01 MiB) Downloaded 9 times
Danwell Coal - Where the red AI built first and then later the Green AI built the same line.
Sinnbridge - Passenger route they all started with and insisted they wanted to rebuild even when the AI was restarted. This is also the route the AI's initially spent soo much money on buses and other things they could only afford the most basic trains to start.
Last edited by muppet9010 on 16 Jun 2022 17:18, edited 1 time in total.
AAAHogEx
Engineer
Engineer
Posts: 18
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

muppet9010 wrote: 14 Jun 2022 13:57 Does the AI consider how much of an industry's resources are already being taken, or just the industries potential max production (regardless of how many companies are currently taking them) ?
I ask as am surprised how it often chooses to directly compete with me vs empty areas of the map that look to have approximate the same production rates and distances involved.

Really like the AI's strategy approach, transfer ideas and how it enlarges its routes over time. Did notice a few things that are less ideal below.

Also if you have multiple instances of this AI then they all seem to build exactly the same routes. Example is with 3 of the AI each set to start 30 days apart.
They each build between the same 2 towns and even after up and running they all made near 0 income. I restarted 2 of the AI's and they rebuilt between the same town again lol.
To kick start them I gave them a few hundred thousand each, but a year apart. The first built a coal line and then a year later the second built the exact same line that the first was servicing.

If you set the starting loan lower (£200,000 or lower) with medium costs and infrastructure cost enabled the AI's often run out of cash on their first build. Or they end up building a rubbish starting train as they are short of cash. They do seem to get their bus routes built in towns they pass and in a passenger city they are going to service. So it looks like they need to build all their stations (including passing towns) and track, then build their actual money making trains, then they can build their buses to maintain local authority reputation and to ferry passengers in the towns later once they have the proper cash starting to come in.

EDIT:
Here's the save for my post. AAA Hog Ex.sav
Danwell Coal - Where the red AI built first and then later the Green AI built the same line.
Sinnbridge - Passenger route they all started with and insisted they wanted to rebuild even when the AI was restarted. This is also the route the AI's initially spent soo much money on buses and other things they could only afford the most basic trains to start.
You have done a good job of discovering the weaknesses of this AI.

> Does the AI consider how much of an industry's resources are already being taken, or just the industries potential max production (regardless of how many companies are currently taking them) ?

No, it does not. The algorithm does not consider it for the following reasons

1. even if this AI develops a resource for which no one is competing, it will often be taken away from competitors in the end.
2. it takes a certain amount of computation time to determine how many competitors there are for every resource, and how much of the resource is available for transportation.

Furthermore, this AI does not use random functions as much as possible to check the correctness of the algorithm. This is to identify whether the result is correct by chance or if it has been calculated correctly.
Therefore, as you pointed out, there is a weakness that the AIs will compete with each other if you start several at the same time.

> If you set the starting loan lower (£200,000 or lower) with medium costs and infrastructure costs enabled the AI's often run out of cash on their first Or they end up building a rubbish starting train as they are short of cash. So it looks like they need to build all their stations (including passing towns) and track, then build their So it looks like they need to build all their stations (including passing towns) and track, then build their actual money making trains, then they can build their buses to maintain local authority reputation and to ferry passengers in the towns later once they have the proper cash starting to come in. have the proper cash starting to come in.

There is room for improvement here, too.
This will be a hint for future improvement. Thank you very much.
muppet9010
Engineer
Engineer
Posts: 3
Joined: 14 Jun 2022 13:48

Re: [AI] AAAHogEx

Post by muppet9010 »

thanks for the reply.

Yea it is certainly the nicest AI I have tried playing against as it develops its network in to greater profit over time and doesn't rely on spamming the map with just additional lines doing the same route in anywhere near the same frequency as many others :D
muppet9010
Engineer
Engineer
Posts: 3
Joined: 14 Jun 2022 13:48

Re: [AI] AAAHogEx

Post by muppet9010 »

BTW noticed the AI doesn't fully handle a ban on 90 degree turns.
90degree.PNG
90degree.PNG (470.05 KiB) Viewed 45 times

also it seems to struggle with canals on the map. it sort of recognises them as being an issue, but then in trying to avoid them destroys them anyways.
canals.PNG
canals.PNG (698.26 KiB) Viewed 45 times
The red line is where the canal was. The AI built up to it (the down and up track to sea level) and stopped as it couldn't afford to continue. When I returned it had done this.
Note the tracks covered in green where added later. It was just the 2 middle tracks being built at the time. With the double bridge track being built first and the bad tunnel track being built as the return track.
AAAHogEx
Engineer
Engineer
Posts: 18
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

Thank you for your accurate report.

Actually, I had noticed the problem itself, but had put it off because the solution seemed a little troublesome.
However, the fact that you are reporting it to me in this way means that the time has come for me to take action. :wink:
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 0 guests