SuperSimpleAI v25 (Old Stable), v47 (Stable) and v48 (Testing)

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

User avatar
3iff
Tycoon
Tycoon
Posts: 1095
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: SuperSimpleAI v25 (Old Stable), v41 (Stable) and v45 (Testing)

Post by 3iff »

Absolutely my pleasure...

I really like the way V45 uses double road stations. Somehow I never quite thought of doing that (in that way).
It also makes upgrading the stations to through stations a lot easier.
Wanabe
Engineer
Engineer
Posts: 1
Joined: 07 Jul 2023 10:34

Re: SuperSimpleAI v25 (Old Stable), v41 (Stable) and v45 (Testing)

Post by Wanabe »

Hello, it seems I have managed to find a combination of settings/newGRF to get V45 of Super Simple AI to crash in JGR 0.54.2 (https://github.com/JGRennison/OpenTTD-patches/releases). If I had to geuss based on the name of the Function in the stack trace it's due to Mail being removed from the game via viewtopic.php?t=87332 ( Improved Town Industries 2).

I've played other games close to vanilla settings with Super Simple running in the background and it seems rather stable in those configurations, even after long sessions or many years and multi-session plays. I like the simplicity of this AI overall. While it can certainly struggle or otherwise get itself into serious trouble it can also be surprisingly effective with what it does.

While I'm posting I'll add that I've noticed that sometimes it has trouble with train lines with 90 degree turns turned off and can get the trains stuck going in and out of a depot. The trains I've seen stuck did technically have an indirect route if it just turned and went to the nearest train station first but the pathfinder couldn't figure that out for the AI.

Other than the above occuring here and there my only real gripe with SuperSimpleAI is probably how slow it takes to calculate/pathfind its new routes it's building. It could understandably be intentional, of course. Sometimes though it can take so long building a train route for example that I've seen it trying to build one for multiple years and then eventually demolish it.

Cheers and thanks for developing this AI for the community.
Attachments
Wanabe&Fenix.sav
(953.55 KiB) Downloaded 91 times
Error1.png
(222.62 KiB) Not downloaded yet
Error2.png
(112.86 KiB) Not downloaded yet
Jaume
Engineer
Engineer
Posts: 57
Joined: 24 Aug 2007 15:43

Re: SuperSimpleAI v25 (Old Stable), v41 (Stable) and v46 (Testing)

Post by Jaume »

Thank you for your report Wanabe :-)

I don't have time these days, this new version 46 only fixes the crash reported at last reply by Wanabe, and a little protection for the problem reported by 3iff recently: now this AI don't try to use roadveh/train/aircraft if they are disallowed in GameSettings. But, I think, pathfinding may hang the AI if these configuration changes when it is pathfinding.

And, since v44, replacing road vehicles doesn't work well. Some road vehicles are stopped in depots for months, until they are removed.

This version is poorly tested!
Jaume
Engineer
Engineer
Posts: 57
Joined: 24 Aug 2007 15:43

Re: SuperSimpleAI v25 (Old Stable), v41 (Stable) and v47 (Testing)

Post by Jaume »

Hi all,

Version 47 is here. It fixes another (and unusual) crash.
User avatar
3iff
Tycoon
Tycoon
Posts: 1095
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: SuperSimpleAI v25 (Old Stable), v41 (Stable) and v47 (Testing)

Post by 3iff »

Not sure if this is fixed in V47, but I finally grabbed an issue with V45...but I've left the screenshot at home (Sorry)

Anyway, the details are in MAIN.NUT line 537 (of version 45).
The AI tries to add a wagon...and on rare occasions, WAGON = NULL but there's no check for this possibility.
It then tries to check the minspeed (or maxspeed?) of a non-existant item and it crashes the AI.
It's a very rare event which is why I've had trouble tracking it.
I'll try and get the screenshot here next time I'm on but maybe that's enough info to be going on with?
(Ah, is that the bugfix in V46??)

Meanwhile, I'll try V47.
User avatar
3iff
Tycoon
Tycoon
Posts: 1095
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: SuperSimpleAI v25 (Old Stable), v41 (Stable) and v47 (Testing)

Post by 3iff »

Sorry about the misinformation above. I had the wrong file and wrong line number...

Anyway, it looks like the problem may have been investigated by you in V46 (the code had been changed) and using V47 I haven't seen the issue again.
Jaume
Engineer
Engineer
Posts: 57
Joined: 24 Aug 2007 15:43

Re: SuperSimpleAI v25 (Old Stable), v47 (Stable) and v48 (Testing)

Post by Jaume »

Hi all! I'm back!

New version 48 is here. Tons of code, a few changes in rail building, and some fixes:

Fixed malfunction in train engine cache.
Fixed some trash (isolated depots) when building a rail route and source or destination industry closes.
Rail stations that accepts or provides two cargos looks for the two cargos (using NewGRF, of course).
Faster railbuilding, using fake passing lanes (like checkpoints) between passing lanes. This changes how passenger rail routes are made.
Save data when replacing small airport by big one.
Station tile now is far as possible from the other station. This improves incoming, especially in short routes with long trains.

You can download this version of SuperSimpleAI from first post. Enjoy it!
Jaume
Engineer
Engineer
Posts: 57
Joined: 24 Aug 2007 15:43

Re: SuperSimpleAI v25 (Old Stable), v41 (Stable) and v45 (Testing)

Post by Jaume »

3iff wrote: 16 May 2023 13:19
AI building a rail service, every 6-7 days it buys/sells an engine (maybe checking it can do so).
It is because a malfunction in the engine cache. It is fixed in v48.
3iff wrote: 16 May 2023 13:19 However, I disabled AI from building trains during this process (while it was pathfinding). The script complained that it couldn't build the engine and then seemed to stop doing anything.
I think that is a problem with PathFinder Lib. Simply it hangs. I don't know how to fix it.
3iff wrote: 16 May 2023 13:19 There is also the issue with making a vehicle class (trains or RVs) unavailable during the AI process of trying to build that type of service. (Does that make sense??)
Currently it seems to just stop (perhaps waiting for that vehicle class to become available).
Well, before building something this AI makes all checks. But it doesn't make this check while building. Maybe it can be done...

Thank you 3iff
Jaume
Engineer
Engineer
Posts: 57
Joined: 24 Aug 2007 15:43

Re: SuperSimpleAI v25 (Old Stable), v41 (Stable) and v45 (Testing)

Post by Jaume »

Wanabe wrote: 07 Jul 2023 10:59
Other than the above occuring here and there my only real gripe with SuperSimpleAI is probably how slow it takes to calculate/pathfind its new routes it's building. It could understandably be intentional, of course. Sometimes though it can take so long building a train route for example that I've seen it trying to build one for multiple years and then eventually demolish it.
Try v48 with FastPathFinder enabled (it's enabled by default). It has the effect of dividing the distance of two points to build rails by two, using 1/4 of time to calculate it. But it can do some strange turns in the route.

Thank you Wanabe!
User avatar
3iff
Tycoon
Tycoon
Posts: 1095
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: SuperSimpleAI v25 (Old Stable), v47 (Stable) and v48 (Testing)

Post by 3iff »

Jaume,

Thanks for the continued support. I've very glad to help detect any bugs that sneak through.
I'll try the new version when I get a chance and hopefully I won't be reporting any problems!
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 3 guests