Want to praise Simutrans?
Your feedback is important for us ;D.

Bug in Just_in_Time=2 ?

Started by makie, September 19, 2017, 03:05:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Save Game:

Simutrans 120.2.2 R8293
Linux openSUSE tumbleweed  64Bit
PAK128.german _10_3

Let the saved game running.
Look on the mill (Mühle (1898)) in the center.  The mill receive Weizen. The trains come an go. Some time the input storage get overload. Some times the input storage run empty. Let the game fast running. At 4. September maybe 12. Sept suddenly the input storage run empty and no new Weizen  was ordered. You can send the Train who waits for 100% load to the mill. This rest was used up. Then the mill work any more. The input storage stay empty for years, maybe for ever.

If You save this game with the dead mill, and then reload the mill start working again for some months until it die again.

This happen only with Just_in_Time=2 and it happened only if the input storage was overload sometimes.

I have seen this some times ago, with JiT2, the factory stands still for months or more, without recognizable reason. This is the first on, it stands still for ever and is reproducible.



Quote from: makie on September 19, 2017, 03:05:53 PM
and no new Weizen  was ordered.
I can't duplicate no wheat being ordered. I can duplicate it getting stuck with 209 on order as shown in your screenshot.
The supplying farm stops production after it expands with a new field. Save/reload the game restarts production.

Attached patch appears to fix. For DrSuperGood to continue as this is his logic...


Tested with r8346
the Bug is a live and well

a real show stopper


I will look into this soon. I think I might know the cause as I did not consider farm production changes when caching state. In retrospect I think caching state was maybe a bad idea...

In server tests no one noticed this because the game is save/load cycled every time someone joins, which is quite frequently. The cache state is rebuilt on load, so gets corrected.


The attached patch above should still be valid. I don't like stepping on others section of code, so didn't commit...


I have hopefully commited a fix for this.

The factory code is really messy. One day I am going to have to go through it all yet a gain to clean it up and hopefully stop bugs like this from happening.


it looks good.

Tested with R8349.

I think the problem is solved.


just observed it on 128.german with r8870: switched from just_in_time=1 to just_in_time=2 , then observed change in the factory report syntax, then all of the factories stopped ordering, drained down their storage to zero and just passangers cruised around.

What is the current state of this bug? Is it required to start the game over after changes to simuconf have been applied?


this bug here is fixed


there are some ?? funny ?? things

look here,19014.msg180194.html

switch from 1 to 2 in a running game need some time and some save and load until normalization


Right. =2 works fine with a new game or a savedreloaded with =2 set beforehand.


If changing from JIT1 to JIT2 in a running game, the game must be save/load cycled for it to work properly. This has always been the case.

There is no logic in Simutrans to deal with conversion when a setting is changed.


Here is the patch from TurfIt updated to 9593. I have not tested it much. Would appreciate feedback.