News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Industry spawning

Started by Vladki, February 03, 2019, 09:41:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vladki

Hello,

I have tried to increase the industrial density as public player on the Stephenson-Siemens game, and noticed it is quite suboptimal.

After clicking "increase industrial density", a baker chain was created, consisting of 1 bakery, 1 grain mill, and huge amount (maybe 100) of grain farms. On second try, the same happened - another bakery with its own grain mill, and another 100 farms.  Some time before I got one clothes shop, one textile factory, and many sheep farms. However, the grain mills and textile factory, have capacity to supply 10-20 final consumers. So I would expect, that either at first click, there would be 1 grain mill, and several bakeries, or at least at the second try, just bakeries would appear and link to that grain mill.

It may be that the algorithm is just taken from standard, where most final consumers are hyper-mega markets, that can easily swallow production of 1-2 factories, and is not suitable for small shops. I also looked at the dat file options, and there is only InputSuppliers saying how many suppliers there should be, but it is mostly not defined at all in pak128.britain. The question is if it can work with fractions telling it takes only 1/8th of a supplier production.

Any ideas, how to generate more pleasing industry chains?

jamespetts

This topic has been discussed before, but I have never managed to find any actual error. However, it is planed that the code for the placement of consumer industries will be rewritten when the town growth algorithm is rewritten, which might improve the handling of industry chain growth.

Also, there is some ambiguity when you write that the various primary and secondary industries could supply more tertiary industries: the demand of the tertiary industries varies with the number of passengers supplied to them, so, depending on how you are judging the demand, it may well be that all of the primary and secondary industries are necessary for the given tertiary industries if they were at full demand.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

I have seen the same.

But, as James says, I don't believe this to be a bug, just a consequence of a partially done industry balancing and placing code. For the time being I have started to create maps with no industry at all and instead placing them myself as public player. It's even fun and leads to some interesting freight routes. :)

prissi

I think the number of grain farms needs to be limited in the dat file of the grain mills to 5 or so. The problem with fields is, that they have initally a very low production, and hence many are spawned. Because the routine spawn fields until demand is fulfilled. However, when the new field appear due to farm grow, they will have much higher capacity than during placement stage. Hence the Amount must be limited in the dat-files of the pak.

Jando

Yes, on my current map (all industries manually placed and linked using public player) the grain mill easily supplies 20 bakeries with the input from 12 grain farms. In practice bakeries consume 1 flour per day, they don't get enough visitors to consume more.

Screenshot here:


Phystam

I think that the production of farmer is very low: maybe we need reconsideration of production unit.
ton is very large unit relatively. Do you think a bakery can use the plenty of flour within 6 hours? Do you think a farmer can produce 1 ton of flour within 6 hours?
I propose to change the unit smaller — for example, a bag (60 kg).

jamespetts

Thank you for all of your feedback on this. My apologies for not having had a chance to look into this until now: I have been very busy with working on fitting out my new shed lately.

First of all, as to Prissi's comment: this is an interesting observation relating to field growth, but I am not sure that this is what is being reported here, since the fields only grow after placement when the industry is being used and, from what I understand, what is being reported is a possible imbalance in the number of farms even those that are not being used by the player.

It is, I should note, rather problematic for industries to expand gradually while they are being used: farms do not actually do this in reality, so it makes any realistic balancing very difficult. It makes rather more sense to be able to disable this growth entirely, or at least greatly reduce its potency. However, the growth rate does not appear to be what is in issue here, so this is not currently a priority.

As to the actual production quantities, these have all been carefully calibrated from real data where available, and extrapolated/interpolated elsewhere. If anyone has better real world data from historical sources, please let me know so that I can refine the data in the pakset. Note that farm data is carefully based on production per hectare at different times in history and has been calibrated quite precisely.

As regards the demand of industries/visitor attractions, I had wondered about creating different subtypes of visiting trips (I am not sure that "shopping" and "sightseeing" are the best subdivisions, but that is another matter) using the same algorithm as for visiting and commuting trips by just adding more categories (and thus increasing the number of lists that a building can be in and the number of types of demand that it can have, etc.): but that would take a very large amount of work, so would have to be scheduled as a major project behind all of the other higher priority major projects, likely therefore to be a considerable number of years in the future if I were to have to do this work myself (and, for this, the work to calibrate the pakset would be at least as great as to add the feature in the code). Further (and extremely detailed) consideration as to (1) whether this would actually be workable and deal with the underlying issue without causing anomalies elsewhere; and (2), if it would, precisely how the categories should be delineated would be necessary before starting work on coding such feature.

In relation to the placement and number of consumer industries, the intention is to look into this in more detail when the town growth algorithm is altered. However, this cannot be done until the work on convoy maintenance/recombination is finished. That work cannot be restarted until the loss of synchronisation bug and other signalling bugs reported recently (and any yet undiscovered that may be reported before work on the town growth has been completed) have been solved, and it is very hard to predict how long that solving any of those bugs will take. The loss of synchronisation bug in particular may take many more months to deal with, not least because I can only do any useful work on it if I have many, many consecutive hours free so long does each individual round of testing take, and several weeks can pass without a single such opportunity.

The best way to speed progress towards improving industry placement, therefore, is to assist as much as possible with the work needing to be done further back in the queue.

In any event, thank you all again for your feedback on this issue: it is much appreciated.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

Quote from: jamespetts on February 10, 2019, 10:49:13 PM... As to the actual production quantities, these have all been carefully calibrated from real data where available, and extrapolated/interpolated elsewhere. If anyone has better real world data from historical sources, please let me know so that I can refine the data in the pakset. Note that farm data is carefully based on production per hectare at different times in history and has been calibrated quite precisely. ...

Hello James! Thank you for your answer!

As to the production quantities, in my opinion there's no problem. Your calibrating of farm output is excellent, no change is required. Current generated maps in Extended do not have a problem with supply, it's the other way round: they have a problem with demand. Like Vladki said in his original post: 1 bakery, 1 grain mill and about 100 grain farms. That's a huge oversupply of grain even with low farm outputs. In 1870 a typical grain farm produces 2 grain per month, in 1870 a typical bakery demands 1-2 flours per month.

That's why I have pushed demand in my current map with manually placed industries. My current rules for placing end-consumer industries are:

1000 Market, Bakery
2000 Tavern, Grocer
3000 Dairy*, Bakery, Newsagent
4000 Clothes Shop, Hardware Shop, Bookshop
5000 Coal merchant*, Builders' yard*, Bakery
6000 Market, China shop, Furniture shop, Tavern
7000 Newsagent, Bookshop, Bakery
8000 Grocer, Clothes Shop, Hardware Shop, China Shop, Furniture Shop

Means if a town/village has more than 1.000 inhabitants I place a market and a bakery, if it has more than 2.000 villagers it also gets a tavern and a grocer, above 3.000 it also gets a dairy, a newsagent and another bakery and so forth. This approach creates demand for freight goods. And that demand is easily supplied by the current producer outputs.

jamespetts

Jando - may I ask to what the numbers refer; are these the number of bakeries (etc.), or the unit demand of each bakery?

The demand per consumer industry is also calibrated with some precision so that each visiting passenger who arrives consumes a realistic quantity of goods. Is the issue the number of passengers who visit these tertiary industries compared to the number that would in reality visit these shops in an equivalent period of time?

As to demand relative to electricity, I am not sure that I understand the comparison being made here, as the two demand systems are entirely separate - can you elaborate?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

Quote from: jamespetts on February 11, 2019, 06:52:29 PMJando - may I ask to what the numbers refer; are these the number of bakeries (etc.), or the unit demand of each bakery?

Hello James again!

I'm not sure I have understood your question correctly, sorry. Concerning the supply of bakeries I mean that a typical bakery on current maps around 1830-1870 demands 1-2 flour per month and a typical grain farm supplies 2 grain per month. Thus one grain farm supplies more grain than a bakery typically demands with current visitor numbers. Here's a screenshot of it:



Shown is consumed flour of a typical bakery and produced grain of a typical grain farm. One grain farm supplies enough grain to supply one bakery with flour. Yet we spawn around 100 grain farms per bakery. :)

If you mean the 1000, 2000 and so forth numbers in my earlier post: those refer to number of inhabitants in a town: if a town has more than 1000 inhabitants I manually place and link a market and a bakery, if the town has more than 2000 inhabitants I also place a tavern and a grocer. If the town has more than 3000 inhabitants I also place a dairy, another bakery and a newsagent. I'm just trying there to make towns that seem reasonable to me, trying to scale the amount of consumers a town has with the numbers of inhabitants.

jamespetts

Ahh, yes, I see: you are referring to the relationship between population and the number of industries. That does make sense. This is the sort of thing that can be revisited in the code in more detail when the town growth changes are implemented.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

Quote from: jamespetts on February 11, 2019, 11:58:40 PM
Ahh, yes, I see: you are referring to the relationship between population and the number of industries. That does make sense. This is the sort of thing that can be revisited in the code in more detail when the town growth changes are implemented.

Yep, it also makes for interesting maps because every town has at least some demand (however low) for freight. I combine that with where producing industries may be placed:

- Orchard (must be placed on height 2 above water, max. 1 orchard per 8 markets)
- Cattle farm (also placed on height 2 above water, 2 farms per dairy)
- Vegetable farm (place on height 3 above water, 4+ farms per market)
- Grain farm (must be placed on height 4 or 5 above water, 2 farms per bakery)
- Sheep farm (on height 5, 2 farms per clothes shop)
- Coal Mine (on height 6+, amount of mines to be defined)
- Iron Ore Mine (on height 6+, amount of mines to be defined)
- Quarry (on height 6+, 1 per 2 builders' yards)
- Clay pit (Adjacent to river tile, height 3, 1 per 2 builders' yards)
- Forest (On forest tiles height 4+, amount of forests to be defined)
- Fishery (Always on deep water tiles, 1 fishery per 8 markets)

That way geography of the map causes that there are centres of production for certain items. Since production of items is tied to height above water but demand is tied to population of a town there's plenty of opportunity for freight services. :) 

jamespetts

I have been considering whether there is any short-term temporary solution to the issue of there being insufficient consumer industries, pending the total reworking of town growth.

I have, somewhat experimentally, effected a change whereby all industry growth caused by town growth (rather than caused by the game detecting that the industry density is too low) spawns only consumer industries. I do not know whether this will work properly, but I should be grateful for any feedback on this.

Anything more sophisticated will have to await the total overhaul of the town growth code.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

Is that change in the nightlies?

jamespetts

Yes - it should be in to-morrow's build.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

Quote from: jamespetts on February 12, 2019, 10:31:24 PMI have been considering whether there is any short-term temporary solution to the issue of there being insufficient consumer industries, pending the total reworking of town growth.

I have, somewhat experimentally, effected a change whereby all industry growth caused by town growth (rather than caused by the game detecting that the industry density is too low) spawns only consumer industries. I do not know whether this will work properly, but I should be grateful for any feedback on this.

James, much appreciated that you try to help us freight dogs, many thanks. :)

However, I don't think that change will do much. Please note that there's two issues at play here:

1. Few consumer industries are spawned amongst that large amount of suppliers.
2. Consumer industries in practice have little demand for freight.

Spawning a few more consumer industries that have little demand for freight won't really do much. In my manually made map I have obviously no shortage of consuming industries, I have plenty of them. I have currently connected 14 towns where I have placed 31 bakeries, 12 bookshops, 5 builders' yards, 13 clothes shops, 5 coal merchants, 15 dairies, 13 grocers, 13 hardware shops, 15 markets, 14 newsagents and 15 pubs that are all supplied by freight routes. I also switched on cross-connect industries to make sure every single consumer can demand it's goods by whatever supplier he picks. But there's still little demand.

While the nominal demand of these consumer industries (first line in industry window: max. 2 (or 4 or 8 or ...) units per month sounds fine and well balanced their actual demand is far lower, from what I understood from one of your previous posts due to too few visitors. And indeed, passengers don't like to visit consuming industries.

At the railway station in my central hub town I have currently 575 passengers waiting for their trains. They have the following destinations:
bakeries: 27
bookshops: 0
builders' yards: 0
cemeteries: 6
clothes shops: 16
coal merchants: 2
cricket grounds: 2
dairies: 0 (dairies are odd because they have a visitor demand of 1 and always operate at full nominal capacity)
football grounds: 96
grocers: 3
hardware shops: 0
hovels: 118 (hovels are odd too because of their range in population, going from 16 to 64, it may well be that an Extended town has the highest population density amongst the hovels)
markets: 43
nelson's column: 4
newsagent: 10
pubs: 9
semi-detached houses: 26
shops: 7
terraced houses: 165
town houses: 30

The big travel destinations on that map in 1878 are terraced houses, hovels and football grounds.

In my experience two consumer industries create demand for freight: dairies because they have no demand for visitors and markets because they get decent visitor numbers and have rather high nominal demand (even 133% for fruits and 200% for fish, both also materials that are easily provided by high-output suppliers). Pubs come third. All other consumer industries are basically "don't bother", they create an  initial spike when the industry gets connected, demanding goods that will usually last them the next 2 or 3 years and after that the industry will obviously not demand anything for the next 2 years.

jamespetts

This looks as though it might be a balancing issue: thank you for setting out the detail. This sort of balancing issue is likely to take some intensive work to deal with, as all the various things that factor into the balance integrate in very complex ways with many other things which may be broken if the balance be not adjusted in precisely the right way, and what that right way is will need very detailed investigation.

I am not likely to have time to do this until after some more of the critical bugs are fixed, since those are at the head of the queue for the things that require that degree of work; smaller tasks can be done more quickly since I can complete working on them in a much shorter session than would be worthwhile even starting on one of the very large tasks such as this as large tasks of this sort require very long, uninterrupted sessions (of at least 3, sometimes up to or even over 6, hours).

What might assist is if you could carry out detailed experiments and calculations to try to work out precisey how the balance works such that consumer industries appear to have less effective demand at least in some cases than is intended, all the while making sure to test whether this is the issue at all, as this is not certain at this juncture.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

In terms of the capacities/demands of shops: certainly, the per passenger consumption should not be altered, as this has been calibrated very precisely. If we use area as a metric, on the basis that each tile is 125 meters squared, a single shop might count as up to about 4 shops in reality, but probably no more than this. If I recall correctly, this is already how the smaller shops are calibrated. If there are too few shops, the problem is not the demand of each shop, but rather the total number of shops, which, if the temporary fix effected recently does not assist, will need to be addressed at the time of the major revision to the town growth code.

Incidentally, to do any balancing, we need to go much further than concluding that there should be more or less of something: we need precisely calibrated figures based on actual in-game metrics, such as how many shops that an area of a town equivalent to a single tile building would realistically have accommodated, the number of customers that would in reality have visited those shops each day, how much that each customer would on average have been likely to have bought and how many shops of a given type would be likely to be in any town of any given size. That is what I have attempted to do with the balance as it stands. To diagnose any fault with this, we need to work out how the numbers that we have at present diverge from reality so as to find and fix the true issue. We may well need empirical data to do this properly.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.