64 cargo types, more inputs and outputs on industries

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

User avatar
jfs
Tycoon
Tycoon
Posts: 1757
Joined: 08 Jan 2003 23:09
Location: Denmark

64 cargo types, more inputs and outputs on industries

Post 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 7325 times
User avatar
SilverSurferZzZ
Route Supervisor
Route Supervisor
Posts: 468
Joined: 29 Oct 2013 23:31

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

Post 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.
NewGRFs__
City names/Landscape: Naruto | Planets | Lovers | Halloween | Kaijus
Vehicles: Famous Cars | Super Cars | Racing Cars | Cars Cars | Improved M Cars

SilverSurferZzZ has left the building!
PeteB
Engineer
Engineer
Posts: 83
Joined: 23 Dec 2004 14:40
Location: Chester, U.K

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

Post by PeteB »

Oh my word, I had given up hope of this ever happening!

Pete
User avatar
GarryG
Tycoon
Tycoon
Posts: 5869
Joined: 14 Feb 2015 00:44
Location: Newcastle, Australia

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

Post 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
Soot Happens
Screenshot Of The Month Winner March 2020
All my projects are GPLv2 License unless stated.
Auz Road Sets: viewtopic.php?f=29&t=87335
Auz Project Releases: viewtopic.php?f=67&t=84725
Auz Trains: http://www.tt-forums.net/viewtopic.php?f=26&t=74193
Auz Industry Sets: http://www.tt-forums.net/viewtopic.php?f=26&t=74471
Auz Objects: viewtopic.php?f=26&t=75657
Auz Bridges: viewtopic.php?f=26&t=75248
Auz Stations: viewtopic.php?f=26&t=76390
Auz Tracks: viewtopic.php?f=26&t=82691
Auz Subway Stations: viewtopic.php?f=26&t=85335
Auz Eyecandy TramTracks: viewtopic.php?t=89908
User avatar
Captain Rand
Traffic Manager
Traffic Manager
Posts: 192
Joined: 28 Jan 2012 07:35

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

Post 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.
There's nothing like a deadline to hone the concentration.

Good manners cost nothing, but earn respect.

" 'Impossible' is not in our vocabulary." Jack Chrichton, Farscape
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

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

Post 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
User avatar
GarryG
Tycoon
Tycoon
Posts: 5869
Joined: 14 Feb 2015 00:44
Location: Newcastle, Australia

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

Post 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
Soot Happens
Screenshot Of The Month Winner March 2020
All my projects are GPLv2 License unless stated.
Auz Road Sets: viewtopic.php?f=29&t=87335
Auz Project Releases: viewtopic.php?f=67&t=84725
Auz Trains: http://www.tt-forums.net/viewtopic.php?f=26&t=74193
Auz Industry Sets: http://www.tt-forums.net/viewtopic.php?f=26&t=74471
Auz Objects: viewtopic.php?f=26&t=75657
Auz Bridges: viewtopic.php?f=26&t=75248
Auz Stations: viewtopic.php?f=26&t=76390
Auz Tracks: viewtopic.php?f=26&t=82691
Auz Subway Stations: viewtopic.php?f=26&t=85335
Auz Eyecandy TramTracks: viewtopic.php?t=89908
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

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

Post 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.
User avatar
Expresso
Tycoon
Tycoon
Posts: 1760
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

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

Post 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:
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

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

Post 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 ... ^^
J0anJosep
Traffic Manager
Traffic Manager
Posts: 139
Joined: 06 Aug 2011 15:51
Location: Spain

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

Post 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:
Formerly known as Juanjo
User avatar
Emperor Jake
Tycoon
Tycoon
Posts: 3427
Joined: 24 Apr 2007 09:37
Skype: Discord: Emperor Jake #4106
Location: Not Actually Japan
Contact:

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

Post 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.
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

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

Post 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
Image
User avatar
acs121
Tycoon
Tycoon
Posts: 1957
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

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

Post 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.
User avatar
jfs
Tycoon
Tycoon
Posts: 1757
Joined: 08 Jan 2003 23:09
Location: Denmark

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

Post 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.
Attachments
OpenTTD-indcargonum-20180730-Win32.zip
32 bit indcargonum build for Windows
(4.99 MiB) Downloaded 121 times
OpenTTD-indcargonum-20180730-Win64.zip
64 bit indcargonum build for Windows
(5.59 MiB) Downloaded 132 times
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

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

Post 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
Image
User avatar
Expresso
Tycoon
Tycoon
Posts: 1760
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

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

Post by Expresso »

Does having 128 industry types mean 128 cargo types?
User avatar
jfs
Tycoon
Tycoon
Posts: 1757
Joined: 08 Jan 2003 23:09
Location: Denmark

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

Post 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.
User avatar
SilverSurferZzZ
Route Supervisor
Route Supervisor
Posts: 468
Joined: 29 Oct 2013 23:31

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

Post 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.
NewGRFs__
City names/Landscape: Naruto | Planets | Lovers | Halloween | Kaijus
Vehicles: Famous Cars | Super Cars | Racing Cars | Cars Cars | Improved M Cars

SilverSurferZzZ has left the building!
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 6 guests