News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Change Industry Spawning

Started by Severous, July 12, 2009, 09:46:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Severous

Hi

When industry spawns it produces a whole chain.  Too many industries appear at the same time. 

Its unrealistic and disheartening.  I have spent 14 years (days/weeks of playing time) servicing a map with 10 industries which didn't change at all. Then 50+ new industries spring up in minutes as three new chains appear. My sense of accomplishment at building a functioning network was swept away by the scale of the new task before me. Felt like chucking it in.

Can I challenge the basic requirement..a whole chain does not have to appear together.  Incomplete chains are acceptable.

I see James incorporated a suggestion from The hood into experimental. (Obsolete factories removed). This gives me hope that industry generation may also be modified. Gradual change, linked to era, demand & supply, random, and influenced by player action has been done with mixed success in games of this type. Could it be done better here in Simutrans please?
Regards
Sev.

jamespetts

Hmm, 50 new industries all at once is very unusual - ten would be considered a large number. It is usually four or five at most. What pakset are you playing to get such a large chain?

The trouble with incomplete chains is that they are unplayable: if a factory's output gets full, it stops demanding any input, and the effect then spreads all the way back down the chain until the whole thing is paralysed. So, incomplete chains will never work; the issue is, perhaps, more why 50 industries have sprouted all at once.
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.

wipi35

Creation of new industry chains can be avoided by changing cityrules.tab:

# at which number of inhabitants we need a new market?
industry_increase_every = 0

LeifInge

When we played the Rogaland challenge several players faced this, in pak 128 the industry chains are offen so complex, that many have to be spawn at once. I agree that the chains could be more or less uncomplete, or perharps there could be coded in the possibility to expand existing chains. Like adding an extra oil well to a refinery, or an extra sawmill and some woods to the furinture chain.

jamespetts

Expanding of existing industry chains is already possible in Simutrans - but incomplete chains are not for the reason given above.
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.

VS

That is a bug of pakset (primarily). I will have to look at the numbers... sigh.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

prissi

The industry chains will spawn as slowly as possible with current simutrans. If an end consumer have more tahn on comsumption product, first only the first chain will be built, then for next industry advance the second chain and so on. Building less than that is not possible, since otherwise a chain cannot be served, since the production cannot be delivered to the endconsumer.

Severous

Hi and thanks for the responses.

It was indeed Ragoland. Pak128 V102.  32 industries at once. Sand, coal, iron, steel, oil, refinery, electronics is what i remember.  Soon after sheep and textiles chain appeared with 10 I think and finally a third chain with 8-10..which chain I cant remember as I had lost the will to try as the challenge was nearly done.  Dont need so much especially when many of the industries were already present on the map. 

Rather than add a new steel mill to support the new chain, the existing steel mill could initially be the supplier? The player then faces the decision which chains to support with the limited steel. 

An incomplete chain is playable. 

Ok you cannot complete the end product. But you can start.
- An ethanol plant has been running years in the 'long challenge' save in the arena. Its stock piling incoming supplies of corn from a route the scenario designer set up. Ok there is a gas station to take the ethanol but I wasn't interested in completing the chain right away
- Use of warehouse stations to stockpile imputs just outside the industry and drip fed in slowly is another way the industry will run a very long time before its supply chain becomes paralysed.   
My point is the player takes a look at the new industry, works out if it complete, incomplete, or useful to an existing chain, and then acts.

I'm not advocating lots of incomplete chains.  Game spawings should complete them over time. Favouring a spawn in the coming months that will help complete an incomplete chain, or adjust those with serious supply/demand inbalances. Rome wasnt built in a day neither does industry chains in Simutrans.
Regards
Sev.

z9999

In old version of simutrans, end consumer was built on triggered city.
So, triggered by each city's population was needed.

But now, end consumer isn't  built on triggered city anymore.
Is it still a good way to be triggered by each city's population ?

colonyan

One simple way to solve this first in mind is to

-Give setup period for all industry chain buildings
Steps
1. New population increase is achieved to tigger new industry cahin spawn.
2. All buildings tile reserved and construction graphic attached.
     Construction graphic can be simple as flat land with just signs.
     They can give you detail on what structure it is and with where it has business.
3. After the construction period, they function fully by counted as population growth
     factor.

Effect
Simply, it gives player the time to plan and build the infrastructure before its operation without stressing too much.

I know its originaly strictly emotional issue but above method can also make real life situation recreation.


Quote from: z9999 on July 13, 2009, 02:50:11 PM
In old version of simutrans, end consumer was built on triggered city.
So, triggered by each city's population was needed.

But now, end consumer isn't  built on triggered city anymore.
Is it still a good way to be triggered by each city's population ?

You mean, make the game so that there is end consumer trigger population and, production chain trigger population?


jamespetts

There is great merit in having most structures, both built automatically and built by the player, take a significant amount of time to construct.
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.

z9999

Quote from: colonyan on July 14, 2009, 12:50:33 PM
You mean, make the game so that there is end consumer trigger population and, production chain trigger population?

no.  :)

Borgoth

Suffering from the same effect as Severous, I've been thinking of an alternative way for industry spawning as well. And I agree with Severous on how to do it, but let's see if I can formulate it into something clear. On a related note, I'd really love to see industries have a chance to despawn if they've gone for years without any transportation service. This would also make room on the map by getting rid of unwanted industries over time.

Suggestion: New way of industry spawning

New Industry spawn is triggered

Step 1: Search for completely unconnected producers. If some exist, pick one of them and spawn a new consumer nearby for it.

Step 2: Search for partially connected industries (e.g. refinery produces 3 things, but only has consumer for 1 of them or supermarket could consume 3 things, but only 1 producer exists). If some exist, pick one of them and spawn a new pair nearby for it.

Step 3: Only fully connected industries remain. Check production/consumption balance to find spots where considerably more production is needed to meet consumption. If some exist, pick one of them and spawn a new producer nearby for it.

Step 4: Check production/consumption balance to find spots where considerably more consumption is needed to use up the remaining maximum production. If some exist, pick one of them and spawn a new consumer nearby for it.

Step 5: Industry chain is already balanced close enough, nothing new is needed to add to them. Spawn a new random Producer.

Producer Spawned

If the spawned industry produces more than the initially connected consumer needs, search through all known consumers for this industry's productions and see if they need more producers to meet their maximum (consider electricity here). If such consumers are found, connect to as many as needed to find possible consumers for all production.

Consumer Spawned

If the spawned industry consumes more than the initially connected producer needs, search through all known producers for this industry's consumptions and connect to as many of them as needed to reach their maximum, assuming that 100% of their production would be routed this way.


Now a use case: new map with 18 industries (yes, industries, no longer chains), using pak128 for example.

1) Step 5, pop out a Coal Mine.
2) Step 1, unconnected Coal Mine gets a pair. Random generator picks Coal Power Station.
3) Step 3, Coal Power Station needs lot more coal. Spawn new Coal Mine and link them.
4) Step 3, Coal Power Station still needs a bit more coal. Spawn new Coal Mine and link them.
5) Step 5, new producer, just happens to be Coal Mine again. It's left unconnected.
6) Step 1, unconnected Coal Mine gets a pair. This time random generator chooses Steel Mill. It also connects to two other Coal Mines that happen to be close enough, even though they already had a deal with Coal Power Station.
7) Step 2, Steel Mill is so far only acting as a consumer since it can't produce anything yet. And it's only partially connected, so we spawn new Iron Ore Mine for it.
8) Step 1, Steel Mill is now considered a producer and is already caught up on step 1. Random generator decides to spawn a new Car Assembly Plant for it.
9) Step 2, Car Assembly Plant needs Plastics. We spawn a new Refinery for it.
10) Step 2, Refinery requires Oil, so we spawn new Oilfield. Car Assembly Plant now has sources of Plastics and Steel fully connected and is marked as functioning producer.
11) Step 1, Car Assembly Plant is unconnected producer so new Car Dealership is spawned.
12) Step 2, Refinery also produces gasoline and chemicals. We randomly pick gasoline, and spawn a new Gas Station.
13) Step 2, Refinery still produces chemicals that's unconnected. We randomly pick Printing Works to consume them.
14) Step 2, now we have Printing Works that's in need of paper. We spawn Paper Mill.
15) Step 2, Paper Mill needs wood. We spawn Tree Plantation. Printing works gets activated as producer.
16) Step 1, Printing Works is pushing out books, so we spawn Supermarket.
17) Step 2, Supermarket needs furniture and electronics. We randomly choose Furniture Factory to spawn.
18) Step 2, Supermarket still needs electronics, and Furniture Factory needs planks. Randomly we pick Furniture Factory, so we spawn Sawmill. It happens to be close enough to existing Tree Plantation and connects with it as well.

Chains are 'full' after steps 2, 3, 4, 11, 12, 16 and 18. Is it unplayable? Not in the slightest. The difference is, using these rules you can spawn industries one by one as your game progresses, instead of spawning a massive chain at once.

And furthermore, these rules should produce more complete chains than the current market->producer tree spawning, since it also traverses the tree up to create consumption for side products.

prissi

Building trees bottom up is not working for Simutrans. Imagine a coal mine. As consumer an AAC factory is chosen. This needs a cement factory, which need stone. The stone mill has capacity left and will spawn ... (or did I misunderstood something?) There will be always over or underproduction. And the lack of coal in pak128 is intended, by the way. However, the only routing you need to modify is in fabrik_bauer.cc the last two. Just try it.

Also later ingame balancing is virtually impossible, since with electricity production and maybe large but infrequent trains and so on it is extremely difficult to really guess the amount needed. But you are free to try, if you do not believe me.

Borgoth

A case of starting with coal mine and ending up into AAC chain:

1) random spawn Coal Mine
2) consumer for coal mine needed, random spawn Cementmill
3) production for Cementmill needed, spawn Stonequarry
4) consumer for Cementmill needed, spawn AAC and as it needs stones too, link it with the existing Stonequarry as well
5) production for AAC needed, spawn Sandquarry
6) consumer for AAC needed, spawn Materialswholesale

Now the chain is complete. Further steps 1-2 would hit here to get planks and steel for the Materialswholesale, then steps 3 & 4 would kick in to add extra capacity to try to balance consumption/production bit closer to manageable. Excluding the planks and steel side, what you'd end up with is something like:

1 Coal Mine, max 1620/4500 coal can be consumed, 36% rate of use
1 Sandquarry, max 810/1400 sand can be consumed, 58% rate of use
3 Stonequarries, max 1620/3000 stone can be consumed, 54% rate of use
1 Cementmill, max 405/1000 cement can be consumed, 41% rate of use
3 AAC Factories, max 1800/2400 AAC stones can be consumed, 75% rate of use
6 Materialswholesales, max 1800/1800 AAC stones consumed at 100% rate of use

Reasonably balanced, I'd say.

Now, using these same rules, what would happen if spawning was started from top, creating a Materialswholesale first? We'd then add AAC, Cementmill, Stonequarry, Sandquarry and Coal Mine. And we'd be at exact same situation as before. And then rest of the rules would kick in to add further factories (including the planks & steel branches). Really it makes no difference whether it's started from top or bottom, except that Coalmine+Cementmill provides limited transportation opportunity even though it's unfinished chain, while Materialswholesale+AAC doesn't. And thus, bottom-up is more playable when spawning factories one by one.


PS. Any chance to lower the default value of cementmill production? It seems one is enough to provide for a small country. Sandquarry too. I know it's a pak thing, but this is the default pak after all.

prissi

The materialswholesale is probably the worst balanced chain. I will lok into this. But what is the difference between a chain spawned at once and a chain spawned over time? Because with the current system, a materialswhole will get first only AAC, then planks, then steel. This seems not different from your demand, exept for the spawning to be distributed over longer intervalls.

Borgoth

Well really the essence of the suggestion is exactly as you said, spawning of a chain to be distributed over a long time (the bigger the chain, the longer). Which to me equals to spawning them one by one, preferably bottom up.

And as has been noticed by several people, whatever triggers the new industries spawning has a bad habit of not doing anything for 10 years and then whacking 2-3 chains on your face within couple months. Luck? I'd believe it if that happened once, but it's quite common. But this may be pak128 thing, if I have time I'll try to get it happen with pak64 next.

Severous

Thank you Borgoth for raising the profile of this request and prissi for agreeing to look at the materialwholesale. 

My own thoughts are:

5% chance each month of Industry event (% is a variable set at map design)

If triggerred then one of these 4 things happens:
1) New industry appears (single building)
2) Existing industry closes
3) Existing industry increases production
4) Existing industry reduces production

The devil is in the detail of course. I hope any proposal we might work on includes influences for era, supply&demand, and if transportation was provided.
Regards
Sev.