New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change: Decouple town cargo production from cargo type. #11378
Conversation
I'm not sure whether this automatically disqualifies the approach. |
I agree. My creative abuse in Improved Town Industries is not necessarily behavior we need to continue to support. 😉 |
Is it possible to apply a preview tag to a draft PR? Would be nice to play with this a bit to see the effects first hand 🙂 |
It's possible to add preview label, but preview can't access content server. You would only test changes without newgrf and I think there's nothing to see in this case. |
Hmm, ok. I could have sworn there was a way to add NewGRFs to the web version but maybe I misremembered 🙂 |
4944d96
to
3701a2f
Compare
Added preview label (seems they can actually access content) |
3701a2f
to
d1b16b9
Compare
This is now updated to use a separate property from Town Effect, which avoids the main issue of behaviour change with existing NewGRFs. |
I posted this on Discord, but for the record: I like this proposal a lot. We already allow houses to have custom production using a callback, but in practice this is rarely used to its full potential. This is because industry GRFs are typically the ones which define cargos and cargo chains, and do not include houses. Most industry GRF authors do not have their own house set, and vice versa, so there is little coordination between sets. This PR gives industry GRFs a sensible tool to make towns produce cargos, without any footguns that I see and certainly with less issues than trying to do both. I did both in Improved Town Industries 1 and required players to use both it and ITL Houses, and it was such a nightmare that I overwrite ITI 1 with ITI 2, which does the mail ID slot kludge. (ITI 1 was recently resurrected as ITI Classic, which bundles both industries and houses into one GRF file, to appease players who asked for it). ITI 2 will need an update if this PR is merged, but I've already prepared a PR so as long as we update NML before this patch is released, it's no problem. 🙂 |
d1b16b9
to
3e2340e
Compare
16d3c21
to
e464ab5
Compare
e464ab5
to
a3ab8d9
Compare
a3ab8d9
to
82d37f8
Compare
Updated to remove NewGRF properties added on the sly. That can come as a separate Feature. |
82d37f8
to
34a4826
Compare
34a4826
to
7ff0b5b
Compare
7ff0b5b
to
44f766b
Compare
44f766b
to
9d555f6
Compare
Needed to update as #11719 (which depends on this) conflicts with master :) |
9d555f6
to
41aba03
Compare
This makes it clearer that TownEffect only affects acceptance behaviour.
This replaces the fixed handling of passengers and mail.
…ERS or TPE_MAIL cargo.
41aba03
to
7314927
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no argument against this, and I know you will fix problems that may come from this. So let's go!
It's already in the milestone, but I'd just like to note that #11947 is also required in order to not break Improved Town Industries. (I'll need to add the flags, but that's easy.) Totally biased, because it's my GRF, but if we break it I'll get all the bug reports. 😛 |
Well, I have some excellent news for you! You can review that PR yourself! Isn't it absolutely amazing? :D |
Motivation / Problem
Towns are hardcoded to produce CT_PASSENGERS and CT_MAIL. If those cargo types are not available, weird things happen.
Description
This change adds a Town Production Effect property that tells a town to produce a cargo as if it were passengers or mail. No adjustment is made in case of multiple candidate cargos, you will just get higher production.
This is distinct from Town Acceptance Effect (nee Town Effect) which controls what happens to cargo received by a town. This separating is necessary to not break existing NewGRFs, and to allow flexibility.
This is also applied for generating passenger subsidies, although instead of creating more subsidies, that simply picks one at random.
This means the game no longer particularly cares about CT_PASSENGERS or CT_MAIL and goes with the town production effect.
Limitations
The NewGRF variables for town production still deal only with CT_PASSENGERS/CT_MAIL, apparently these are meant to be avoided anyway.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.