The International Simutrans Forum

 

Author Topic: Limit on storing incoming goods in factories  (Read 6815 times)

0 Members and 1 Guest are viewing this topic.

Offline dom700

  • *
  • Posts: 44
Limit on storing incoming goods in factories
« on: January 10, 2012, 09:13:57 PM »
Hello,

as some of you might know, there is a limit on how many goods a factory can store, any incoming transport that would lead to a storage of more than 15k is completely disregarded. Now I started a discussion in the german forum about this topic, and since pak128 features a few industries, which can easily reach this limit (refineries *sigh*, steel mills :P), I would like to hear your opinion about this. On the german forum the opinion basically was two-fold. On one hand, Dwachs suggested that it can be changed quite easily (which cfds did for the personal version the two of us are using), while theTransporter suggested that raising the limit would lower the difficulty of the game, because you dont have to care about wasted goods anymore.

Opinions?

Offline greenling

  • Lounger
  • *
  • Posts: 1728
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: Limit on storing incoming goods in factories
« Reply #1 on: January 10, 2012, 09:51:41 PM »
dom700
your idea to limit the overflow it´s nice.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1323
Re: Limit on storing incoming goods in factories
« Reply #2 on: January 10, 2012, 11:03:47 PM »
This is more an issue with pak128 having insanely sized storages IMHO. Likely due to them not having been updated when the code change that scales them based upon production went in. A multi-year supply in storage is...

If factory storages legitimately are desired at such sizes, then this should be increased; Shouldn't be throwing away goods when not even full yet.


Offline dom700

  • *
  • Posts: 44
Re: Limit on storing incoming goods in factories
« Reply #3 on: January 11, 2012, 06:18:33 AM »
dom700
your idea to limit the overflow it´s nice.
a0001
it's already in the game, everything after 15k is thrown away.

Offline Postlimit

  • *
  • Posts: 29
  • Languages: EN
Re: Limit on storing incoming goods in factories
« Reply #4 on: January 11, 2012, 07:07:40 PM »
Quote
A multi-year supply in storage is...
I think you should find the balance between the size of a single (train/boat/truck) cargo load (anything between 5 and 500 tons or so?), and the storage. And I think it's alright at the moment.

In reality (which I still think is what simutrans tries to imitate?) refineries, steel factories, coal power plants do NOT use the "just in time" principle, while car factories, and a lot of food/feed industry does use this principle.

In the game, the storage can be multi-year, but a single train journey can take months. In reality, storage of large industry is for weeks, but 7 days on a train gets you from Moscow to China. It's the same ratio.

Offline VS

  • Senior Plumber (Devotee)
  • Moderator
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Limit on storing incoming goods in factories
« Reply #5 on: January 11, 2012, 08:13:20 PM »
If there's a strong push for making the storages smaller, then why not. However, I think some more discussion could happen, particularly meaning "more people"...

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1323
Re: Limit on storing incoming goods in factories
« Reply #6 on: January 11, 2012, 10:44:20 PM »
Strong push, nah. Gentle nudge, maybe.
Playing Severous' Wilderland scenario was my first time actually playing a game with pak128 in quite a while. Seeing sawmills producing 5000/month with 75000t input storage was startling. I think such large storage capacities work against the spirit of the JIT setting. While you eventually have to connect the downstream industry, you can delay doing so for quite a long while.

I also wonder if this causes some of the frequent 'help: my industries have stopped working' posts that pop up. For the sawmill above, you could feed it with the full forest output of 6250/month for 14 months, then 'suddenly' it stops working. It's perhaps unexpected to work for so long before triggering the JIT mechanic.

Offline VS

  • Senior Plumber (Devotee)
  • Moderator
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Limit on storing incoming goods in factories
« Reply #7 on: January 12, 2012, 12:51:36 PM »
...I'm not aware of any changes, and these numbers stayed the same in sources. It might have happened at some unspecified earlier time - I haven't been playing the game much.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1323
Re: Limit on storing incoming goods in factories
« Reply #8 on: January 12, 2012, 01:32:03 PM »
Included in Knightley's factory boost patch was a change to scale the factory storage amounts based upon actual production rate of the instantiated factory. Previously the storages were of a fixed size. e.g. If you specify production=100, storage=1000, range=50-500, and a factory with actual production of 400 is created, then storage will be 4000 for that factory.

I presumed pak128 set them based upon the old behaviour, and hence now tend to be on large side with the new…
« Last Edit: January 12, 2012, 04:38:00 PM by TurfIt »

Offline VS

  • Senior Plumber (Devotee)
  • Moderator
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Limit on storing incoming goods in factories
« Reply #9 on: January 12, 2012, 02:51:30 PM »
Don't forget that pak128 has twice as long months. Still, the numbers don't add up. It's either a bug, or I'll eat my (metaphorical) hat and recognize it as a pakset bug. Let's take the sawmill as an example (code below). Taking into account the longer month and everything maxed up, the maximal monthly production is:

(100 + 160) * (1 + (1000 + 200 + 500) / 1000) * 2 = 1404

1404 < 5000 => ???

Something is still missing...

Code: [Select]
Productivity=100
Range=160

Electricity_amount=50
Electricity_boost=1000
Mail_demand=5
Mail_boost=200
Passenger_demand=20
Passenger_boost=500

#total input 240
InputGood[0]=Holz
InputCapacity[0]=3000
InputSupplier[0]=0
InputFactor[0]=125

OutputGood[0]=Bretter
OutputCapacity[0]=500

edit: Now that I think about it, the numbers I saw in Severous' game were pretty shocking to me, too, but I thought he modified the save manually to give players some boost. I certainly remember playing with something saner.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1323
Re: Limit on storing incoming goods in factories
« Reply #10 on: January 12, 2012, 04:04:35 PM »
If you mean the 5000 production, I think that scenario had the factories manually placed. So the productivity and range values aren't used.

Storage capacities don't scale with bits/month, only production/base production. Was added originally in the patch but removed after lengthy discussions about what should/should not scale. Correct or not, I don't know. So easy to get completely confused with such a simple parameter...

The .dat is specifying 24 months storage @18b/m, rather large for meaningful JIT function IMO. But that's only one opinion.

Offline VS

  • Senior Plumber (Devotee)
  • Moderator
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Limit on storing incoming goods in factories
« Reply #11 on: January 12, 2012, 05:26:18 PM »
I think that somewhere along the discussion, I mixed productivity and storage. Cue freak-out music. Going yet again through the numbers, it seems that productivity is not wrong, just the storages, and these agree with dat files. So, I'm going to excuse myself for a bit and munch some tasty hat in the corner... :P

Anyway, it's good to know where is the problem. Before, I just thought these numbers are already good and don't need touching, so I didn't even bother to learn what they do!

Now, I can give my informed agreement that some storages are probably indeed excessive :) BTW, these are, too, ancient and pre-JIT.



Anyway! The technical matters seem to be solved, and the original issue still stands... I understand that when eg. a bunch of ships (high capacity) comes, the unloaded goods get lost if they exceed input storage. Was it that?
« Last Edit: January 12, 2012, 05:34:17 PM by VS »

Offline jk271

  • *
  • Posts: 292
  • Languages: CZ, EN, DE
Re: Limit on storing incoming goods in factories
« Reply #12 on: January 27, 2012, 04:07:30 PM »
I think, that input storage capacity of steel mill in pak128 is ok. I made some calculations and result of it is: Stell mill has input capacity for 2 days and 6 hours (for iron ore). (without electicity supply - with electricity supply it woudl be one half).
Switching on (I dont know correct english expression) of steel mill is extremly expensive, so it must have enough raw materials for continuous production.
Coal power station (and not only coal- ) has to have enough coal supply for continuous production of electric energy because of strategic reasons. Accident can happen e.g. - tree fallen over the track.
Bigger limits enables usage of ship transport - and it improves varriability of game.
For example Crude oil is transported by tankers or pipes and not so much by trains as it is in game.

Wood has to dry up to can be used as a construction material so bigger capacity of sawmill is correct too.

Just in time factories are another issue.

Offline dom700

  • *
  • Posts: 44
Re: Limit on storing incoming goods in factories
« Reply #13 on: January 28, 2012, 07:02:01 AM »
Well jk, the problem is, the limit for steelmills is not okay. There is a hardcoded limit of 15k in the code, all goods arriving after this limit is reached magically disappear in a nearby river.
Even at smaller maps this limit causes a lot of iron ore to just go to waste, which is not its intended use.

Offline missingpiece

  • *
  • Posts: 100
  • Languages: DE, PT, EN, FR
Re: Limit on storing incoming goods in factories
« Reply #14 on: January 28, 2012, 08:25:10 AM »
I understand that when eg. a bunch of ships (high capacity) comes, the unloaded goods get lost if they exceed input storage. Was it that?
Well jk, the problem is, the limit for steelmills is not okay. There is a hardcoded limit of 15k in the code, all goods arriving after this limit is reached magically disappear in a nearby river.
Oh, dear, I may not have paid enough attention at my game yet to notice this very unfortunate side effect...and on a side note I do agree that the late kicking in of the JIT effect is...challenging. If indeed the wasting of material, that is by shipments arriving and exceeding the 15k limit, can be changed by adjusting the values of the pack instead of coding, then I would strongly lean to such a solution. Because having values such that materials go to waste is IMO against the game's intention. (the hard-coded limit must be seen as set in stone for this matter I guess).

Offline MagnusA

  • *
  • Posts: 35
  • Languages: SV, EN
Re: Limit on storing incoming goods in factories
« Reply #15 on: January 28, 2012, 10:26:31 AM »
In real life the storage is limited. I have no idea how limited (production X days or so?), but it is in some way or another.

In the game I think that one of the main goals/challenges is to *not* overflow the inventories of the factories. Even if the coal mine is capable of delivering 4,000 units per month you should not haul away all these 4,000 units if the factory cannot consume more than 1,000 units a month. In real life you won't get paid for those excessing 3,000 units that the factory did not order (at least I would not pay for stuff I haven't ordered). Ultimately it is the "consumer market" that decides the deliveries from the raw material supplies.

Offline jk271

  • *
  • Posts: 292
  • Languages: CZ, EN, DE
Re: Limit on storing incoming goods in factories
« Reply #16 on: January 28, 2012, 03:54:53 PM »
Overflowing is bad. The problem with overflowing could be solved by adding new entry (e.g. factory_max_input) into game settings.
It would enable *pak* developers to adjust the more suitable value.

There is a following statement in file simfab.cc on line 64:
static const int FAB_MAX_INPUT = 15000;

So it would not difficult to change the value to a bigger number.

Edit:
This patch should solve the problem.
when patch is applied, add following lines to pak128/config/simuconf.tab:

# factory_max_input_capacity
factory_max_input_capacity = 25000

P.S. I will add have added the patch to patch releases.

http://forum.simutrans.com/index.php?topic=9090.0
« Last Edit: January 28, 2012, 07:02:02 PM by jk271 »

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1323
Re: Limit on storing incoming goods in factories
« Reply #17 on: January 28, 2012, 07:51:00 PM »
I don't see why this needs to be a configurable value.
Why not just use twice the max storage?


Offline missingpiece

  • *
  • Posts: 100
  • Languages: DE, PT, EN, FR
Re: Limit on storing incoming goods in factories
« Reply #18 on: January 29, 2012, 05:55:36 AM »
In the game I think that one of the main goals/challenges is to *not* overflow the inventories of the factories.
I am absolutely with you there. But the game mechanic problem as I understand it now from this thread is the following :

While usually a full receiver will lead to the producer not delivering any further goods, that is the connecting station will not receive more, though the trains will deliver everything that has already been deposited into the connected station's storage (of the producer). It has been called here the JIT effect.

However in this situation where you hit the binary program code's limit of units in the factory, the problem described here in the thread, the trains continue delivering, yet the goods are thrown to waste.

Is that it ?

Offline VS

  • Senior Plumber (Devotee)
  • Moderator
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Limit on storing incoming goods in factories
« Reply #19 on: January 29, 2012, 11:20:48 AM »
Yes, that's it, more or less. There are some other effects, but the essence is indeed that - cargo in transport wreaks havoc.

Offline dom700

  • *
  • Posts: 44
Re: Limit on storing incoming goods in factories
« Reply #20 on: February 17, 2012, 07:14:25 AM »
I don't see why this needs to be a configurable value.
Why not just use twice the max storage?

Sorry for noticing your post just now.
CFdS has changed the max storage in a customized version, which were using anyway because of our signal addons.
Somehow this changed max storage leads to another bug, causing the storage to stop counting downwards at 16384 or 32768 units (we limited max storage at 50k)(and yes the numbers are straight 2^x). This effectivly stops all production by the factory involved, eventually killing off all industrial production. So far no clue whats happening.

Offline dom700

  • *
  • Posts: 44
Re: Limit on storing incoming goods in factories
« Reply #21 on: March 11, 2012, 08:25:24 PM »
Any changes to the situation coming? At the moment this leads to large (or should I say LARGE) maps having quite some problems with lots of goods disappearing.

Edit: I just noticed having a steelmill in my game with a storage limit for ore of more than 15k. Thats a joke because it can never be reached and clearly a bug
« Last Edit: March 13, 2012, 01:36:05 PM by dom700 »