Page 1 of 3

64 cargo types, more inputs and outputs on industries

Posted: 01 Aug 2018 15:37
by jfs
Recently there's been work in the master branch of OTTD that increases the number of cargo types to 64. After some discussions on IRC we figured those additional cargo types would be much more exciting if industries could also consume and produce more cargo types each, instead of the historical limit of 3-in-2-out.

I started working on a patch that increases the number of slots on industries to 16 cargo types in and 16 out, here's the pull request on GitHub. There's also an analogous for town houses since you'd want to extend those as well.
Although most of the work happens on GitHub (and IRC), I'm making a thread here as well, since some interest was shown in the FIRS thread.

Descriptions of the proposed additions to NewGRF support are in the initial posts in each of the two pull requests.

Current status (August 1st) is that both features await more testing. I have made my own little NewGRF for testing, but it doesn't exercise any of the callback features.
Additionally, NML needs to be updated to understand the new features as well, so right now you can only use them by writing oldschool NFO files :)

There are some "obvious" callbacks for dynamically controlling per-tile acceptance that are not included in the patches. Constantly performing callbacks for this is quite expensive, and from a performance perspective, please don't depend on that. If you have a really really good use case, present it and maybe they'll come back!
complex-industries.png
complex-industries.png (152.91 KiB) Viewed 7424 times

Re: 64 cargo types, more inputs and outputs on industries

Posted: 01 Aug 2018 21:47
by SilverSurferZzZ
The 64 cargo types, fabulous.

However, the 16 cargoes per industry...
In my opinion, it's unnecessary. It's going to be too complex for everyone and let's not forget the most important thing... Many users don't know how to use OTTD, if you put 16 cargoes on them, you directly kill them.

Maybe 8, more is really complex. In reality, for most users with 5-6 as maximum is enought.


One last thing....
Thanks for all your effort, yours and the rest of developers, without all that immense work in the shadows, OTTD would never have become the big program that is today.

Re: 64 cargo types, more inputs and outputs on industries

Posted: 01 Aug 2018 21:56
by PeteB
Oh my word, I had given up hope of this ever happening!

Pete

Re: 64 cargo types, more inputs and outputs on industries

Posted: 01 Aug 2018 22:15
by GarryG
Good to hear that 64 cargos will be implemented. Will give a greater choice and allow longer cargo chains.

For instance: Could have grain going to the flour mill to create flour (instead of food), the flour can than go to a bakery to produce foods.

Having 16 cargos will work good with Industries such as the Port and Bulk Terminals.

Will allow for Industries that will accept and produce large variety of cargos such as shopping centres, freight terminals, distribution centres, markets to name a few.

The cargo IDs are 0 to 31 at present so I presume they will extend to 63?

Cheers

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 00:11
by Captain Rand
GarryG wrote:
For instance: Could have grain going to the flour mill to create flour (instead of food), the flour can than go to a bakery to produce foods.
I was thinking exactly the same thing!

Pete.

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 11:13
by Gwyd
SilverSurferZzZ wrote:However, the 16 cargoes per industry...
In my opinion, it's unnecessary. It's going to be too complex for everyone
Just because it's there, it doesn't mean we have to use it all the time: I doubt OpenGFX will be updated to use all 16 in and out for every industry, so people who find this difficult don't need to play with it

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 12:02
by GarryG
I doubt I would use all 16 cargos in one Industry .. but like the idea some Industries can accept more than 3 and produce more than 2 things.

Farms for instance.

A sheep farm be good to produce Sheep, Wool, Wheat and Cereal Crops.

A Dairy farm can produce Milk, Cattle and Vegetables and maybe cereal crops to like corn.

If people put their thinking caps on could think of Industries that could receive more than 3 cargos and produce more than 2.

Cheers

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 12:23
by Pyoro
People play people like Factorio and go "this is too simple, I want a more complex mod ..."
OpenTTD with how it's usually played isn't all that complex; 16 cargos for one industry would just be messy to handle, but I doubt it'd make the game actually difficult ;)

Anyway, it's nice to have options. Thanks for the work, jfs.

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 13:24
by Expresso
One particularly interesting application of this would be to make some town houses work like industries and produce and accept various kinds of goods.

An animal shelter producing lifestock and accepting grain, for example. :twisted:

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 13:36
by Pyoro
Expresso wrote:One particularly interesting application of this would be to make some town houses work like industries and produce and accept various kinds of goods.

An animal shelter producing lifestock and accepting grain, for example. :twisted:
That'd be a rail pain as only the nearest industry gets cargo, no? So if you want to cover the entire city you'd need hundreds of road stations ... ^^

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 13:53
by J0anJosep
64 cargo types is ok, because increasing the limit of 32 cargo types allows for more variety in cargos and industries.

Anyway, I have doubts that allowing more than 4 (input or output) cargo types makes a game more interesting without making things too complex.
Pyoro wrote:Expresso wrote:
One particularly interesting application of this would be to make some town houses work like industries and produce and accept various kinds of goods.

An animal shelter producing lifestock and accepting grain, for example. :twisted:

That'd be a rail pain as only the nearest industry gets cargo, no? So if you want to cover the entire city you'd need hundreds of road stations ... ^^
And cargo distribution overflowing with soooo many destinations... :shock:

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 14:17
by Emperor Jake
Pyoro wrote:People play people like Factorio and go "this is too simple, I want a more complex mod ..."
OpenTTD with how it's usually played isn't all that complex; 16 cargos for one industry would just be messy to handle, but I doubt it'd make the game actually difficult ;)

Anyway, it's nice to have options. Thanks for the work, jfs.
Just what I was thinking, this could lead to the AngelBob's equivalent for OpenTTD :twisted:

This has so much potential, I might draw up a FIRS-derived industry chain that makes use of these new features.

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 15:37
by michael blunck
Captain Rand wrote:
GarryG wrote: Good to hear that 64 cargos will be implemented. [...]
For instance: Could have grain going to the flour mill to create flour (instead of food), the flour can than go to a bakery to produce foods.
I was thinking exactly the same thing!
And why should something like that need 64 cargo types? I´d be surprised if that wouldn´t be already possible now.

regards
Michael

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 15:40
by acs121
michael blunck wrote:
Captain Rand wrote:
GarryG wrote: Good to hear that 64 cargos will be implemented. [...]
For instance: Could have grain going to the flour mill to create flour (instead of food), the flour can than go to a bakery to produce foods.
I was thinking exactly the same thing!
And why should something like that need 64 cargo types? I´d be surprised if that wouldn´t be already possible now.

regards
Michael
This, because there are other industries to implement alongside.

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 16:16
by jfs
I agree that having 16 cargoes in and 16 out of an industry will be a mess and difficult to play with. The GUI for it will also be really bad, without changes. (What an updated GUI should look like, I don't know.) I doubt there will be any NewGRFs using more than maybe 6 cargoes in/out, but IMO it's better to have a limit you don't scrape against for normal use cases.

I'm attaching my current builds if anyone wants to test it out. I've also included my test GRF that was used to create the screenshot in first post.
Note that this is only the industry changes, not the changes to let town houses also accept 16 cargoes.

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 16:18
by michael blunck
acs121 wrote:
mb wrote:
GarryG wrote: [...] Could have grain going to the flour mill to create flour (instead of food), the flour can than go to a bakery to produce foods.
And why should something like that need 64 cargo types? [...]
This, because there are other industries to implement alongside.
IIRC, OTTD already allows for 128 industry types per newGRF, and 240 in total.

regards
Michael

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 19:17
by Expresso
Does having 128 industry types mean 128 cargo types?

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 19:42
by jfs
Expresso wrote:Does having 128 industry types mean 128 cargo types?
Nah. Going past 64 cargo types is going to be annoying, since they need to be represented in a bitfield, and there's some technical hurdles in extending to fields larger than 64 bit.
With 64 cargo types, I think there is exactly one industry configuration where no industry type shares a produced or accepted cargo with any other: 64 industries produce exactly one cargo type and accept none, and the other 64 industries accept exactly one cargo type and produce none. Anything else and you need to have multiple industries producing and/or accepting each cargo.

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 20:12
by ISA
I just pop in and want to say to devs what cool job are You doing here :)

Re: 64 cargo types, more inputs and outputs on industries

Posted: 02 Aug 2018 21:24
by SilverSurferZzZ
Juanjo wrote:Anyway, I have doubts that allowing more than 4 (input or output) cargo types makes a game more interesting without making things too complex.
Just what I said.

And so, 16 cargoes for developers is fine; And from that point on, use common sense and not do things too complex.

OTTD is a program for everyone, let's make things right and unhurried.