[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

Post Reply
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 130
Joined: 30 Jan 2022 15:37
Location: Japan

[AI] AAAHogEx

Post by AAAHogEx »

Hello, everyone!

Please allow me to introduce a new AI for OpenTTD. This AI understands the supply chain on the map and builds optimal transportation routes. To do this, it has a full-fledged feeder system and estimating capabilities. This makes it highly profitable, and it can handle complex industry sets such as FIRS ECS and YETI which have been difficult to handle in the past.
As we have just released it to the Bananas, I am paying close attention to its stability, but there may be some problems yet. It would be great if you could test it and report back to me.

Note: This AI is very powerful, so it is recommended for beginners to slow down its operation using the following method. In the settings before starting the game, set the value of "#opcodes before scripts are suspended" to a lower number (for example, 2000).
ss 2024-01-23 121836.png
ss 2024-01-23 121836.png (10.64 KiB) Viewed 6713 times
Settings

Avoid removing water
Option to avoid interfering with other players' ship routes.

Force to start handling the fright, once the funds are stabilized
This AI builds based on profitability, so it may only handle passengers and mail in some environments. Option to avoid that.

Avoid secondary industry stealing
You don't have to be sad when someone steals the products of the factory you were growing.

Supported NewGRFs

station set
Industrial Stations Renewal (recommend)

vehicle set
2cc/JapanSet/North American/Dutch/UK/Czech/Iron Horse/eGRVTS/HEQS/AV8/FISH/SailingShips/NuTracks etc

industry replacement set
FIRS/ECS/YETI/NAIS etc

Please let me know if there are any NewGRFs that do not work well.
Or it's not on the list, but report that it's working is also welcome!

github: https://github.com/rei-artist/AAAHogEx

Image
Attachments
aaahogex-ss.jpg
(4.12 MiB) Not downloaded yet
Last edited by AAAHogEx on 23 Jan 2024 03:38, edited 6 times in total.
Wormnest
Engineer
Engineer
Posts: 117
Joined: 14 Jul 2013 12:33
Location: Netherlands

Re: [AI] AAAHogEx

Post by Wormnest »

Good to see a new AI appearing! It was doing great until it crashed, apparently while building a train route.

Image
Attachments
Unnamed, 1954-09-19.png
(696.43 KiB) Not downloaded yet
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 130
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

Wormnest wrote: 30 Jan 2022 21:55 Good to see a new AI appearing! It was doing great until it crashed, apparently while building a train route.
Thanks for reporting this! It seems to happen when the AI fails to create the first train after building the train route.

I've uploaded the fix as v2 to bananas. However, this time it seems that a suitable engine could not be found. This should only happen under rare conditions, as it should be searched for before the route construction. So I am curious as to why it happened. I hope there is some save data or something.
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 130
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

version 3 released!

・Fixed a crash when an industry is closed.
・Recursively calculate routes that use industries and reflect them in route building priorities.
・Moved stations closer to industries.
・Added support for trains with more than double heading. :D
aaahogex-ss2-2.jpg
aaahogex-ss2-2.jpg (42.35 KiB) Viewed 25274 times
Last edited by AAAHogEx on 07 Feb 2022 06:44, edited 2 times in total.
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 130
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

version 4 released!

・Support for 2cc Multiple Unit Wagon
・Fixed an issue where reusing bridges would fail.
・Changed the timing of retrieving trains to depot to return trip only.
・Changed YETI's building priority calculation from stockpile to supply.
・Trams support! :D

Put in a nice trams NewGRFs and let's play!
aaahogex-ss5-2.jpg
aaahogex-ss5-2.jpg (118.78 KiB) Viewed 25273 times
Last edited by AAAHogEx on 07 Feb 2022 06:44, edited 3 times in total.
GreyGhost
Engineer
Engineer
Posts: 1
Joined: 02 Feb 2022 10:54

Re: [AI] AAAHogEx

Post by GreyGhost »

Hello, your AI stubbornly ignores the ban on trucks and aviation. He builds an airport and then goes bankrupt. I understand it's because I forbade him to build airplanes.
It works fine with the ECS mod and Japanes set. But alas, only in 1900. Until airports appeared. If you create a game when there is already an airport, then he will desperately try to build only them.
Also, it is not clear to me how he takes the cargo from the enterprise if the raw materials are not delivered to the enterprise?).
But I'm still very happy! That such a beautiful game is not forgotten!!)
Last edited by GreyGhost on 02 Feb 2022 11:09, edited 1 time in total.
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 130
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

Thanks for your valuable report!
So far the only way to ban aircraft in this AI is to set max-aircraft-per-company to 0. I have implemented the check here and it should work fine. The same for trucks, etc.
https://wiki.openttd.org/en/Archive/Man ... er-company

Perhaps it is this setting that is not working well?
https://wiki.openttd.org/en/Archive/Man ... r-computer
I haven't implemented this one at all, I'll look into it!

I saw a game on Steam that I used to play over 10 years ago and got nostalgic and played it. Then I noticed that the game had a nice AI system implemented, and I was having fun with all the great AIs... So, I couldn't resist creating this AI. I too am glad that there are people playing this game. :wink:
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 130
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

version 6 released!

・Add option 'Avoid secondary industry stealing' 8)
・Fix the problem when the following settings are used: Competitors->Disable [trains/road vehicles/aircraft/ships] for computer
・Fix the problem with sending passengers to Oil Rig to grow.

By the way, I keep getting beaten up by this AI. :oops: :oops: :oops:
User avatar
odisseus
Director
Director
Posts: 597
Joined: 01 Nov 2017 21:19

Re: [AI] AAAHogEx

Post by odisseus »

I have left this AI running over 30 or so years, and it has built quite a network indeed. Great job!
Attachments
aaahogex.sav
(1.36 MiB) Downloaded 265 times
aaahogex-fs8.png
aaahogex-fs8.png (47.29 KiB) Viewed 20503 times
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 130
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

odisseus wrote: 03 Feb 2022 03:52 I have left this AI running over 30 or so years, and it has built quite a network indeed. Great job!
Thanks for the compliment! :D
The speed of PathFinder in this AI is one of the fastest in AI as far as I know, so that seems to have worked in its favor.
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 130
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

version 7 released!

・Support variable platform length
・Made the bus stop for feeders from the town closer to the station
・Some minor performance improvements
・Some minor bug fixes

If you set Settings->Limitations->Maximum length of trains to 8 or more, it will make longer trains. :D :D :D
Enjoy!

Image
Attachments
aaahogex-ss11-2.jpg
aaahogex-ss11-2.jpg (143.75 KiB) Viewed 20503 times
Last edited by AAAHogEx on 07 Feb 2022 06:46, edited 2 times in total.
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 130
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

version 10 released!

・Solved a rare crash problem related to the town bus. :P
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 130
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

version 12 released!

・Change the structure of the source station to be more realistic.
・Support 90° turns. (Settings->Vehicles->Routing->Forbid trains from making 90° turns)
・Fix minor bugs and improve performance.

Image
Attachments
aaahogex-ss18-4.jpg
aaahogex-ss18-4.jpg (790.58 KiB) Viewed 20503 times
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 130
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

version 13 released!

・Support setting 'Limitations -> Allow joining stations not directly adjacent' disabled
・More train transfers :D
・Improve rail layout
・Improve pathfinder performance
・Increase tunnel availability
・Fix: Possibility of bankruptcy when there is a refitable locomotive

aaahogex-ss28-3.jpg
aaahogex-ss28-3.jpg (236.66 KiB) Viewed 24066 times
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 130
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

Version 15 released!

Not compatible previus version saved data
Support: Multiple types of cargo in one train
Fix: Rail tracks sink under the water
Fix: Trains can get lost when extending the line
Fix: The length of the train sometimes exceeds the platform when 'Limitations->Maximum length of trains' is set to 8 or longer

Turn on the setting 'Put as many different types of freight as possible into one train'
Image
Attachments
aaahogex-ss34.jpg
aaahogex-ss34.jpg (140.42 KiB) Viewed 20503 times
krokots
Engineer
Engineer
Posts: 1
Joined: 26 Mar 2022 16:14

Re: [AI] AAAHogEx

Post by krokots »

Really amazing AI. Would it be possible to add an option to disable trams for the AI?

The AI have sometimes problems when constructing tracks. I don't know what happened here, but this is a failed line and all the trains are stuck. I'll post some other problems when I find them.
Attachments
Capture4.PNG
Capture4.PNG (234.53 KiB) Viewed 20503 times
Capture5.PNG
Capture5.PNG (168.71 KiB) Viewed 20503 times
Last edited by krokots on 26 Mar 2022 16:30, edited 1 time in total.
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 130
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

krokots wrote: 26 Mar 2022 16:27 Really amazing AI. Would it be possible to add an option to disable trams for the AI?

The AI have sometimes problems when constructing tracks. I don't know what happened here, but this is a failed line and all the trains are stuck. I'll post some other problems when I find them.
Thanks for reporting back!

What version are you trying? The latest version 15 eliminates one of the possibilities for this to happen, so if you are not up to date, please try it. However, it is not compatible with save data of the old version, so you will have to start a new game to get the new version.
(Please click '?' icon and then go to 'AI/Game Script Debug' to check the version of the AI you are running.)

I'll add the tram disabled option to the work list!
User avatar
coyoteelabs
Engineer
Engineer
Posts: 27
Joined: 07 Aug 2006 09:52
Location: Romania

Re: [AI] AAAHogEx

Post by coyoteelabs »

Thanks for the great AI.

I found a problem with it. I'm using Andrew's Conveyor Belts mod. The AI established a truck route (using the conveyor belts) and used town generated roads as part of the route resulting in a route that didn't work.

The AI should check if the roads are compatible before using them.

In the attachment, the part highlighted in yellow was added by me to allow the AI route to work. The ends of the added route are where the AI connected with the town roads.
Attachments
invalid route.png
(1.62 MiB) Not downloaded yet

Visual PNG codec - Win32 GUI based alternative for PNG codec
PNG crop - Win32 Console based tool for PNG cropping
PNG Resize - Win32 Console based tool for PNG Resizing (z0 -> z1 / z2)
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 130
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

coyoteelabs wrote: 03 Apr 2022 16:05 Thanks for the great AI.

I found a problem with it. I'm using Andrew's Conveyor Belts mod. The AI established a truck route (using the conveyor belts) and used town generated roads as part of the route resulting in a route that didn't work.

The AI should check if the roads are compatible before using them.

In the attachment, the part highlighted in yellow was added by me to allow the AI route to work. The ends of the added route are where the AI connected with the town roads.
Cool newgrf! Looks like a factorio.
I will address this in the next release. Looking forward to it.

Thank you for your valuable report.
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 130
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

Version 16 released!
  • Support: Multiple road types(supported newgrfs: RattRoads, CONVEYOR BELT etc)
    aaahogex-ss35.png
    aaahogex-ss35.png (592.87 KiB) Viewed 21415 times
  • Support: Settings->Accounting->"Infrastracture maintenance"
    • Consider maintenance costs when planning routes
    • Remove rails on deficit route
  • Support: Pathfinding to avoid mountains when traction is weak
    aaahogex-ss36.jpg
    aaahogex-ss36.jpg (84.07 KiB) Viewed 21415 times
  • Support: Disable trams option
  • Support: 3 or more bus stops in a large city
  • Fix: Issue about one station with multiple industries
  • Other minor bug fixes and improvements
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 6 guests