[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

AAAHogEx
Traffic Manager
Traffic Manager
Posts: 146
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

version93 released!

・[Change] Revised the calculation of airport maintenance costs.
・[Fix] An incorrect route was created if a new industry started with the same ID after a previous industry was closed.
・[Fix] Excessive CPU usage in valuator function. viewtopic.php?p=1273556#p1273556
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 146
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

version 95 released!

・[Fix] Rare crash in pathfinder
・[Fix] Updating rails sometimes updates other routes or fails
・[Fix] Trains getting stuck
xarick
Transport Coordinator
Transport Coordinator
Posts: 351
Joined: 26 Feb 2015 00:52

Re: [AI] AAAHogEx

Post by xarick »

Found a crash on version 101
Attachments
Unnamed, 2022-10-24.sav
(1.22 MiB) Downloaded 100 times
Unnamed, 2022-11-18.png
(304.11 KiB) Not downloaded yet
Formerly known as Samu
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 146
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

xarick wrote: 14 Apr 2025 19:58 Found a crash on version 101
Thanks as always for the report, xarick.

I’ve uploaded the fixed version to Bananas as version 102.

[Fix] A possible crash when using aircraft
[Change] Improved long-term profitability when inflation and infrastructure maintenance are enabled
xarick
Transport Coordinator
Transport Coordinator
Posts: 351
Joined: 26 Feb 2015 00:52

Re: [AI] AAAHogEx

Post by xarick »

AAAHogEx blocks its own ships with depots.
Attachments
Captura de ecrã 2025-04-24 214721.png
Captura de ecrã 2025-04-24 214721.png (733.33 KiB) Viewed 7148 times
ship blocked.sav
(527.95 KiB) Downloaded 63 times
Formerly known as Samu
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 146
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

xarick wrote: 24 Apr 2025 20:50 AAAHogEx blocks its own ships with depots.
Thanks for the report. I’ve released a fixed version, v108.
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 146
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

version110 released!

[Add] Option to Prefer Reusing Existing Roads

Before building new roads, the AI checks whether existing roads can be used. This helps prevent the map from becoming cluttered with too many roads. However, enabling this option may slow down AI performance and increase the likelihood of traffic congestion.

Image
Attachments
Prefer Reusing Existing Roads.png
(307.49 KiB) Not downloaded yet
GelGiGue
Engineer
Engineer
Posts: 11
Joined: 20 Feb 2024 23:04

Re: [AI] AAAHogEx

Post by GelGiGue »

AAAHogEx wrote: 01 May 2025 13:23 [Add] Option to Prefer Reusing Existing Roads
hooohoh man, that's something i've been wanting to see forever. :) the inevitable question this raises is of course, could something like this be done for railways? y'know, to finally have an actual network. if middle stations are off the table, that would certainly make up for it. though the catch to that is probably trying to get the ai to route the lines and signal directions tidy enough to pull that off.

on a completely unrelated note, i've been thinking about the idea to have some sort of option to discourage crazy multi header trains. in some cases it makes sense, but the ai always has a thing for having 1830s planet-etc. or other weak locomotives triple upto sextuple heading trains which, never looks right in early starts. i've also sometimes seen it calculate that the most economical option is to have 8 small tank engines hauling a coal train up a hill.
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 146
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

GelGiGue wrote: 08 May 2025 11:45 hooohoh man, that's something i've been wanting to see forever. :) the inevitable question this raises is of course, could something like this be done for railways? y'know, to finally have an actual network. if middle stations are off the table, that would certainly make up for it. though the catch to that is probably trying to get the ai to route the lines and signal directions tidy enough to pull that off.
I was thinking the same thing—that track sharing could probably be done with the same system I built for shared roads. If I can overlook issues like track upgrades, speed limits, and trains bunching up, the implementation cost shouldn’t be too high, though the profit performance might end up being poor. That said, it could still prove handy in more complex industry mods such as FIRS.
GelGiGue wrote: 08 May 2025 11:45 on a completely unrelated note, i've been thinking about the idea to have some sort of option to discourage crazy multi header trains. in some cases it makes sense, but the ai always has a thing for having 1830s planet-etc. or other weak locomotives triple upto sextuple heading trains which, never looks right in early starts. i've also sometimes seen it calculate that the most economical option is to have 8 small tank engines hauling a coal train up a hill.
It calculate the number of locomotives based on factors like gradients, engine horsepower, and cargo weight, but it might be erring on the high side. I’ll revisit the formula when I get some time.
xarick
Transport Coordinator
Transport Coordinator
Posts: 351
Joined: 26 Feb 2015 00:52

Re: [AI] AAAHogEx

Post by xarick »

Captura de ecrã 2025-05-28 120928.png
(85.53 KiB) Not downloaded yet
Crash in v112
Attachments
Unnamed, 2094-07-25.sav
(480.82 KiB) Downloaded 37 times
Formerly known as Samu
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 146
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

xarick wrote: 28 May 2025 11:12 Captura de ecrã 2025-05-28 120928.png

Crash in v112
Thank you as always for keeping me informed. I've released the revised version as v113.
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2239
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: [AI] AAAHogEx

Post by uzurpator »

I have a feature request.

Could the number of trains/trucks/whatever the Hog is using be limited separately? Likewise, with train lengths and RV counts per service. I can either forbid Hog from a given mode of transport or be swarmed. Likewise, if the train length is unlimited ( or set to a high value ), Hog will happily run 20-tile trains. Regardless of whether it makes sense, and, most importantly, will build 20 tile-long stations even if it does not make sense at all.

It might seem to knee-cap the AI somewhat, but I'd like to avoid excessive swarming with multiple of these on the map.

Also - for purely superficial reasons, nicer company names? Maybe?
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 146
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

uzurpator wrote: 29 May 2025 19:25 I have a feature request.
Limiting the number of vehicles or train lengths is easy to implement. However, I'm not too keen on making the settings for individual AIs too complex. Users probably don't want to deal with the cost of learning how to configure each AI separately.

Instead, I feel a more fundamental solution would be to have OpenTTD itself support per-company settings. That way, it could be used for all AIs as well as to adjust handicaps between human players, making it more broadly useful.
ondrej20
Engineer
Engineer
Posts: 2
Joined: 08 Jun 2025 10:55

Re: [AI] AAAHogEx

Post by ondrej20 »

Hi, I have trouble installing on ubuntu linux.

I check the AAAHogEx AI in Content downloading, click download, 253kB gets downloaded but when I reopen the Online Content window, it's unchecked again.

Log says

Code: Select all

dbg: [misc] [squirrel] Failed to compile 'aaahogex-113/info.nut'
Your script made an error: the index doesn't exist

CALLSTACK
*FUNCTION [main()] aaahogex-113/info.nut line [142]
Any idea?
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 146
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

ondrej20 wrote: 08 Jun 2025 10:58 Hi, I have trouble installing on ubuntu linux.

I check the AAAHogEx AI in Content downloading, click download, 253kB gets downloaded but when I reopen the Online Content window, it's unchecked again.

Any idea?
Could you please tell me the version number of OpenTTD you’re using? If it’s not the latest, updating to the newest version might help improve things.
khz
Engineer
Engineer
Posts: 1
Joined: 11 Jun 2025 04:43

Re: [AI] AAAHogEx

Post by khz »

Hello, I am from Indonesia.
Sorry if my English is not good

I have been playing with this AI for quite a while and there haven't been any issues before.

However, after I found out about the game modification by adding NEWGRF, I downloaded all the modules created by Temporal8.
When I started playing, this AI did not begin creating projects until the 5th year. I haven't tried for a longer time.
ondrej20
Engineer
Engineer
Posts: 2
Joined: 08 Jun 2025 10:55

Re: [AI] AAAHogEx

Post by ondrej20 »

AAAHogEx wrote: 08 Jun 2025 23:31
ondrej20 wrote: 08 Jun 2025 10:58 Hi, I have trouble installing on ubuntu linux.

I check the AAAHogEx AI in Content downloading, click download, 253kB gets downloaded but when I reopen the Online Content window, it's unchecked again.

Any idea?
Could you please tell me the version number of OpenTTD you’re using? If it’s not the latest, updating to the newest version might help improve things.
yeah, I had 13.4, upgrading to 14 helped, thanks
AAAHogEx
Traffic Manager
Traffic Manager
Posts: 146
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

khz wrote: 11 Jun 2025 04:50 However, after I found out about the game modification by adding NEWGRF, I downloaded all the modules created by Temporal8.
When I started playing, this AI did not begin creating projects until the 5th year. I haven't tried for a longer time.
Please feel free to upload your save data here. It might help me identify the issue.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Google [Bot] and 5 guests