Thanks so much for sharing SuperLib with us - I've gotten back into playing around with writing an AI in OpenTTD (after a first crack at it back when NoAI was still its own experimental branch) and it's a huge help in handling a lot of the low-level things an AI needs to do all the time.
I'm having an issue with road pathfinding in SuperLib version 39 (downloaded through BaNaNaS). It seems like, no matter what number of maximum iterations I set when trying to find a route with RoadBuilder, the pathfinder doesn't time out. With logging set to LVL_DEBUG, I always see "PF loops used: 0" and I never see the expected "SuperLib: Finding path took to long -> abort" message from RoadPathFinder in the log.
From digging around a bit, it seems like accumulated_iterations never gets incremented in _SuperLib_RoadPathFinder::FindPath - I'm not sure if I'm doing something wrong, or if it's a bug, so I thought I'd bring it to your attention.
Played with this a bit more - if I add
this.accumulated_iterations += num_iterations_to_run;
at line 372 in roadpathfinder.nut, iterations are tracked properly as expected, but then _SuperLib_RoadBuilder::DoPathfinding returns false after the first try, as at line 177 it breaks out of the for loop when any non-false value is returned - that's easy enough to fix by changing the condition to only be non-false non-null values:
if(path) break; // found path?
After changing this, the second try crashes the AI with the following error:
dbg: [script]  [S] Your script made an error: You are not allowed to change parameters of a running pathfinder.
dbg: [script]  [S]
dbg: [script]  [S] *FUNCTION [_set()] pathfinder.road-4\main.nut line 
dbg: [script]  [S] *FUNCTION [InitializePath()] library\SuperLib-40\roadpathfinder.nut line 
dbg: [script]  [S] *FUNCTION [DoPathfinding()] library\SuperLib-40\roadbuilder.nut line 
This is where I get lost - I can hack around this by re-instantiating the pathfinder inside the while loop in that function, but that breaks something else that I don't quite understand. Things seem to work fine, but in this case when _SuperLib_RoadBuilder::ConnectTiles calls itself recursively, the second call seems to just report success without building anything, causing the route to be unfinished without throwing an error.
I've attached a copy of SuperLib with the changes I made during this troubleshooting, in case it's helpful - I incremented the version to 40 during this so it wouldn't break anything else I have installed that uses v39.
Aha, I think I figured it out - the issue I mentioned in the previous edit occurs then ConnectTiles recurses in the case where DoPathfinding() made it to the second try - in that case, the path that's generated goes from connect_tile2 to connect_tile1. As a result, the path that's sent to the inner call of ConnectTiles ends up being the part of the route that's already built, which of course succeeds. I was able to get around this by actually flipping the values of connect_tile1 and connect_tile2 after the first pathfinding fails, rather than just flipping the order - this version of the library is attached as SuperLib-edit2.tar.gz.