Author Topic: Bug in Just_in_Time=2 ?  (Read 489 times)

0 Members and 1 Guest are viewing this topic.

Offline makie

Bug in Just_in_Time=2 ?
« on: September 19, 2017, 03:05:53 PM »
Save Game: http://makie.de/v9_b_m_1916_JIT2.sve

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.


   

Offline TurfIt

Re: Bug in Just_in_Time=2 ?
« Reply #1 on: September 19, 2017, 07:20:20 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...

Offline makie

Re: Bug in Just_in_Time=2 ?
« Reply #2 on: December 10, 2017, 09:48:48 PM »
Tested with r8346
the Bug is a live and well

a real show stopper

Online DrSuperGood

Re: Bug in Just_in_Time=2 ?
« Reply #3 on: December 11, 2017, 02:19:32 AM »
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.

Offline TurfIt

Re: Bug in Just_in_Time=2 ?
« Reply #4 on: December 11, 2017, 02:24:16 AM »
The attached patch above should still be valid. I don't like stepping on others section of code, so didn't commit...

Online DrSuperGood

Re: Bug in Just_in_Time=2 ?
« Reply #5 on: December 11, 2017, 08:31:17 AM »
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.