Jump to content

Detailed Questions About the Math of Demand

Recommended Posts

So, I've found that I'm a bit on the rusty side in my replay of RRT2 in 2021.  (More likely my college age self was less obsessively min-maxy or less prone to overthinking.)

I recently saw a playthrough of the "Crossing the Divide" Canadian Pacific Railway campaign mission go catastrophically sideways (twice) from a combination of very bad planning for demand and extremely (followed by only very) bad rail traffic capacity planning.

I think I've worked out the solution to my troubles with clearing up traffic snarls, but here I want to ask the forum's brain trust a few questions on the game's demand system.

  1. How does demand generated by housing work?  Is there a fixed amount of demand per year that towns and cities generate, or is the amount of demand directly proportional to the number of houses, as is the case with passenger and mail supply?  Maybe there's one set of rules for cargo demand and another for passenger and mail demand?  It looks like demand for goods, lumber, mild and so on are capped at a demand of 4 or 5 in a city, same as a town.  That doesn't explain how fast it regenerates...
  2. How much demand do industries generate relative to supply?
  3. What's the deal with demand from ports?  Reading around the forum it looks like one and only one good in any given port setup generates recurring demand, which appears to have been the case with Halifax and lumber in my recent game (the little Vulcans pulling lumber from Fredericton to Halifax were the only consistent cash cows in my cargo hauling fleet, everything else being break even or loss makers owing to oversaturation of markets).

I've been putting some thought into the way the goods pricing model works, and come up with the following rules for my next playthrough.  I'd appreciate a critique on my thinking.

  1. Each producer of refined products (lumber/food/goods) is linked to one destination town or city, and that town or city consumes those goods ONLY from that source, proportional to the relative output of the industry and the size of the market.  Thus, a steel mill serves two tool & die factories, a cannery serves two towns, and a bakery or textile mill one town.  One paper mill serves one city and one auto factory two cities.
  2. Each producer of raw materials is likewise linked exclusively to one industry or consumer, relative to the above.  So two coal mines and two iron mines serve one steel mill, two oil wells serve one refinery or city, and two dairy farms serve one dairy processor or two towns.  Four logging camps serve one paper mill.  (It's unclear what the ratio of grain farms and fertilizer plants to ranches/farms ought to be...)
  3. Ports that have unbugged demand count as an extra town.
  4. Never extend your lines to pick up raw materials that don't have a final consumer at the end of the supply chain.  If all your towns and cities are already adequately supplied, then you need to extend the network to a new town before adding more supply.
  5. Every town has another town which is its exclusive mail and passengers "buddy".  Cities count as two towns for this.  Passenger and mail trains go exclusively between buddy towns.  ("But what if I'm from Halifax and I don't want to go to Sault Ste. Marie?"  Tough luck, hypothetical game passenger, take it up with the programmers.)
  6. The distance between towns involved in the above relationships should be proportional to the distance bonus for the good involved.  (Long way off for passengers and mail, short as possible for oil and coal.)  This is going to be a bit of a nightmare to actually keep track of.
  7. Pursuant to the above.  Towns and cities should be connected in groups of two.
Link to comment
Share on other sites

* My vague recollection is that towns and cities need about two loads of each cargo in each 2-year cycle to help them grow. Demand softening and recovery is independent from that growth mechanism.

* Industries generally conserve cargo car count, so if you supply 2 steel + 1 tire to an auto factory, then you'll get 3 cars out.

* Unpatched, only the top port demand will recover. That's a bug. The simplest repair is to edit your map to put the most important trade in the top slot of the map's port definition. Other threads on this site explain how to patch ports completely, but I think they have to be fixed one map at a time.

* If you are investing in industries, then you have a trade-off. You can either trade slow to maximize delivery profit, or you can trade fast so certain buildings "gush cash" (buy them first).

* Pax & mail are the big money makers in the game. Sadly, cargo is usually unprofitable. However:

* Haul slow heavy cargoes only short distances. Be willing to accept losses needed to produce fast cargoes that profit from longer hauls.

* Also be willing to accept losses needed to supply town and cities with the cargoes that will grow your pax & mail.

* Towns and cities come in different sizes, so your pax & mail "pairings" will be uneven. What you want is balance of house-count (i.e. 1 city with 12 houses can balance 3 towns of 4 each on the other side of the map).

As you play, you'll become more familiar than my now-fuzzy memory, so please post discoveries and epiphanies back to your own thread.

  • Upvote 1
Link to comment
Share on other sites

Well, I made some progress in the days the thread was waiting for moderation reading old threads and running experiments by setting up runs of cargo supply chains in toy scenarios in the editor.

I'm pretty certain that the demand figures per house that are listed in the strategy guide and your cargo extract file are accurate.  It also appears that the supply per year of any given building listed ingame is accurate, excepting the modifications for business cycle, grain or fertilizer boosts and scenario specific production boosting events.

This leads to an interesting side effect in that since 19th century passenger supply is consistently higher than passenger demand, even a perfectly optimal routing of passengers that matches equal numbers of houses will have a demand level chronically below the 100% demand level of 5, whereas passenger lines after 1958 will be slightly above that equilibrium.  (Supply from ports and sub-town housing add undemanded supply.)  Likewise, mail is permanently overproduced.  Given the revenue boosts from distance, this probably doesn't matter too much.

In terms of industrial conversion buildings, things are a bit more opaque.  While any industry can convert a theoretically infinite number of carloads, in proportion to its requirements, it has a limit of "throughput per year" after which the demand statistic collapses and your revenue from hauling inputs to it tanks.  I'm fairly sure that the "magic number" for aluminum mills is 3 loads per year and that the "magic number" for textile mills is 4.  This means that you need 3 textile mills to balance 4 wool farms getting grain supplies, and 3 bauxite mines per 2 aluminum mills for optimal revenue flow.  This leads to an interesting discovery though, the textile mill throughput limit is not 4 wool per mill or 4 cotton per mill... it's 4 wool per mill AND 4 cotton per mill.  If you have some of both, it's to your benefit to send some of each to each textile mill.  This is true for all of the industries with alternate supply chains.

I haven't figured out whether the "magic numbers" correspond to the integer demand numbers documented in the notes for the fan made patch and the port repair thread, but it's looking pretty likely that they do.  (Hence my request that the good jeffryfisher extract the table of buildings from the exe.  :) (Note to the note, if anyone cares, the experimental method entails making a network of stations in the editor that are SATURATED with an industry, then pouring a controlled number of loads per year into them via source buildings, and then deleting buildings until the balance is just right.  The volume helps keep average station demand closer to the ideal.))  

Incidentally, it looks like delivering 5 loads of a cargo to a station with 9 demand doesn't necessarily cause its demand to drop to 4.  It may only be roughly true for locations with very low numbers of houses or one copy of an industry.

While it looks like fractional demand numbers causing the non increase of demand are a bug, it also seems to be the case that the demand requirements of the weapons factory and munitions plants were there for a reason.  I've been finding it difficult to get the "magic numbers" for these buildings worked out, because they appear to have been designed to be quite low.  I think the weapons factory demand numbers were supposed to be 1/1.5/0.5 aluminum/steel/rubber to match a military depot weapons demand of 2.  This means that while weapons plant demand for rubber always collapsed in 1.56, in 1.57 it can never be sated without cratering demand for aluminum and/or steel.  I think it may be necessary to make a patch to the 1.57 patch that nerfs the aluminum/steel demands for the weapons/munitions plant and the weapons/ammunition demands for the military depots to "fix the fix".  Canneries also seem to have have suffered unintended consequences in 1.57.

Link to comment
Share on other sites

Here's another kick to your head: Try building a second small station that encompasses one of your factories (overlap station service radii). Watch what happens to demand there when inputs hit your first station.


You're welcome!

Link to comment
Share on other sites

I was aware demand was station and not building specific from reading the forums.

The data in the extracts from your US History map post is making me scratch my head more than a little.

It seems my theory of industrial demand is fundamentally wrong in one of its two assumptions. 

Either the numbers listed in the demand for each building don't correspond to a fixed number of loads per year (and the subtable linking to models to floats suggests that may be true) OR the premise that two industries of the same type served by one station have the same demand as two industries in different (non-overlapping) stations is inaccurate, and there's a "diminishing return" of demand fulfillment.  This thread seems to agree with the latter.   Meaning that routing the products of two bauxite mines in two separate locations to aluminum mills in two separate locations is not equivalent to routing them to two aluminum mills in the same location. 

So my experimental plan of pouring a fixed amount of supply through a station with n industries and balancing them to an equilibrium point is deluded.  Oh well.  I was getting sick of painting clusters of factories anyway.


Link to comment
Share on other sites

Posted (edited)

Well, I've basically conducted enough tests to convince me I've got the orthodox supply and demand model mostly figured out.   I've attached the excel sheets containing the values for the 1.57 fan patched executable.  I'm about 50-60% done my toy DB app for planning train routes now.

Roughly speaking, the demand numbers for each industrial building are listed in the float called demand in jeffryfisher's extraction of the executable.   However, pouring 4 units of coal and 4 units of iron into a steel mill doesn't result in a long term equilibrium demand level of 5.  It's actually closer to a long term equilibrium of 2 or so.  Getting any industry to an equilibrium demand level of 5 requires you to deliver about half of its demand requirements.  Since 70% the revenue on twice the volume still nets 140% of the revenue you get keeping the price at 100%, and since you probably use fewer trains to do it and get to buy a steel mill gushing cash on top of everything else, you'd be kind of a fool to shoot for maintaining level 5 demand.

Multiple industries don't stack demand proportionately, but multiple houses DO.  There are a lot of cases where the demand and supply numbers don't quite line up.  2 1/2 bauxite mines sate 1 aluminum mill which sates 1 2/3rds Tool and Die Factories, for example.  I've classified industrial buildings into 3 types.  Single, Combination and Parallel.  Single input buildings are places with one input and one output, like aluminum mills and fertilizer factories.  Combination input buildings are 2 things in, one thing out, like steel mills.  Parallel have two inputs that aren't combined, like a textile mill.  There are also parallel pairings, such as the weapons and munitions factories and the cannery, especially between 1910 and 1930.

Outstanding questions:

Do buildings with parallel pairing inputs experience extra demand for one half of a pair if the second half is unavailable in the scenario?  Example.  Canneries have 3 demand for produce and 3 demand for steel or aluminum in the Canadian Pacific "Crossing the Divide" scenario, but there is no coffee, which would generate 3 coffee demand for each cannery along with 3 demand for steel or aluminum.  So does each cannery generate 3 demand for produce and 3 demand for steel and/or aluminum OR does it generate 3 demand for produce and 6 demand for steel and/or aluminum?  (Note that between 1910 and 1930 canneries generate 6 demand each for produce and coffee and 6 each for aluminum and steel, because it's generating demand for all 4 possible permutations of input combination.)

What's the deal with the demand model for Metra scenarios?  These values mostly weren't included in jeffryfisher's extraction.  It looks like the commercial and retail buildings convert commercial commuters (people coming from housing or the airport) back to residential commuters (people going back to housing) at a 1:1 exchange rate, but don't have stated demand values like the industrial conversion buildings.  Maybe, if we're very lucky, all buildings have a fixed demand throughput in Metra.  (There's only the one airport terminal though.  So it'd be very sucky if it were limited to 6 carloads per year.)  I also have no idea how depoting would work in the Metra.  It looks like it would be convenient to offload people who want to go to the airport from the residential areas into the downtown district where dedicated airport shuttles would pick them up and take them directly, but it isn't clear that would work.

Does 1.57 introduce new bugs while fixing the ones it did, and if so, is it worth trying to fix them?

EDIT: Fixed some errors in the excel file on grain and fertilizer bonus production.


RRT2 Demand.xlsx

Edited by Thomas Crampton
  • Like 1
Link to comment
Share on other sites

11 hours ago, Thomas Crampton said:

Do buildings with parallel pairing inputs experience extra demand for one half of a pair if the second half is unavailable in the scenario?

I don't think the modeling is that sophisticated, so demand for coffee and demand for produce should depend only on the building's parameter and what you deliver. Likewise, delivering lots of aluminum will not boost demand for something to put into the cans, nor does a lack of contents put a lid on demand recovery for aluminum.

Something else fun: If a dual-input building gets only one of it inputs, credits for that commodity pile up in the building. If the building then replaces that input with something else, the credits carry over, becoming credit toward the new material (e.g. decades of wood could become aluminum). I can't recall if there are any examples in the vanilla game; it may only be one of my modded buildings that can create that condition.

Link to comment
Share on other sites

So I sat down and did some map editor experiments, and here's what I found when you link 2 bauxite mines to an aluminum mill next to a coffee farm and a produce farm, and feed it all into one cannery in 1.57:

Supply 4 bauxite -> 4 aluminum + 2 produce + 2 coffee.  Cannery makes 8 food total.  (Enough to feed a city of 40 houses per year.)  Long term cannery station demand averages: ~1 aluminum, ~4 produce, ~4 coffee.

Bulldoze the coffee farm and repeat the experiment.

Supply 4 bauxite -> 4 aluminum + 2 produce.  Cannery makes 4 food total.  (Enough to feed a city of 20 houses per year.)  Long term cannery station demand averages: ~1 aluminum, ~4 produce, ~7 coffee.

Go into the map settings and disable coffee farms (thereby eliminating the possibility of coffee cars):

Supply 4 bauxite -> 4 aluminum + 2 produce.  Cannery makes 4 food total.  (Enough to feed a city of 20 houses per year.)  Long term cannery station demand averages: ~1 aluminum, ~4 produce, null coffee demand.

Since the demand numbers for aluminum, coffee and produce from a cannery are all 3, and the equilibrium number for permanent 5 demand is ~1.5, this is basically empirical proof that cannery demand for aluminum and steel are always 3, regardless of whether coffee and produce are both available.  Don't ask me what happens with the weapons factory, where the vanilla values for rubber demand are 1.5 and 0.5 and the 1.57 values are 1.5 and 1.0.  I suspect it will always go for the smaller value.

The parallel production buildings without combination play the trope straight though, and are most profitable if you service all of their inputs.  (Which is rather suggestive.)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...