[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
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

version 26 released!

* Save data is incompatible with previous versions.

・Support canals :o
・Change transportation plan to an estimate basis
・The direction of the tracks on the double track was aligned as much as possible
・Performance improvement of ships
・Performance improvement of 1700s/1800s NewGRFs
・Performance improvement when infrastructure maintenance enabled
・Consider aerodynamic drag
・Consider station rating
・If AITown.GetLastMonthProduction() returns an abnormal value, ignore it
・Use AICargo.GetWeight() (openttd version 13 or higher)
・Add option: Freight only
・Add option: Disable prefixed station names
・FIX: AI stalled during pathfinding of freight
・FIX: A train not running on a 600mm Narrow Gauge
・FIX: Crash during converted rail
・Other minor bugs fix and adjustment

SS2_20230210_090120.png
SS2_20230210_090120.png (632.42 KiB) Viewed 1947 times
User avatar
bigyihsuan
Engineer
Engineer
Posts: 39
Joined: 23 Jul 2013 07:41

Re: [AI] AAAHogEx

Post by bigyihsuan »

I'm running 8 of AAAHogEx-es on a 4k-by-4k save in JGRPP, but I keep getting them crashing. Attached is the save game, with 8 of these AIs crashing due to "AddNgPlace" not existing.

Image
Image

I'm running JGRPP v0.51.1, Renewed Village Growth v90, and a much of NewGRFs, mainly AXIS:

Image
Attachments
Hamilton & Co. axis.sav
(13.37 MiB) Downloaded 50 times
User avatar
bigyihsuan
Engineer
Engineer
Posts: 39
Joined: 23 Jul 2013 07:41

Re: [AI] AAAHogEx

Post by bigyihsuan »

Someone on the /r/OpenTTD Discord server helped me out and found that it was the "Avoid secondary industry stealing" option that was causing the crashes.
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

bigyihsuan wrote: 08 Mar 2023 05:58 Someone on the /r/OpenTTD Discord server helped me out and found that it was the "Avoid secondary industry stealing" option that was causing the crashes.
Thank you for your report. As you said, the crash was caused by "Avoid secondary industry stealing". I have released a fixed version as version 30. I also added a little consideration for the "day length factor". :bow:
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

Incidentally, 1 AAAHogEx is usually stronger than 8 AAAHogEx because multiple AAAHogEx take resources from each other.
muppet9010
Engineer
Engineer
Posts: 6
Joined: 14 Jun 2022 13:48

Re: [AI] AAAHogEx

Post by muppet9010 »

I often found enough staggering on the AI starting dates "helps" reduce that, atleast early on. I know it's unfair on the later starting AIs, but on a large map I don't find it really matters much.
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

muppet9010 wrote: 10 Mar 2023 12:23 I often found enough staggering on the AI starting dates "helps" reduce that, atleast early on. I know it's unfair on the later starting AIs, but on a large map I don't find it really matters much.
That method might work. Since the resource conflict is caused by the time lag between resource search and route construction. However, it might cause a conflict because the search starts at the same time when save/load is done. Another way to prevent conflicts could be to use "Available cargo types" in the AI settings, or to separate the available vehicle types. But in any case, it is almost impossible for AIs to cooperate with each other, so they may be weaker than a single AI.
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

version 33 released!

・FIX: "Avoid secondary industry stealing" is disabled after 10 years.
・FIX: Rail conversion sometimes fails.
・Other minor bugs fix and adjustment
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 »

I came across this interesting placement of station & tracks whilst using AAAHOGEx, v33 for this thread mass stress testing AI.
The station is placed oddly, and this forces the tracks to give harsh turning curves and also facilitates the need for a bridge. Instead of just building the station a little to the left where it could connect straight out of the tunnel. The choice also meant the tracks incoming were the wrong way around and needed uncrossing into the station.
2023-03-16 02_11_56-OpenTTD 13.0.png
2023-03-16 02_11_56-OpenTTD 13.0.png (523.99 KiB) Viewed 1667 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: 16 Mar 2023 02:18 I came across this interesting placement of station & tracks whilst using AAAHOGEx, v33 for this thread mass stress testing AI.
The station is placed oddly, and this forces the tracks to give harsh turning curves and also facilitates the need for a bridge. Instead of just building the station a little to the left where it could connect straight out of the tunnel. The choice also meant the tracks incoming were the wrong way around and needed uncrossing into the station.
Thank you for your report. You are right, there may be a more optimal layout. However, AAAHogEx prioritizes making a profit that can compete with humans over a beautiful layout.

Calculating the optimal layout takes a huge amount of computation time. The AI probably chose this location after calculating how many passengers the station is likely to attract and how easy it is to make connections, etc. Since AAAHogEx's priority is to establish routes quickly and make a profit, it does not sacrifice computation time and pays as much attention to the layout as possible, but the result sometimes results in a strange layout. :oops:
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

version 34 released!

・FIX: Miscalculation of route estimates
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: 16 Mar 2023 12:22 but the result sometimes results in a strange layout. :oops:
My report was based upon it surely being more profitable (or rather, cheaper to start with / requiring less funds to build) to have connected it correctly, given it would have saved money on bridges which are a bit $ sucking, as well as less track. The AI also smartly (Cheatingly to some, but not me!) places bus stops in towns to extend its range, so even if it had built it slightly to the left so the tracks were on the right course straight into station, it could have still captured citizens from the same (and possible some from the other too).

Granted, I know AI are not perfect, same as humans, my networks are always a bit of a sham, and sometimes look like i was drunk building parts of it, but this one felt a bit too out of place, it made similar oddities throughout, but this one was by far the most egregious, and trust me even then, it's far better than some other AI creations I've had during the mass testing to-date. Thanks for replying so quickly though! :D

edit: I just noticed some of its town placements were a little off course (in the same larger image above), I'm not sure what it was doing there?
2023-03-16 16_38_53-Transport Tycoon Forums - Post a reply.png
2023-03-16 16_38_53-Transport Tycoon Forums - Post a reply.png (7.81 KiB) Viewed 1633 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: 16 Mar 2023 17:14 My report was based upon it surely being more profitable (or rather, cheaper to start with / requiring less funds to build) to have connected it correctly, given it would have saved money on bridges which are a bit $ sucking, as well as less track. The AI also smartly (Cheatingly to some, but not me!) places bus stops in towns to extend its range, so even if it had built it slightly to the left so the tracks were on the right course straight into station, it could have still captured citizens from the same (and possible some from the other too).

Granted, I know AI are not perfect, same as humans, my networks are always a bit of a sham, and sometimes look like i was drunk building parts of it, but this one felt a bit too out of place, it made similar oddities throughout, but this one was by far the most egregious, and trust me even then, it's far better than some other AI creations I've had during the mass testing to-date. Thanks for replying so quickly though! :D

edit: I just noticed some of its town placements were a little off course (in the same larger image above), I'm not sure what it was doing there?
This is likely the result of trying to maximize the increase in profit per computation time as well. Trying to calculate the best placement would make the AI very slow and therefore not profitable. How did AAAHogEx's profit in that game compare to other AIs? If you give me your save data I may be able to improve it a bit more.
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: 17 Mar 2023 02:26 How did AAAHogEx's profit in that game compare to other AIs? If you give me your save data I may be able to improve it a bit more.
If I recall correctly, it was near the top, if not top. I don't keep save files from all the tests, otherwise i'd be swamped with multiple PC's on the go for it lol
I have updated AAAHogEx (as well as ChooChoo) in my latest batch of testing, so far its going well, and it is currently at the top of the list after 20 years, even if it is doing it at the cost of some oddities.
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: 17 Mar 2023 03:10 I have updated AAAHogEx (as well as ChooChoo) in my latest batch of testing, so far its going well, and it is currently at the top of the list after 20 years, even if it is doing it at the cost of some oddities.
Thanks for trying the latest version. I will do some research on the strange placement. There may be a way to improve it without sacrificing computation speed.
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

Version 36 released!

・Slightly improved performance around airports, etc.
xarick
Transport Coordinator
Transport Coordinator
Posts: 336
Joined: 26 Feb 2015 00:52

Re: [AI] AAAHogEx

Post by xarick »

Got many too long to saves already, I thought I had reported it once already, but apparently I didn't.
Attachments
Unnamed, 1935-08-04.png
(618.53 KiB) Not downloaded yet
Formerly known as Samu
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 »

Crash whilst doing my mass testing again. One I've not had before, so that's refreshing at least!

If it helps here is the save from it too, as you can expect it's looking a bit chaotic from AI. Note I was using v35 as it was newest when i started this test, not your latest v36, but you don't mention changing anything here, so it might be the same on that version?
TEST 6.sav
(3.93 MiB) Downloaded 44 times
Attachments
2023-03-17 19_40_13-OpenTTD 13.0.png
2023-03-17 19_40_13-OpenTTD 13.0.png (36.15 KiB) Viewed 1550 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: 17 Mar 2023 19:43 Crash whilst doing my mass testing again. One I've not had before, so that's refreshing at least!
Thank you for your report. I checked and it seems that this was happening since v34 two days ago, I have released a fixed version as v37.
AAAHogEx
Engineer
Engineer
Posts: 111
Joined: 30 Jan 2022 15:37
Location: Japan

Re: [AI] AAAHogEx

Post by AAAHogEx »

xarick wrote: 17 Mar 2023 19:34 Got many too long to saves already, I thought I had reported it once already, but apparently I didn't.
I am glad you are testing it. It appears that this is occurring due to too many train routes. I am interested in what conditions would cause that many trains to increase, do you have any saved data left?
I have tried settings that seem to be more likely to occur by shortening trains, etc., but in 100 years we are still not even a third of the way there. It will likely take another 200 years or so to replicate the bug.

Image
Attachments
ss 2023-03-18 131433.png
(988.74 KiB) Not downloaded yet
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 3 guests