Cargo & Industry fixes for 1.06

A private forum for those folks working on patches for RRT3.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Cargo & Industry fixes for 1.06 Unread post

RulerofRails wrote:Just realized that the 1.06 Electronics cargo has a start year of 1900, but the Electronics Plant has a start year of 1910. This was likely an over-sight, but there is an advantage: the demand for Electronics is already strong by the time that the Electronics Plant is seeded/buildable by the player.

This leads to a question: what if any production chain producing a new cargo was set to start 3 years after the cargo start date?
It's perfectly rational, but TBH I don't see it making any difference to game play. Players simply won't (or shouldn't) build an industry until it is going to turn a profit. It will only affect random seeding, and I've never noticed that to be a problem.
User avatar
RulerofRails
CEO
Posts: 2061
Joined: Sun Dec 08, 2013 1:26 am

Re: Cargo & Industry fixes for 1.06 Unread post

More thoughts on this. For Cheese, Toys, Furniture, and probably Electronics this idea does make some sense. Although it may remove a pitfall for the casual player, there is less skill needed by advanced players. Would seem to be more realistic.

However, the idea breaks when one considers new resources. In order to have any demand for Rubber on the map, there must be a Tire Factory. If the map has the Weapons Factory enabled, then you might have a demand for Tires in certain places, but most of the time you want to use Tires in the Auto Factory. Bauxite and Uranium also will not have any demand if their are no factories that demand them. So those industries would have to activate at the same time as the cargo start date. BROKEN! *!*!*!

Most advanced players will short-circuit the regular "building demand" period (couple of years as seen in the pre-game simulation) by placing industries where resources are produced, and with 1.06 this can also be partially short-circuited by shipping-at-a-loss to the new location. So sounds like this is attempting to patch an issue that most players are already playing around.

I think the nail in the coffin for this idea is that if a recipe for a yet-to-be-discovered cargo is present in the ports, production will activate at the cargo start date. This is actually the main place that cargoes can be spewed onto the map in a deep red zone.

Now, this idea could be used in some sort of mod, but for a larger picture patch it's out. Sorry to waste your time with it. !facepalm!
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Cargo & Industry fixes for 1.06 Unread post

I had a thought about the borked 1.06 stuff, particularly the furnace. I'm not going to bother with a hundred and fifty page thread wherein everyone argues for their own ideas that haven't been tested. Next time I feel like it, I will simply split the furnace into two likely suspects, edit the map to suit, and play the result. See what happens. Make whatever other changes seem like the best option. Play again.

This means no arguments, and no problem with backwards compatibility. I, or anyone else, can make their own private "1.07" and try it out to see if it really is an improvement. I suggest this is, realistically, the only way we're ever likely to see usable results here. If someone comes up with a really good solution, other people can adopt it as they see fit. (0!!0)
User avatar
CeeBee
Brakeman
Posts: 107
Joined: Thu Dec 27, 2007 5:46 pm
Location: Chase BC Canada

Re: Cargo & Industry fixes for 1.06 Unread post

Out of the frying pan and into the furnace. Works for me !!jabber!! :mrgreen:
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: Cargo & Industry fixes for 1.06 Unread post

After tampering with the files (far too much tampering, honestly) for my 1804 mod, it's become pretty clear to me that the game's economy is a bit fragile.

In adding oil availability to the map starting in 1800, there was negligible impact. There's only the background noise demand of housing for it as things come out of the box. When I added a slight demand for oil to the factories (0.1 per year), there was just a microscopic change. Pretty much as I suspected because Oil (until electric plants and oil refineries appear) is a dead-end product.

Compared against what I saw demonstrated from adding fertilizer as a fractional output for Cattle Ranch, Dairy Farm, and Sheep Station. The effects were far-reaching and not beneficial. Within a very short time, perhaps 10 years on average, the accumulated effects led to massive over-production of both primary cargoes and processed cargoes. Even the Tycoonauts legendary thirst for alcohol was dwarfed by the availability of the product. I had massive pile-ups of Alcohol, Cheese, Clothing, Meat at hubs and the price map was so flat that there was literally no station on the map that had a price difference that made hauling them profitable.

When I tampered with the date on Weapons, I used Ports to create a demand for them. Which seemed a controlled experiment. Seemed. The truth was rather uncontrolled. Ports demanded weapons and logs, supplied oil (whale oil) and cotton (seal fur). It seemed reasonable enough. However by having the Ports demand both Logs and Weapons (which has logs in its production chain), I created a sort of China Syndrome in the basic economy of the map. I didn't fully recognize there was a problem until the price for Furniture was over $610 and had to review everything on the map to track down the root cause. To correct it, I removed the demand for Weapons from ports and ran the map again. Things ran in a familiar pattern after that change. I tried again with the demand for logs removed and the demand for weapons restored. Things were a bit choppy as Furniture Factories and Weapon Factories competed for lumber, but no where as bad as when both Logs and Weapons had been demanded.

When I changed the output for Corn Farms, Grain Farms, and Rice Farms to all be "Grain" and changed the transforms and demands in other buildings accordingly, the net result was similar, albeit nowhere as bad, as when I added fertilizer as an output to animal farms.

RoR and Gumboots both gave me a warning about mucking about in the game economy, which I promptly ignored. I learned my lesson. I now accept that even the smallest changes to the game economy require careful consideration.

I believe with some additional work, probably far more than I want to believe, any one of these "mad genius ideas" could be made to work. Mistakes teach us more than successes. So I will keep tampering and if I accidentally have a success, let us hope I have made enough mistakes to double, triple, and quadruple check my work. :mrgreen:

And now, this:
Early Tub Tanker for Oil
Early Tub Tanker for Oil
Rough idea, but getting there.

I was told by the chair of the Chesapeake & Ohio Railroad History Society that "milk was handled as express" and "carried in the baggage car in milk cans until some time after the First World War". He couldn't say with any certainty when the first milk tanker appeared on C&O rails, but he guessed it was in the mid 1930s. he did have some photos of ice-cooled box cars that were exclusively for milk from about 1900 (+/- 5 years). He also told me that there had not been a milk run on any part of the CSX network (that covers about 1/3 of the USA) in his lifetime. As best he could recall, the last milk run on the C&O was in 1956.

As far as he ever knew, until World War 2, only petroleum and petroleum distillates and hazardous/flammable liquids were carried in steel tankers as seen in RT3. He had a photo of a special rail car for Nitroglycerine, but none of milk tankers. But he allowed that Orange Juice and the similar might have been carried in steel tanks on other lines, but he'd never even seen a photo of such a tanker.

This corroborates what I read on Wikipedia (Milk Car link).

So, I figure that from 1800-1900, oil is the only in-game liquid cargo that might legitimately use a "tanker". Milk could legitimately use a (special refrigerated) tanker from 1900 until 1950, but after that milk tankers should go the way of the dodo and dinosaur, because (at least in the USA) they ceased to appear on rails in the 1950-1960 period.

I guess I have a new project... another one... again... *!*!*!
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Cargo & Industry fixes for 1.06 Unread post

Just Crazy Jim wrote:Compared against what I saw demonstrated from adding fertilizer as a fractional output for Cattle Ranch, Dairy Farm, and Sheep Station. The effects were far-reaching and not beneficial. Within a very short time, perhaps 10 years on average, the accumulated effects led to massive over-production of both primary cargoes and processed cargoes.
I can think of various options here, if you want to try them. For a start, most scenarios only run 25 years. If you find a solution that's stable over thirty years, that would be good enough for most people most of the time.

The next obvious thing is changing the fractional outputs to be lower, but I don't know how low you had them. Maybe they we minimal already. If that is the case, then the next thing to try is only have fertiliser coming out of some animal farms, instead of all. For game purposes that would be perfectly acceptable, IMO.

When I tampered with the date on Weapons, I used Ports to create a demand for them. Which seemed a controlled experiment. Seemed. The truth was rather uncontrolled. Ports demanded weapons and logs, supplied oil (whale oil) and cotton (seal fur). It seemed reasonable enough. However by having the Ports demand both Logs and Weapons (which has logs in its production chain), I created a sort of China Syndrome in the basic economy of the map. I didn't fully recognize there was a problem until the price for Furniture was over $610 and had to review everything on the map to track down the root cause. To correct it, I removed the demand for Weapons from ports and ran the map again. Things ran in a familiar pattern after that change. I tried again with the demand for logs removed and the demand for weapons restored. Things were a bit choppy as Furniture Factories and Weapon Factories competed for lumber, but no where as bad as when both Logs and Weapons had been demanded.
Options here: Set the ports to demand lumber instead of logs. I know that in reality shipyards often had their own mills on site, but this isn't reality so we have to work with what we have. To represent harpoons and general ironwork for ships, you could use Goods. That's made from iron in the relevant period. If the map as a whole still has too much competition for lumber, either tweak the logging camps for increased output or turn up the editor sliders for their seeding in some territories.

What you'll find with RT3 is that if you want something specific in a scenario, you'll have to design the whole map economy to suit and then check it for balance and playability with a range of seedings.

And now, this:
TankA.jpg
Rough idea, but getting there.

I was told by the chair of the Chesapeake & Ohio Railroad History Society that "milk was handled as express" and "carried in the baggage car in milk cans until some time after the First World War". He couldn't say with any certainty when the first milk tanker appeared on C&O rails, but he guessed it was in the mid 1930s. he did have some photos of ice-cooled box cars that were exclusively for milk from about 1900 (+/- 5 years). He also told me that there had not been a milk run on any part of the CSX network (that covers about 1/3 of the USA) in his lifetime. As best he could recall, the last milk run on the C&O was in 1956.

As far as he ever knew, until World War 2, only petroleum and petroleum distillates and hazardous/flammable liquids were carried in steel tankers as seen in RT3. He had a photo of a special rail car for Nitroglycerine, but none of milk tankers. But he allowed that Orange Juice and the similar might have been carried in steel tanks on other lines, but he'd never even seen a photo of such a tanker.

This corroborates what I read on Wikipedia (Milk Car link).

So, I figure that from 1800-1900, oil is the only in-game liquid cargo that might legitimately use a "tanker". Milk could legitimately use a (special refrigerated) tanker from 1900 until 1950, but after that milk tankers should go the way of the dodo and dinosaur, because (at least in the USA) they ceased to appear on rails in the 1950-1960 period.

I guess I have a new project... another one... again... *!*!*!
The early tanker looks fine. I'd use a 16 sided tub for the first LOD, dropping back to four sided on the third LOD. Shouldn't need more than 3 for such a simple car.

And yes, your friend is right. I already knew this. That's why in my revamped cargo scale milk is going to be carried in reefers, and why they are one of the lightest freight cars. ;-) It might have been carried just in the baggage car on some lines, but in the US milk was often carried in special reefers that were fitted with trucks suitable for high speed. This car often carried the standard passenger car livery, and was usually at the head of the train just behind the tender. This was a good place for it as it kept the passengers a bit further from the general mess of a steam engine (not good for white shirts, etc).

The UK was different in that they used small four wheel tankers, but these were still treated as express. And of course some US companies (Borden's is a good example) used tankers from the '30's onwards. At the moment I'm just going to put milk in general reefers along with alcohol, cheese, meat and produce (and medicine for 1.06) but I do intend to skin up specific milk cars later.

Since a cargo has to stay in the game once production is commenced, it's not possible to have an end date on rail shipment of milk. Again, this is RT3, not real life. You could use an event to cut milk production 100% after a certain date but that would mean all dairy farms going out of business, along with dairy processors, and a consequent complete lack of milk and cheese anywhere on your map.
User avatar
RulerofRails
CEO
Posts: 2061
Joined: Sun Dec 08, 2013 1:26 am

Re: Cargo & Industry fixes for 1.06 Unread post

A glut of cargo produced at the crop farms once new fertilizer sources are added doesn't surprise me. I hinted (probably too subtlely) at it here, but I think you need to add a new lower ratio Fertilizer->Grain/Cotton/etc. conversion to cover the "natural" Fertilizer period that is only active during that timeframe.

As far as I can tell, PopTop kept the default conversions high enough so that the Fertilizer conversion is profitable in the majority of situations (even quite sub-optimal). This was the problem I faced with the proposed Machinery->Iron/Coal/etc. conversions to simulate a boost in mine production when supplied with Machinery. I ended up adding an additional "sink" demand only function that would take say 0.5 loads of Machinery per year, so I could have a fair amount of Machinery consumed, and still maintain decent profitability in most conditions. Well, that was the idea. I never tested it thoroughly enough to be happy with the settings though, and for sure this idea also has an impact on the economy. In the end, more resources will be produced, which can be converted to more end-products which may also cause a glut on the map. So wouldn't necessarily be a good idea for existing maps.
User avatar
Cash on Wheels
Conductor
Posts: 248
Joined: Wed Jun 22, 2016 12:15 pm
Location: Florida

Re: Cargo & Industry fixes for 1.06 Unread post

Ive learned don't bother changing the production levels of factories. I bet they had a Huge beta test to sort all of that out. ;-)
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Cargo & Industry fixes for 1.06 Unread post

Hey does anyone have a list of all 1.06 industry demands and supplies? Not just a qualitative flow chart (already have that) but a complete quantitative breakdown.

Edit: Nevermind. I decided to make a spreadsheet for myself. Mostly sorted now. !*th_up*!
I must say it's a bit of an eye-opener. I hadn't realised all the implications of the 1.06 industry chains. The prices and outputs often don't seem to make a lot of sense.

For example, the Electronics Plant has a base output of 4 loads/year, but it costs $2,800k to build. For comparison, the default PopTop Steel Mill costs $2,700k but will produce 10 loads of Steel per year. The Machine Shop produces 6 loads/year and only costs $1,900k, and the demand for Machinery is much higher than the demand for Electronics. Looked at this way, it's no wonder the Electronics Plant is something people hardly ever bother with. It makes much more sense to ignore it and invest in other industries.

The 1.06 Concrete Plant will put out 8 loads/year for a build cost of only $1,800k. The Furnace will produce 8 loads for only $1,200k build cost.

The Pharmaceutical Plant is well-known to be difficult or impossible to run, due to the lack of Chemicals on most maps and the low demand for Medicine. It's usually better to put any Chemicals into making Fertilizer, or possibly Weapons. If keeping the Pharma Plant, it would probably be sensible to halve the output and halve the build cost, just to have more usable unit.

Oh yes, and I had a thought about Crystals. Given that the only use for it is late era Electronics, it would have made sense to set up the Quarry BCA so it didn't produce Crystals until there was a factory to take them. *!*!*!
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Cargo & Industry fixes for 1.06 Unread post

I have a basic "get my head around this" spreadsheet set up.
Lists all 1.06 cargoes and industries, and gives all demands and supplies, with quantities where those are known.
AFAIK there are no known quantities for production and demand of express cargoes, since those are locked into the.exe.

Edit: Updated version in this post.
User avatar
RulerofRails
CEO
Posts: 2061
Joined: Sun Dec 08, 2013 1:26 am

Re: Cargo & Industry fixes for 1.06 Unread post

Nice. This is useful. !*th_up*!

How come we missed editing the Crystals production start date till now. *!*!*!

Actually I think that there isn't that much demand for Machinery. Sure there is a demand at a lot of buildings that take it, but the rate is super low. Machinery is hard to produce, so can only be a worthwhile endeavor if produced in bulk (if you focus on it). The rate is so low that little real consumption takes place, it doesn't rot fast either, so the typical thing is for a mass scale re-hauling around the map -- whether you intentionally take advantage of that or not.

This was where the idea came to add demand at Mines, Logging Camps etc.. And to get some production boost too. I had the concept for this worked out with Blackhawk. Akin to Fertilizer at farms, but a little more tricky thanks to these resources often running in lower demand environments (houses provide map wide background demand and therefore typically decent prices for farms) and Machinery is higher priced than Fertilizer. Our solution was to use two chains: one production and the other for the actual conversion. This lets real consumption take place + giving a boost effect. In super low price environments we could potentially see these resources take a little more loss (production/profit), but it seemed manageable to me.

A conceptual (it's in TM) use for Machinery was as a boost in a conversion industry. An example 3 Logs + 0.2 Machinery = 6 Lumber. However, there is a single value that caps all conversion entries (this is the problem with putting multiple conversions into a warehouse/port). Unless someone works out a super low resource map style that doesn't use much micro, my testing didn't show that this could be helpful on the typical map, and it's definitely not a boost. The "boost" possible (seen at the default farms) is achieved because it combines a Production and a Conversion entry.

On the topic of Machinery try this from a long time ago: http://hawkdawg.com/rrt/rrt3/hp/h-c.htm


PS.
Actually, I'm pretty sure that the express values in the bca files work. One evidence would be that Ned added express demands to a lot of buildings in TM. Production events work for express too (even by territory, proof in some of Oilcan's maps like Canyon Lands, or Zambu Email).
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Cargo & Industry fixes for 1.06 Unread post

RulerofRails wrote: Wed Dec 19, 2018 9:51 pmNice. This is useful. !*th_up*!
I'm thinking of adding some more to it, so we can see demands over time in a form that makes sense to the eye.
How come we missed editing the Crystals production start date till now. *!*!*!
Dunno. Maybe we're just a bit thick. :lol:
Actually I think that there isn't that much demand for Machinery. Sure there is a demand at a lot of buildings that take it, but the rate is super low. Machinery is hard to produce, so can only be a worthwhile endeavor if produced in bulk (if you focus on it). The rate is so low that little real consumption takes place, it doesn't rot fast either, so the typical thing is for a mass scale re-hauling around the map -- whether you intentionally take advantage of that or not.
Ok, but the rate of demand from each house is pretty low for a lot of cargoes, but the number of houses makes consumption pretty good. Goods is an example. Demanded at only 0.05 loads/year for small houses, and not demanded anywhere except houses, but it's usually a profitable cargo with a pretty stable price.

OTOH, Cheese is a cargo that can tend to crash easily. It's demanded at 0.02 loads/year for small houses, which are usually the most common ones IME. It also has a much faster rot time than Goods, which would tend to increase consumption and stabilise price, so the difference between a 0.02 demand and a 0.05 demand obviously has a dramatic effect on price stability. This sort of thing is worth thinking about when setting demands.
This was where the idea came to add demand at Mines, Logging Camps etc.. And to get some production boost too. I had the concept for this worked out with Blackhawk. Akin to Fertilizer at farms, but a little more tricky thanks to these resources often running in lower demand environments (houses provide map wide background demand and therefore typically decent prices for farms) and Machinery is higher priced than Fertilizer. Our solution was to use two chains: one production and the other for the actual conversion. This lets real consumption take place + giving a boost effect. In super low price environments we could potentially see these resources take a little more loss (production/profit), but it seemed manageable to me.
Yes, I can see that forcing higher priced cargoes into the production chain could adversely affect profits. Having some of them as demands only would allow more flexibility. And you'd want to be careful about which industries got a production boost, and by how much.
PS.
Actually, I'm pretty sure that the express values in the bca files work. One evidence would be that Ned added express demands to a lot of buildings in TM. Production events work for express too (even by territory, proof in some of Oilcan's maps like Canyon Lands, or Zambu Email).
Yes, I know production events work for express. My Latvia map has them. ;-) But the Barracks, for example, has no Troops mentioned in the .bca and the Hotel has no pax mentioned, so obviously some express production is locked into the .exe. This makes sense, because we know express prices are locked into the .exe too, and are not affected by events or by .bca edits.
User avatar
RulerofRails
CEO
Posts: 2061
Joined: Sun Dec 08, 2013 1:26 am

Re: Cargo & Industry fixes for 1.06 Unread post

Um. Passengers, mail, and troops supply/demand have special values in the footer of all buildings.

From Pjay's notes

Code: Select all

102 (-067)	:     4 : float	: passengers : (commercial 0.5, house 1, hotel museum 2, church cinema deptstore 3, stadium 5)
106 (-063)      :     4	: float	: passengers : (commercial 0.5, house 1, hotel museum 2, church cinema deptstore 3, stadium 5)
110 (-059)      :     4	: float	: mail : (commercial 2, house 1)
114 (-055)      :     4	: float	: mail : (commercial 2, house 1)
118 (-051)	:     4	: float	: troops : (barracks 1)
122 (-047)	:     4	: float	: troops : (barracks 1)
I have never done a serious attempt to adjust these but I think the 1st is production and the 2nd demand.


I highlighted the values for the Hotel bca.
Hotel pax values.jpg


Is it funny that we might be surprised when something works as it should?
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Cargo & Industry fixes for 1.06 Unread post

Ah, I was thinking they'd be in an insane location like, y'know, the production/supply chains section of the file. Silly me. *!*!*!

I wouldn't bother adjusting them for actual gameplay. AFAICT the balance there is one of the things they got right, although I suppose we should test an adjustment just so we can see how (or if) it works.

BTW, I'm thinking at the moment of splitting the Furnace into two industries as a sort of "private alpha 1.07" test thingy. I can then test play any 1.06 maps by editing them to suit. They should still open in 1.06 as long as cargoes stay the same and no industries are removed. IIRC we have 16 industry slots still available, so no problem with creating a few more. It's only removal that could cause instant CTD.

Which is why I'm thinking the cargo chain should be left alone. If we change that to ditch some 1.06 cargoes and substitute others, then I expect that any maps that call the defunct cargoes simply would not open in "1.07", and of course you wouldn't be able to edit them to "1.07" in 1.06 because it would lack the necessary cargoes. Catch 22.

There's also no room to add extra cargoes, so no chance of editing by creating a test installation with several extra ones (some of which would be redundant during play). Unless I'm missing something, you would have to directly edit the .gmp hex to update to "1.07", and that is a rather daunting prospect.

Edit: Come to think of it, we can always implement cargo changes by simply renaming things in RT3.lng and changing a couple of icons, but I'd prefer to avoid that since it means building in inconsistencies on the back end.

Edit again (brain farts rule): I suppose there would be a workaround, in that you could open a 1.06 map in 1.06, then edit out any of the changed cargoes, then save the thing before opening it in "1.07", and then editing the required cargoes back in. Sounds pretty tedious, and I'm not sure I'd be up for it.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Cargo & Industry fixes for 1.06 Unread post

Ok, updated the sheet with the correct express cargo supply and demand. !*th_up*!
Attachments
106_Industry_Chain_update.zip
(22.74 KiB) Downloaded 162 times
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Cargo & Industry fixes for 1.06 Unread post

Hey question, for anyone who knows for sure.

In terms of industries and cargoes, what determines if a map will load without CTD?

I know 1.05 maps load in 1.06, since they don't have any conflicts with missing stuff (it's just missing). OTOH, changing an enabled industry will definitely make a map CTD.

What about industries that aren't enabled? Are they ignored, or not? For example, if you disable all 1.06 industries and cargoes, would a 1.06 map then load in a "1.07"?

I'm basically wondering how much we can change before existing 1.06 maps become impossible to work with, and what process would have to be gone through to update them to work with any new patch. If it involves hunting through .gmp hex then I think it's effectively a no-go.
User avatar
RulerofRails
CEO
Posts: 2061
Joined: Sun Dec 08, 2013 1:26 am

Re: Cargo & Industry fixes for 1.06 Unread post

For some basic concept testing: edits in the RT3.lng would probably be useful. You can also test any single input conversion chain in a warehouse, although remember that the running costs per unit produced for warehouses are a little lower than for real industries (based on the build cost and warehouses are cheap).

Where are you thinking to go with this? Are you thinking about polishing up the 1.06 cargoes with balancing measures and smaller adjustments, or go full-scale with new/re-purposed cargoes etc.?

In terms of what will load, I don't know for sure. But I will speculate anyway. zzwhip I just tried to take a 1.06 map: Africa & the Middle East, change the prefix, then load it in 1.05. It loaded fine. Even without disabling any buildings etc.. A port recipe set to demand Crystals before now demands Alcohol (first cargo in the list). So maybe there is some forgiveness in the system?

I know that a manually placed building can cause a missing file CTD if the game doesn't find files for it. That will definitely cause a crash.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Cargo & Industry fixes for 1.06 Unread post

RulerofRails wrote: Fri Dec 21, 2018 7:56 pmWhere are you thinking to go with this?
Round in circles, followed by disappearing up my own butt. It is, after all, RT3. :lol:
Are you thinking about polishing up the 1.06 cargoes with balancing measures and smaller adjustments, or go full-scale with new/re-purposed cargoes etc.?
I think there's general agreement that we don't much like 1.06 as it stands. The cargoes and industries weren't thought through properly. OTOH, I think that's its big selling point is the extra event logic that 1.06 has available. That's really good stuff, and is really the only thing I want 1.06 for. But there are some extras, like custom newspapers and in-game-buildable docks, which potentially add interest. Locos are slowly getting fixed, so are slowly becoming more usable. So the basics are there for something good, especially if we base things on an .exe which has had track counts and price islands and whatever else fixed.

The big issue is cargoes. We're tightly limited on those (IMO industries have adequate scope) and they have to cover a timeframe from 1830 to at least 2030, and everyone wants to argue endlessly about which ones we should have. That makes me think we should only fix stuff that is definitely screwed.

The less we change, the easier things will be. Balancing measures are fine. They shouldn't break anything, so we can implement as many of those as we like, but I'm inclined to keep cargo changes minimal. Every time we create something new, we're also creating a new testing cycle. So I think the best way to approach it is to start by listing "Stuff that is definitely screwed", and then ruthlessly go for the easiest and sanest solution to make it not screwed.

Taking the obvious one, I'd say we go ahead and split the Furnace into two industries. I'd be fine with an ore smelter being called "Furnace" for game purposes. A smelter is a furnace anyway, so there's no real need to bork anything by changing the name. If you want to use a 1.06 map, just tick off an extra industry (Cement Works, or whatever it turns out to be). Should be easy and trouble-free. Result should be two reliable production chains, which is what is wanted.
In terms of what will load, I don't know for sure. But I will speculate anyway. zzwhip I just tried to take a 1.06 map: Africa & the Middle East, change the prefix, then load it in 1.05. It loaded fine. Even without disabling any buildings etc.. A port recipe set to demand Crystals before now demands Alcohol (first cargo in the list). So maybe there is some forgiveness in the system?

I know that a manually placed building can cause a missing file CTD if the game doesn't find files for it. That will definitely cause a crash.
Cool. That's handy info to start with. !*th_up*! So perhaps the only "updating" issue is placed buildings. That would be an easy thing to update for. Although if ports are wanting Alcohol instead of Crystals you have to wonder what happens at the other end of the list. *!*!*!

Edit; Oh hang on a minute. If industries are being selected by the .gmp on the basis of their position in the list, that is going to overturn half the map if a couple more are added in odd spots. You'd still be able to correct it in the editor if you knew what to expect, but it'd be a fair bit more tedious.

I vaguely remember some discussion between Ned and Stoker about the industry. IIRC they had different opinions on how it works.

Found it: viewtopic.php?f=24&t=3641&p=36398#p36398

This makes me think that if we need to add an extra industry (like a Cement Works) then it may be best to deliberately give it a prefix that shunts it to the end of the industry list. That way it wouldn't upset the existing order, so updating existing maps should be far less trouble. A cement works could be classified as x_Cement_Works, or something like that.

Your PM the other week about RT3.lng edits to change loco names mentioned that it doesn't affect the event availability list but changes the name elsewhere. If the same applies to cargoes and industries, it may be possible to use a prefixed industry name in the editor list but have it show "normally" during gameplay.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Cargo & Industry fixes for 1.06 Unread post

Hey here's an idea (just to really screw things up). We have the extra 30 potential cargoes hidden inside 1.06:

Code: Select all

~4459Beer
~4464Candidates
~4466China
~4468Containers
~4471Detergents
~4472Deuterium
~4477Energy
~4478Fish
~4479Food
~4481Glass
~4482Gravel
~4495Money
~4497Newspaper
~4507Paint
~4508Perfume
~4509Potash
~4510Pottery
~4511Prisoners
~4515Salt
~4516Sand
~4518Spaceships
~4520Syrup
~4523Tea
~4525Tin
~4529Tobacco
~4530Tools
~4538Valuables
~4541Wine
~4542Wire
Now if I understand things correctly, the game won't handle having more than 52 cargoes enabled in any scenario. Personally I think this is enough, because once it gets over 45 cargoes in use the cargo display gets annoyingly cluttered anyway. Things start overlapping and going out of position, and it all becomes a bit of a mess. I prefer to not even use all of 1.06's 51 cargoes at the same time, and think that if you can't design a scenario with 40 to 45 cargoes as a maximum then you should probably rethink things.

Still, the game engine handles having 51 or (maybe) 52 cargoes enabled. So, what does "enabled" actually mean? Does it mean "ticked on in the industry list, and assigned to one or more cities/regions"? Or does it mean "has a .cty sitting in CargoTypes and is called by one or more buildings in BuildingTypes"?

If it's the former, then we could have the whole lot set up with .cty and .bca files if we wanted to, providing nobody ever tried to use them all at once (and you can bet some kid will try it). The only catch would be that any .bca that referenced a cargo would be calling if that building was enabled anywhere, so you'd have to give some thought to production chains so that enough stuff could really be disabled.

So, how does it work? If you have (hypothetically) 80 cargo .cty files alive and kicking in CargoTypes, and 80 cargoes called by various buildings in BuildingTypes, would you still be able to construct a viable working scenario by only selectively enabling the relevant industries in whatever cities and regions (keeping the total under 52), or would that all turn to crap?

Edit: Have just been doing a lot of reading up. First thing is it looks like there is a hard-coded limit of 60 cargoes:
Currently, GMP files store event condition types using a four-byte integer. "YTD company <cargo> hauled" conditions, for example, occupy the codes from 000000FDh through 00000139h. This allocation scheme is what limits the game to 60 different cargoes, of which 41 are currently defined.
Presumably, if you had 80 .cty files sitting around in CargoTypes, the last 20 of them would simply drop off the end of the list and you'd never see them in the editor. Which is handy to know before getting carried away. *!*!*!

It's also rather handy in that it ties in well with the CargoIcons_*.dds that does the icons on the sides of cargo cars. Back in that same thread I see that, at the time, people didn't know how these were assigned. That explains why 1.06 cargoes never called them properly, but I figured it out when I made my bugfix patch for them.

Anyway, CargoIcons_*.dds has 64 slots available on it, and we can easily use them all if we really want to. 52 of them are taken up by 1.06, but that includes four slots that are taken by Mail, Passengers, Any Express and Troops. These cargoes don't actually use cargo icons in the game, because the cars are so distinctive anyway so don't need icons, but with those four icons there on the .dds there are 60 slots vacant. This just happens to tie in nicely with the 60 available slots for cargoes in the .gmp coding, so that's all good to go.

What appears to define the 52 cargo limit in practice is this:
Something to watch out for: cargo limit may be lower than the 60 that the event system suggested. The structure representing the economic record for each square of the map is 471 bytes long; there's an array of floating-point numbers representing cargo quantities available 259 bytes into it. If each floating-point entry is 4 bytes, you can see there might be a bit of trouble past the 52nd cargo or so.
So there's the real limit: the game won't allow space for more than 52 cargoes when tallying up activity on any economic cell. That's a hard limit that you can't get around. However, it implies (would need to test) that it would be possible to have up to 60 cargoes defined in CargoTypes, providing that no more than 52 of them were enabled at any one time. IOW, at least 8 of them would need to be unchecked in the industry list, and not assigned to any regions or cities(ie: slider percentage set to zero everywhere).
User avatar
RulerofRails
CEO
Posts: 2061
Joined: Sun Dec 08, 2013 1:26 am

Re: Cargo & Industry fixes for 1.06 Unread post

**!!!** Try and see. Here's some info on the "52 limit": viewtopic.php?p=2256#p2256.

I don't know how a cargo is "enabled" behind the scenes, but If you didn't notice in the Western Geatland thread I recently mentioned finding Milo's info on what makes a cargo available in an actual game, in the context of placed vs. seeded ports/warehouses, but there is probably all the info you need there: viewtopic.php?p=3210#p3210

The majority case is that a cargo is made available when whatever industry produces it is enabled in the list.

When I said the Port was demanding Alcohol when it used to demand Crystals, all that was happening is that the 1.05 game defaulted to Alcohol (the 1st item) when it couldn't find Crystals. I wouldn't assume this is indication of a numbering problem.

PS. Don't really understand it, but I found a quote about the flatbed cars here by Milo. Not sure if it's anything?
The mystery byte at offset 20h is a 'visual appearance' modifier to the car. 1-8 apply to Flatbed cars, while 9-11 are Open_Hopper cars. This is how the Weapons flatbed shows up, for example. The default for cargos without a 'visual appearance' modifier is just to paint the resource icon on the outside of the railcar.
Post Reply