Is it possible to make list of only those cargoes which are allowed to autorefit?
Presenting a filtered list to the player is misleading, because it may not be the same list used for any given refit cycle when the vehicle actually visits the station.
There are two problems.
(1) Possible to set invalid orders, which look valid.
(2) The refit may be non-deterministic.
To explain a little more.
- it is easy to imagine case where newgrf author does weird things like restrict refit by date, etc. We don't
need to worry about the silly cases, the sensible cases are already broken.Invalid orders
- it is easy for newgrf author to do something they think is sensible, such as limiting by class
- a chain of refits (in different orders) might cross class boundaries in one direction only, into a dead end. e.g. A can refit B, B can refit C, but C can't refit A.
- an order may be valid when initially set, but changes to other orders leave this order broken.
I discovered these broken orders with real code in FISH, which initially had class-based refit limitations. The discovery of it caused a total redesign of how FISH ships worked, resulting in Squid.
In theory, following any order change, the orders UI could scan all orders for consistency, and popup some warning. In theory. In practice it would be adding more complexity to an orders UI that is already stretched. It would need error highlighting (red) adding for the broken orders, and it would require a disruptive modal warning. It also would do nothing for the second case.Non-deterministic refits
- future refits are totally non-deterministic from the point of view of the orders UI. (For pedantry, they follow strictly deterministic rules in the code, but within a simulation which is non-deterministic).
- result of 'refit any available' is unknowable in advance
- players can use advanced orders for non-deterministic routing
- player can skip orders, or change orders at any timeSummary
Can't be fixed in the UI. The current situation is not good, because if newgrf authors restrict refits, players can create invalid orders and receive no warning about it. But trying to solve that in OpenTTD is worse, because it's work, and the situation is fundamentally unfixable.Conclusion
Newgrf authors should not restrict autorefit in any way at all. Autorefit should always be allowed to every cargo in the set of refittable cargos for a vehicle.
I'm going to get on a soapbox (which I might fall off at any point), and say that newgrf authors in this case are responsible
for not breaking the game for players by introducing possibility of invalid orders.
I thought I had added a friendly note to newgrf wiki advising not to use any refit restrictions, but seems I misremembered. Comment
So why was this cb option added at all?
- was asked for by people who sounded like they had a good case for it
- not all pitfalls are knowable in advance