PX Patches -- train decouple, modular airport ...

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

pulsexlb
Engineer
Engineer
Posts: 14
Joined: 27 Sep 2026 07:00
Location: Beijing

PX Patches -- train decouple, modular airport ...

Post by pulsexlb »

Since vanilla OpenTTD lacks some interesting features, such as train uncoupling, I developed this patch set based on JGR Patch Pack.
The vast majority of the code in this patch set was generated using artificial intelligence technology, so I currently have no intention of merging it upstream.

Train Uncoupling
This feature originally came from YPS Patch. I enhanced its functionality on top of it, including support for choosing a station for coupling, and for using a specified schedule after uncoupling. It also makes it legal for a locomotive to be in the middle of a train; in vanilla OpenTTD, locomotives can only be at the front of a train. A setting can be enabled to allow trains from different companies to couple with each other.

Modular Airports
Ported from the Multitile Airport Patch. I mainly just did some porting to the new version, removed the NewGRF-unfriendly feature that restricts aircraft by airport type, and didn't add much extra functionality.

Custom Nameable Reusable Schedules
Players can now create a nameable schedule, just like a normal vehicle's schedule. A vehicle can choose to execute a specified schedule from its own schedule; after execution, it will jump back to the vehicle's original schedule and continue. It can also choose to execute a specified schedule after uncoupling.

Vehicle Transport
The original implementation of vehicle transport came from the road-veh-transport patch, and pxp made some modifications and optimizations to it. Now, certain types of trains, aircraft, and ships can transport cars, and trains can be transported by ships, meaning that features such as ferries can now be implemented in the game.
This version is open source on GitHub: https://github.com/pulsexlb/OpenTTD-patches
And I wrote documentation for it: https://pulsexlb.github.io/OpenTTD-patches/

---

Side note: When I first released this in August, it sparked some controversy and discussion on Discord. As for whether to use AI, I fully understand and respect the OpenTTD official developers' decision to reject AI code from entering the OpenTTD main branch; this helps the core developers understand and master the code and promotes long-term development. However, this patch set will be developed using AI, because I don't have time to read, understand, and maintain OpenTTD's millions of lines of code. For this reason, I currently have no intention of merging it upstream. At the same time, for this project, PRs are welcome whether they are developed manually or with AI, and I will also regularly look at other interesting patches and merge them in.
:bow:
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1897
Joined: 30 Mar 2005 09:43

Re: PX Patches -- train decouple, modular airport ...

Post by peter1138 »

Sigh.
He's like, some kind of OpenTTD developer.
blackeagle
Engineer
Engineer
Posts: 17
Joined: 23 Aug 2022 06:10

Re: PX Patches -- train decouple, modular airport ...

Post by blackeagle »

peter1138 wrote: 02 Oct 2026 11:26Sigh.
AI has it's place without a doubt. It can get you up to speed with a huge codebase (like OpenTTD) much quicker than figuring it all out yourself. It can aggregate data from all over the web and present it in a readable format, much quicker than I could. It can run through your code and highlight issues that a compiler would compile but then cause a crash (nullptr de-reference, double free etc).

BUT, it has a narrow view of things. I've had AI reject PR's for an open-source project that I am a team member of, because it doesn't understand or see the bigger picture. Nothing wrong with my code, nothing wrong with the logic, but AI says "no", so the PR just sits there.

I don't think any project these days should just reject AI written stuff just because it's AI, or include it for the same reason. Could AI have written the code I did? Absolutely. Did it? No. Did it understand what I had written ? Yes, but only in a narrow context that didn't take into account the broader picture. Did it understand it well enough to approve the PR? No, because it couldn't see the broader picture.

AI can be a fantastic tool and allow people with say, less coding experience, to add or alter open source software to produce an outcome they are happy with, but it should always be down to a human to decide whether or not to accept said code. And that shouldn't be based on whether or not 90% of it was AI generated, it should be based on whether the code does what it should, in the way that it should, and follows the coding guidelines of the project involved. If the PR works as intended, has no unintentional side-effects, passes all current and new tests and is well documented, then providing it contributes positively to a project, why would it be a candidate for rejection? AI is a tool at the end of the day, like Lint, or CPPcheck or SonarQube. If the suggestions are right and the code does what it should, without introducing regressions (and on the project I contribute to, that is the biggest bugbear - can't break backwards compatibility!), then why does it matter what tools were used to write it?

Don't get me wrong, I have an overwhelming dislike of AI in general, as well as many personal experiences that were negative, but I can still see where and how it can be a positive tool if used and instructed correctly, so maybe, don't dismiss anything that used AI to write large portions of it, out of hand immediately. If it does what it should, when it should, without breaking anything then, why is that, regardless of what or who actually generated the code, a bad thing ?
User avatar
jfs
Tycoon
Tycoon
Posts: 1987
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: PX Patches -- train decouple, modular airport ...

Post by jfs »

Reminder that OpenTTD is licensed under the GNU GPL v2 license, and there is (to my knowledge at least) no publicly available LLM model today that can generate program text that can also guarantee that the program text generated is not wholly or partially copied near-verbatim from software licensed under terms incompatible with the GPL license.
User avatar
GoldMine
Traffic Manager
Traffic Manager
Posts: 197
Joined: 31 Oct 2024 20:59

Re: PX Patches -- train decouple, modular airport ...

Post by GoldMine »

AI should for my taste only be used to help debug code, to find issues, but never to actually write code that you would copy/paste into your project.
Logging, error and exception handling is the father and mother of all debugging.
pulsexlb
Engineer
Engineer
Posts: 14
Joined: 27 Sep 2026 07:00
Location: Beijing

Re: PX Patches -- train decouple, modular airport ...

Post by pulsexlb »

In today's release of pxp 2610.2, I've added rainy weather to OpenTTD. See the documentation: https://pulsexlb.github.io/OpenTTD-patc ... rainy.html
I don't think this is a breaking feature, and I really hope the official team will eventually implement a full weather system.
User avatar
SwissFan91
Tycoon
Tycoon
Posts: 2427
Joined: 08 Feb 2009 18:36
Location: Switzerland

Re: PX Patches -- train decouple, modular airport ...

Post by SwissFan91 »

I don’t have the ability to test the rain in game, but how about snow that then affects the in-game snowline, is that possible? :)
Screenshot Thread: Here
Videos: Glacier Express, Lotschberg Line, Arosa Line
Total Alpine Replacement Set: Industry, Town, Objects
pulsexlb
Engineer
Engineer
Posts: 14
Joined: 27 Sep 2026 07:00
Location: Beijing

Re: PX Patches -- train decouple, modular airport ...

Post by pulsexlb »

SwissFan91 wrote: 03 Oct 2026 20:58 I don’t have the ability to test the rain in game, but how about snow that then affects the in-game snowline, is that possible? :)
I did not do special treatment for snowy areas, because I think the style of snow and rain is about the same.And now that it rains, it's just a simple matter of adding 3 raindrop layers to the world to move and shake randomly. If you distinguish between rain and snow, you also need to introduce additional complexity and performance overhead.
Babel_TTT
Engineer
Engineer
Posts: 6
Joined: 25 Jun 2024 10:21

Re: PX Patches -- train decouple, modular airport ...

Post by Babel_TTT »

Why is no one discussing actual gameplay, and everyone is talking about AI issues instead?
------
So how does you think that it is put together with slop?As I known AI is better than most of amateru developer,all the programmers I know, from freelancers to who in 500 companies, all use AI.
However it just work and looks goods
------
Re Peter:
If everyone be required to read all the source code manually before making major changes, features like shunting would never be arrived.
Re GoldMine:
Howerver, if companies not employ AI, wokers will
Last edited by Babel_TTT on 05 Oct 2026 10:08, edited 3 times in total.
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1897
Joined: 30 Mar 2005 09:43

Re: PX Patches -- train decouple, modular airport ...

Post by peter1138 »

Because nobody wants to play a game put together with slop.
He's like, some kind of OpenTTD developer.
User avatar
Haiyan2008
Engineer
Engineer
Posts: 4
Joined: 05 Oct 2026 08:21
Location: PRC Dalian Jinzhou

Re: PX Patches -- train decouple, modular airport ...

Post by Haiyan2008 »

peter1138 wrote: 05 Oct 2026 07:52 Because nobody wants to play a game put together with slop.
Who is slop? :|
苟利国家生死以,岂因祸福避趋之?
User avatar
Haiyan2008
Engineer
Engineer
Posts: 4
Joined: 05 Oct 2026 08:21
Location: PRC Dalian Jinzhou

Re: PX Patches -- train decouple, modular airport ...

Post by Haiyan2008 »

peter1138 wrote: 05 Oct 2026 07:52 Because nobody wants to play a game put together with slop.
I don't really understand the situation in which you said 'slop,' but isn't that a bit too rude?
苟利国家生死以,岂因祸福避趋之?
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1897
Joined: 30 Mar 2005 09:43

Re: PX Patches -- train decouple, modular airport ...

Post by peter1138 »

Haiyan2008 wrote: 05 Oct 2026 08:38 I don't really understand the situation in which you said 'slop,' but isn't that a bit too rude?
Oh dear, "rude", how will the corporations pushing this stuff on everyone cope?

Anyway...
pulsexlb wrote: 01 Oct 2026 15:03 However, this patch set will be developed using AI, because I don't have time to read, understand, and maintain
Is almost a text-book description of slop.
He's like, some kind of OpenTTD developer.
User avatar
GoldMine
Traffic Manager
Traffic Manager
Posts: 197
Joined: 31 Oct 2024 20:59

Re: PX Patches -- train decouple, modular airport ...

Post by GoldMine »

Babel_TTT wrote: 05 Oct 2026 07:13 Why is no one discussing actual gameplay, and everyone is talking about AI issues instead?
I'm consulting AI about various coding issues, AI pretty much struggles in majority of cases, sometimes even obvious errors that I make AI can't figure out but instead suggests to fix something which isn't a problem at all.
I'd not entrust AI to write any code, it just sucks too bad, makes too many blunders.

But I use it anyway for consultations because debugging is faster with AI, as long as you do sanity check of its output.

So overall AI sucks, I don't understand how some companies can even consider to employ AI.
Logging, error and exception handling is the father and mother of all debugging.
pulsexlb
Engineer
Engineer
Posts: 14
Joined: 27 Sep 2026 07:00
Location: Beijing

Re: PX Patches -- train decouple, modular airport ...

Post by pulsexlb »

peter1138 wrote: 05 Oct 2026 08:58
Haiyan2008 wrote: 05 Oct 2026 08:38 I don't really understand the situation in which you said 'slop,' but isn't that a bit too rude?
Oh dear, "rude", how will the corporations pushing this stuff on everyone cope?

Anyway...
pulsexlb wrote: 01 Oct 2026 15:03 However, this patch set will be developed using AI, because I don't have time to read, understand, and maintain
Is almost a text-book description of slop.
Yeah, ok, using ai is slop in OpenTTD -- a pseudo-open source authoritarian game that is self-righteous and prevents players from contributing. I'm using ai but it's not that I can't program. You think the current openttd very exquisite?
pulsexlb
Engineer
Engineer
Posts: 14
Joined: 27 Sep 2026 07:00
Location: Beijing

Re: PX Patches -- train decouple, modular airport ...

Post by pulsexlb »

Is almost a text-book description of slop.
I am extremely angry about this. A project that took two whole months of intensive effort to polish was still rudely dismissed as “slop.” That is a direct blow from the official developers to the community. In open-source projects, forking and developing independently when your ideas conflict with the official branch is completely justified. And this kind of comment undoubtedly deals a major blow to the community’s interest in development. Do you really think OpenTTD is a project like Linux, without which the world cannot run?
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1897
Joined: 30 Mar 2005 09:43

Re: PX Patches -- train decouple, modular airport ...

Post by peter1138 »

Babel_TTT, please use the reply feature instead of editing your post every time.
He's like, some kind of OpenTTD developer.
Babel_TTT
Engineer
Engineer
Posts: 6
Joined: 25 Jun 2024 10:21

Re: PX Patches -- train decouple, modular airport ...

Post by Babel_TTT »

peter1138 wrote: 05 Oct 2026 10:44 Babel_TTT, please use the reply feature instead of editing your post every time.
yeah. It's a habit from wikidot
Babel_TTT
Engineer
Engineer
Posts: 6
Joined: 25 Jun 2024 10:21

Re: PX Patches -- train decouple, modular airport ...

Post by Babel_TTT »

Anyway only a few players will care about the code behind game and the negligible performance loss. I support the gameplay innovations, as long as they run normaly.
User avatar
GoldMine
Traffic Manager
Traffic Manager
Posts: 197
Joined: 31 Oct 2024 20:59

Re: PX Patches -- train decouple, modular airport ...

Post by GoldMine »

pulsexlb wrote: 05 Oct 2026 10:07 A project that took two whole months of intensive effort to polish was still rudely dismissed as “slop.”
If I'm not mistaken "Slop" was btw. coined to MS on Discord, users complained something about AI and called the firm microslop.
This angered MS so much that they decided to publish a manifesto about how they will ban users from their discord if they continue to call them like this.
This then further made users even more calle them microslop and MS lost the funny battle.

Bottom line "slop" is anything made by AI, a derogatory term. it's not aimed at your project.
You shouldn't take it to your heart, if it's made by AI then it should be expected to receive pushback.
Logging, error and exception handling is the father and mother of all debugging.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 3 guests