FS#6634 - Most AI scripts from official extensions crash frequently

Attached to Project: OpenTTD
Opened by Wuzzy (Wuzzy) - Wednesday, 01 November 2017, 20:00 GMT
Type Bug
Category Script → NoAI
Status New
Assigned To No-one
Operating System All
Severity Critical
Priority Normal
Reported Version 1.7.0
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


The AI system in OpenTTD is pretty much broken, and broken by design.

Expected behaviour: Install OpenTTD, launch singleplayer game, soon competition spawns (like players are used to from TTD).
Actual behaviour: No competitions spawns ever. You are forever alone.
Why this is bad: TTD was all about competition, so is OpenTTD. Competition is not only there to compete, but also supplies industries with goods so they can start producing. Competition in singleplayer is thus *important*.

Workaround: Download a bunch of AI scripts from extension menu, then try again. If you happen to be offline, you're screwed.

But now comes the REAL bug:

Expected behaviour of the workaround: Soon competition will spawn and you can singleplayer like you were used to in TTD. Nothing crashes ever. You have a good time.
Actual behaviour of the workaround: AI crashes frequently, and apparently all across the board (various scripts), ruining the game. You can restart the AI, but this wipes out all their assets. You rage-quit.

I won't post specific names and logs, this is besides the point. The point is, these crashes are *common* and many scripts seem to be affected. I am using 28 AI scripts, only from the official repository (in-game menu), so this should be a decent sample.
I have the impression that there is a complete lack of QA for any scripts from the extensions menu. I believe this because crashes are common enough that they would be catched by even the most liberal QA.

So here is my proposal to fix this:
1) Ship at least one tried-and-tested high-quality AI by default
2) Use this AI by default
3) Make testing this AI script part of the usual OpenTTD QA process
4) Regularily pull known broken AI scripts from the extensions download service (in-game), and require script authors to fix their broken scripts. Eventually they will get the message ;-)
5) Require AI scripts to survive strict test cases before they are even allowed to be in the extensions
6) If a script crashes in OpenTTD, not only disable this scipt, but also automatically pull it from the pool of AIs to randomly choose from

1), 2), 3): Players have a reasonable expectation that a TTD clone has competition in singleplayer without ANY further ado. Most players don't care about the differences of the various AIs available. Additional AI downloads should be optional, not required
4), 5): Should be pretty obvious. Broken scripts should stop propagating to the actual players. And scripters need to learn their stuff and do their homework. Players don't want to be beta testers ;)
6) Basically damage control. If a script is known to be broken, but may be excecuted again, it's doomed to fail, so this needs to be prevented

My OS: Parabola (Arch Linux variant), with Linux-libre 4.13.5 as kernel.
This task depends upon