New Cargo Transportation Scheme [CTS] – Discussion ...
Posted: 02 Dec 2007 22:40
The discussion started here shall continue in this topic ... first a reply to a comment in the other topic ...
Ore Hopper : primary cargo iron ore, include cargo class 0010h, exclude all other classes FFFEh.
This will now give me a huge list of cargoes refittable to; now I go and exclude, coal, wheat, cereal, cement, oil seeds, potash, sulphur and gravel (or all cargoes defined as bulk only and not desirable), wasting a lot of bits in the bit mask. This should leave me with iron ore and copper ore. as well as sand, lime stone and gravel plus maybe a few other eligible ones.
Now someone goes and removes the refrigerated flag from fruit, and I end up with fruit in my ore car; who is going to eat that afterwards. Or, someone believes oil seeds should be changed from bulk to something else; I will end up with oil seeds in my ore hopper. This situation is not acceptable, I would have to change my set far too often.
I've already used up 28 of the 32 bits in the bit mask, I have very little room to move and I will definitely not release a set, that makes unsuitable cargoes available (refittable) for some of the freight wagons.
Now to the Cargo Transportation Scheme (CTS) ...
We need a reliable interface between industry/cargo sets and vehicle sets; the Extended Cargo Scheme [ECS] has failed; actually it has never worked in the first place. It is inadequate and needs to be replaced. Once a new scheme has been adopted, every vehicle set developer, that wants to provide transportation for cargoes beyond the 'original' TTD cargoes must use it; so do the industry/cargo set developers.
The cargo set developers have the easy job by simply defining cargo class (cargo property 16) correctly. BTW, all reference to properties and variables refer to the train ones.
The interface is simply the cargo class. These cargo classes must be redefined; once agreed they will be set in concrete. This scheme aims to avoid cargoes, like crude oil, milk, petrol or water, having the same cargo class. Here is a suggestion of the 16 possible, new or redefined, cargo classes :
1] (0001h) passengers (must be retained, as various functions within TTDPatch/OpenTTD rely on it)
2] (0002h) mail (same as above)
[The following classes will always exclude the 2 above.]
The next 3 classes define the cargo as in 'Is it Animal, Vegetable or Mineral' ? Each cargo will have one and only one of these defined :
3] Animal, for a cargo, like livestock.
4] Vegetable, all cargoes that are edible, but are not still an animal alive.
5] Mineral, all cargoes, that would be hard to swallow, like coal, ore or timber.
Then we come to the origin of the cargo; there are 2 classes, each cargo will have maximum one of these defined :
6] Raw material, everything that has been dug up or chopped down, e.g. coal, ore, timber
7] Processed, for cargoes that have been processed, e.g. livestock -> meat, iron ore -> steel, pulp -> paper.
The next 4 classes define its transportability; again each cargo will have one and only one of these defined :
8] Bulk, everything that would be transportable in an open wagon (a sided wagon not a flat bed), or on the back of a truck and could be exposed to nature, like rain.
9] Packaged, now packaged does not necessarily mean, a bag or a box, it also means protected from the environment; i.e. it needs to be undercover, like grain, wheat; or consists of fine particle nature, like cement or potash. a packaged cargo goes in box cars, covered hoppers or containers.
10] Liquid, all cargoes, that traditionally are transported in tankers. If it is not a tanker cargo, it most probably would be defined as packaged.
11] Piece Cargo, everything of bulky nature, that is happy to be transported in the open, like timber, machinery or motor vehicles.
Next come the finer and optional definitions :
12] Refrigerated, a perishable cargo that requires refrigeration, like fish or milk.
13] Express, a cargo that should be transported as quickly as possible, like tourists, although tourists could simply be defined passengers only. Maybe this one could be depreciated.
14] Armoured, the armour class might even be scrapped too. We'll leave it in for the moment, but if we do need another class it might have to go.
15] Special, simply a flag that this cargo is of special nature; like Pikka's gear boxes.
16] [spare one]
Note: the numbering at this stage does not represent the bit setting.
Now in the wiki, there is the 'hazardous' class defined. I would use the special class for that one. The vehicle set developer most probably will use the cargo label to provide transport in special purpose wagons; otherwise it is just another ore like cargo.
Example :
a) Uranium Ore could be defined as 'Mineral', 'Raw Material', 'Packaged' as it shouldn't be transported in open wagons.
b) Uranium itself would be defined as 'Mineral', 'Processed', 'Packaged'.
c) Depleted Uranium, the same as Uranium.
Having these classes and sub classes would allow industry/cargo set developers to more precisely define their cargoes and vehicle set developers would be able to choose what goes into a particular vehicle with more accuracy. A special purpose wagon would use the cargo label (bit in bit mask) only; e.g. coal wagon would define COAL in prop 16, 0000h/FFFFh for 28/29 respectively. The ore hopper would then allow 'Mineral' + 'Raw Material' + 'Bulk' class, automatically excluding edible stuff. The only thing would be to exclude coal.
The cargo class is the only link between vehicle sets and cargo sets. Whether a vehicle set uses only a few freight wagons, as is the case with the 'original' TTD freight wagons or uses a large number of freight wagons (by vehicle ID) this scheme should provide more compatibility between the various sets.
There will be a few problems, like vehicle variable 42 (tt of) cargo classes transported, bits other than passengers/mail would be inaccurate. But there is of course variable 47.
Now for home work : think whether a particular cargo needs an even finer definition. We have at least one more slot available. Next, I'll put together a Cargo Table for all cargoes defined in the wiki, and define a cargo class according to the above.
That is precisely what I do; an example :DaleStan wrote: ... Try not setting more than one of "piece", "bulk", and "liquid" for any given cargo. ...
Ore Hopper : primary cargo iron ore, include cargo class 0010h, exclude all other classes FFFEh.
This will now give me a huge list of cargoes refittable to; now I go and exclude, coal, wheat, cereal, cement, oil seeds, potash, sulphur and gravel (or all cargoes defined as bulk only and not desirable), wasting a lot of bits in the bit mask. This should leave me with iron ore and copper ore. as well as sand, lime stone and gravel plus maybe a few other eligible ones.
Now someone goes and removes the refrigerated flag from fruit, and I end up with fruit in my ore car; who is going to eat that afterwards. Or, someone believes oil seeds should be changed from bulk to something else; I will end up with oil seeds in my ore hopper. This situation is not acceptable, I would have to change my set far too often.
I've already used up 28 of the 32 bits in the bit mask, I have very little room to move and I will definitely not release a set, that makes unsuitable cargoes available (refittable) for some of the freight wagons.
Now to the Cargo Transportation Scheme (CTS) ...
We need a reliable interface between industry/cargo sets and vehicle sets; the Extended Cargo Scheme [ECS] has failed; actually it has never worked in the first place. It is inadequate and needs to be replaced. Once a new scheme has been adopted, every vehicle set developer, that wants to provide transportation for cargoes beyond the 'original' TTD cargoes must use it; so do the industry/cargo set developers.
The cargo set developers have the easy job by simply defining cargo class (cargo property 16) correctly. BTW, all reference to properties and variables refer to the train ones.
The interface is simply the cargo class. These cargo classes must be redefined; once agreed they will be set in concrete. This scheme aims to avoid cargoes, like crude oil, milk, petrol or water, having the same cargo class. Here is a suggestion of the 16 possible, new or redefined, cargo classes :
1] (0001h) passengers (must be retained, as various functions within TTDPatch/OpenTTD rely on it)
2] (0002h) mail (same as above)
[The following classes will always exclude the 2 above.]
The next 3 classes define the cargo as in 'Is it Animal, Vegetable or Mineral' ? Each cargo will have one and only one of these defined :
3] Animal, for a cargo, like livestock.
4] Vegetable, all cargoes that are edible, but are not still an animal alive.
5] Mineral, all cargoes, that would be hard to swallow, like coal, ore or timber.
Then we come to the origin of the cargo; there are 2 classes, each cargo will have maximum one of these defined :
6] Raw material, everything that has been dug up or chopped down, e.g. coal, ore, timber
7] Processed, for cargoes that have been processed, e.g. livestock -> meat, iron ore -> steel, pulp -> paper.
The next 4 classes define its transportability; again each cargo will have one and only one of these defined :
8] Bulk, everything that would be transportable in an open wagon (a sided wagon not a flat bed), or on the back of a truck and could be exposed to nature, like rain.
9] Packaged, now packaged does not necessarily mean, a bag or a box, it also means protected from the environment; i.e. it needs to be undercover, like grain, wheat; or consists of fine particle nature, like cement or potash. a packaged cargo goes in box cars, covered hoppers or containers.
10] Liquid, all cargoes, that traditionally are transported in tankers. If it is not a tanker cargo, it most probably would be defined as packaged.
11] Piece Cargo, everything of bulky nature, that is happy to be transported in the open, like timber, machinery or motor vehicles.
Next come the finer and optional definitions :
12] Refrigerated, a perishable cargo that requires refrigeration, like fish or milk.
13] Express, a cargo that should be transported as quickly as possible, like tourists, although tourists could simply be defined passengers only. Maybe this one could be depreciated.
14] Armoured, the armour class might even be scrapped too. We'll leave it in for the moment, but if we do need another class it might have to go.
15] Special, simply a flag that this cargo is of special nature; like Pikka's gear boxes.
16] [spare one]
Note: the numbering at this stage does not represent the bit setting.
Now in the wiki, there is the 'hazardous' class defined. I would use the special class for that one. The vehicle set developer most probably will use the cargo label to provide transport in special purpose wagons; otherwise it is just another ore like cargo.
Example :
a) Uranium Ore could be defined as 'Mineral', 'Raw Material', 'Packaged' as it shouldn't be transported in open wagons.
b) Uranium itself would be defined as 'Mineral', 'Processed', 'Packaged'.
c) Depleted Uranium, the same as Uranium.
Having these classes and sub classes would allow industry/cargo set developers to more precisely define their cargoes and vehicle set developers would be able to choose what goes into a particular vehicle with more accuracy. A special purpose wagon would use the cargo label (bit in bit mask) only; e.g. coal wagon would define COAL in prop 16, 0000h/FFFFh for 28/29 respectively. The ore hopper would then allow 'Mineral' + 'Raw Material' + 'Bulk' class, automatically excluding edible stuff. The only thing would be to exclude coal.
The cargo class is the only link between vehicle sets and cargo sets. Whether a vehicle set uses only a few freight wagons, as is the case with the 'original' TTD freight wagons or uses a large number of freight wagons (by vehicle ID) this scheme should provide more compatibility between the various sets.
There will be a few problems, like vehicle variable 42 (tt of) cargo classes transported, bits other than passengers/mail would be inaccurate. But there is of course variable 47.
Now for home work : think whether a particular cargo needs an even finer definition. We have at least one more slot available. Next, I'll put together a Cargo Table for all cargoes defined in the wiki, and define a cargo class according to the above.