News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

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.

makie

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.


   

TurfIt

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...

makie

Tested with r8346
the Bug is a live and well

a real show stopper

DrSuperGood

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.

TurfIt

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

DrSuperGood

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.

makie

Thanks
it looks good.

Tested with R8349.

I think the problem is solved.

ampersand

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?

makie

this bug here is fixed

but

there are some ?? funny ?? things

look here
https://forum.simutrans.com/index.php/topic,19014.msg180194.html

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

ampersand

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

DrSuperGood

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.

prissi

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