[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
xarick
Transport Coordinator
Transport Coordinator
Posts: 336
Joined: 26 Feb 2015 00:52

Re: [AI] AAAHogEx

Post by xarick »

I got a savegame, but it's probably without saved data. I'll try to get one autosave before the month it crashed next time.
Attachments
autosave10.sav
(16.96 MiB) Downloaded 55 times
Unnamed, 1951-06-04.png
(171.3 KiB) Not downloaded yet
Formerly known as Samu
xarick
Transport Coordinator
Transport Coordinator
Posts: 336
Joined: 26 Feb 2015 00:52

Re: [AI] AAAHogEx

Post by xarick »

Here's a different crash, too much memory usage. Unfortunately I don't have a savegame. I really should setup my testings properly.

EDIT: I reproduced this one. Here's 2 savegames. One before the crash, the other after the crash.
Attachments
Unnamed, 1936-06-25.png
(399.18 KiB) Not downloaded yet
autosave2.sav
(11.79 MiB) Downloaded 55 times
autosave1.sav
(11.56 MiB) Downloaded 53 times
Formerly known as Samu
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

xarick wrote: 18 Mar 2023 17:46 Here's a different crash, too much memory usage. Unfortunately I don't have a savegame. I really should setup my testings properly.

EDIT: I reproduced this one. Here's 2 savegames. One before the crash, the other after the crash.
Thank you for your report.
It seems that the problem occurs when the setting "#opcodes before scripts are suspended" is increased too much (25 times the default) in both cases.
I have not tested this change. I will add it to the list of fixes.
xarick
Transport Coordinator
Transport Coordinator
Posts: 336
Joined: 26 Feb 2015 00:52

Re: [AI] AAAHogEx

Post by xarick »

xarick wrote: 18 Mar 2023 17:21 I got a savegame, but it's probably without saved data. I'll try to get one autosave before the month it crashed next time.
Just got it. One savegame is before the month it crashed, the other is of the month it crashed.
Attachments
autosave0.sav
(16.36 MiB) Downloaded 54 times
Unnamed, 1945-07-05.png
(421.56 KiB) Not downloaded yet
autosave15.sav
(17.58 MiB) Downloaded 57 times
Formerly known as Samu
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

xarick wrote: 19 Mar 2023 11:27 Just got it. One savegame is before the month it crashed, the other is of the month it crashed.
Thank you! It will be helpful.
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

Version 39 released!

・FIX: The problem of building bus stops outside of town.
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7238
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: [AI] AAAHogEx

Post by Redirect Left »

Another issue I have noticed. It often leaves stations lying about with 0 services. I'm not sure if it built them and then ignored them, or if they were used before, but didn't delete them when it cancelled services there.
Neither the RV stop, nor the train station is in use. Although AAAHogEx still runs trains on the rail line next to the station, and also there's a single RV stopping in the other RV stops in town.
Hawthorn & Co., 2052-04-12.png
(351.73 KiB) Not downloaded yet
and also a save if you're able to figure out more from them
TEST 9.sav
(4.61 MiB) Downloaded 46 times
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: [AI] AAAHogEx

Post by uzurpator »

Running the AI on non-square map crashes it almost instantly.
Tried on 128x4096, 64x4096 and 128x256
aicrash.jpg
(1.49 MiB) Not downloaded yet
It really likes to sell its trains. I've run it and one of them started to run goods only to sell returning trains in the return route and buy new ones at the station. If this is intentional - probably best to sell at the destination and buy at source :)
aiseller.jpg
(2.34 MiB) Not downloaded yet
Lastly - out of curiosity - is it possible to optimize track once it is built? Many AIs do this:
ai_rollercoaster.jpg
(2.04 MiB) Not downloaded yet
Anyhow - this AI is very aggresive, I've run four of them head to head and starting at 1930, by 1944 all of them were Chairmen.
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: [AI] AAAHogEx

Post by uzurpator »

It also overestimates number of trains necessary to handle given traffic. This was going towards one 750goods factory to one town.
trains.jpg
(2 MiB) Not downloaded yet
Also 2000x2000 and 4000x4000 maps seem to astound them and they never build anything.
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

Redirect Left wrote: 19 Mar 2023 19:04 Another issue I have noticed. It often leaves stations lying about with 0 services. I'm not sure if it built them and then ignored them, or if they were used before, but didn't delete them when it cancelled services there.
Neither the RV stop, nor the train station is in use. Although AAAHogEx still runs trains on the rail line next to the station, and also there's a single RV stopping in the other RV stops in town.
Thank you for your report. It has been left in place to be reused in case of problems at the station ahead. I also tried to implement removing it, but there were problems with trains wandering in and blocking the line at certain times, so it is left.
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

uzurpator wrote: 19 Mar 2023 19:57 Running the AI on non-square map crashes it almost instantly.
Tried on 128x4096, 64x4096 and 128x256

aicrash.jpg
Thank you for your report. This did not occur in my environment. I would like to have the save data if it is still available, because it may occur only in certain settings. Also, when you take a screenshot, it would be more helpful if you could take a screenshot of the part of the source code where the line numbers are displayed.
It really likes to sell its trains. I've run it and one of them started to run goods only to sell returning trains in the return route and buy new ones at the station. If this is intentional - probably best to sell at the destination and buy at source :)
AAAHogEx has a system that changes the composition of the trains when the amount of freight brought to the station changes, so trains are sometimes sold frequently for this purpose. The sale is done at the nearest depot, so in some cases this may be linked to efficiency.
Lastly - out of curiosity - is it possible to optimize track once it is built? Many AIs do this:

Anyhow - this AI is very aggresive, I've run four of them head to head and starting at 1930, by 1944 all of them were Chairmen.
I think it would be very attractive if I could do it. AAAHogEx sometimes converts existing rails into bridges to build another line under them, but on very rare occasions the trains stop. Rebuilding the rail after it has been built is very risky for the AI, so I am not very aggressive about it. The human player can control the train according to the situation, but the AI cannot even know the direction of the train, which makes it difficult.
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

uzurpator wrote: 19 Mar 2023 20:44 It also overestimates number of trains necessary to handle given traffic. This was going towards one 750goods factory to one town.

trains.jpg

Also 2000x2000 and 4000x4000 maps seem to astound them and they never build anything.
This also does not occur in my environment, so I would like to receive the save data if possible.
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7238
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: [AI] AAAHogEx

Post by Redirect Left »

AAAHogEx wrote: 20 Mar 2023 02:19
Redirect Left wrote: 19 Mar 2023 19:04 Another issue I have noticed. It often leaves stations lying about with 0 services. I'm not sure if it built them and then ignored them, or if they were used before, but didn't delete them when it cancelled services there.
Neither the RV stop, nor the train station is in use. Although AAAHogEx still runs trains on the rail line next to the station, and also there's a single RV stopping in the other RV stops in town.
Thank you for your report. It has been left in place to be reused in case of problems at the station ahead. I also tried to implement removing it, but there were problems with trains wandering in and blocking the line at certain times, so it is left.
Ah, fair enough then I guess? It does do it a lot though, in the same game I found 2 more almost immediately :shock:
2023-03-20 03_02_35-OpenTTD 13.0.png
2023-03-20 03_02_35-OpenTTD 13.0.png (404.42 KiB) Viewed 1757 times
2023-03-20 03_04_11-OpenTTD 13.0.png
2023-03-20 03_04_11-OpenTTD 13.0.png (298.42 KiB) Viewed 1757 times
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

Redirect Left wrote: 20 Mar 2023 03:05 Ah, fair enough then I guess? It does do it a lot though, in the same game I found 2 more almost immediately :shock:
I do not know if that is ultimately the right decision. However, I have made that decision based on a comparison of the advantages and disadvantages at this point in time.

Oh, and the latest version no longer creates RoadStations outside of town, so give it a try!
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

Version 40 released!

・FIX: Fail to save when the number of trains reached several thousand.
・FIX: Out of memory when setting "#opcodes before scripts are suspended" to a large value.
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: [AI] AAAHogEx

Post by uzurpator »

AAAHogEx wrote: 20 Mar 2023 02:51 Thank you for your report. This did not occur in my environment. I would like to have the save data if it is still available, because it may occur only in certain settings. Also, when you take a screenshot, it would be more helpful if you could take a screenshot of the part of the source code where the line numbers are displayed.
attached - screenshot with the 'callstack', I persume and a save game.

EDIT: attached a game where I squatted in the corner and then run the game for 10 years. AI has built nothing 4kx4k map.
File is too large to attach so here is a download link
https://www.swisstransfer.com/d/6fe39c1 ... 60466fd9a7
Attachments
crash_non_square.sav
(342.28 KiB) Downloaded 48 times
crash_non_Square.jpg
(403.71 KiB) Not downloaded yet
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

uzurpator wrote: 20 Mar 2023 14:50
AAAHogEx wrote: 20 Mar 2023 02:51 Thank you for your report. This did not occur in my environment. I would like to have the save data if it is still available, because it may occur only in certain settings. Also, when you take a screenshot, it would be more helpful if you could take a screenshot of the part of the source code where the line numbers are displayed.
attached - screenshot with the 'callstack', I persume and a save game.

EDIT: attached a game where I squatted in the corner and then run the game for 10 years. AI has built nothing 4kx4k map.
File is too large to attach so here is a download link
https://www.swisstransfer.com/d/6fe39c1 ... 60466fd9a7
Thank you for your prompt attention. I will look into it.
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: [AI] AAAHogEx

Post by uzurpator »

Playing with this AI is an absolute chaos. But its usage of trains is stellar, composition wise. But I feel it is a touch too expedient with its usage if just about anything infrastructure wise. Especially buoys.
Attachments
buoys.jpg
(827.13 KiB) Not downloaded yet
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

uzurpator wrote: 20 Mar 2023 16:05 Playing with this AI is an absolute chaos. But its usage of trains is stellar, composition wise. But I feel it is a touch too expedient with its usage if just about anything infrastructure wise. Especially buoys.
I don't know of any other good ideas for buoys; AAAHogEx has buoys every 16 tiles, and it would be easy to increase the spacing. However, increasing the spacing slows down OpenTTD and increases the risk that stray boats will start circling. In other words, I think all AIs that use ships, not just AAAHogEx, do it the same way.
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: [AI] AAAHogEx

Post by uzurpator »

Can they re-use their own buoys? If there is a buoy, say, 4-8 tiles away and it is reachable from the place the AI would place a new one then use the existing one? Moreover - it could do the same with roads, including roads from other AIs. Otherwise it likes to build way, way too many roads.

Generally - Hog has the same issues as most AIs do, it tends to overspend for the service that it can realistically expect, and only wins because of the excellent linking/transfer use, train composition and sheer aggresiveness. I just started a tropic game and one of the AIs was at 100 trains in two years of gameplay. Nuts.
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Ahrefs [Bot] and 7 guests