News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

All industries lose connections without warning, usually a crash after.

Started by merry, March 14, 2024, 05:50:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

merry

Having recently returned to Simutrans-Extended, i am finding that maps can suddenly, and with no identifiable reason, lose all connections between industries (whether there is a transport conenction or not). Most times, after viewing an industry where the 'missing connections' are warned of, the game crashes shortly afterwards (crash = unscheduled immediate termination of process, in this case).
Version in use: 123.0.1 build 14.21
This is making games frustratingly unplayable, even if saved regularly.

I am working in about 1853, but haven't built railways yet so transport is primarily road carriages, ships, and canals. If that has any bearing on the matter.

i have searched bug reports and scrolled through bug lists, and can't see this reported, so forgive me if it is a known issue, I couldn't find the report when I searched.

Ranran

Developers appreciate that you take the trouble to report a bug.
It will improve the game.

I think one cause I can think of is related to the new just_in_time=5 that was added about two years ago.
The configuration is not playable, it has not been extensively tested, and there is no one to fix it.
That setup will cause mass factory closures anyway.
I think the phenomenon you reported is similar to what occurs in that setting.
(However, the root cause may also be the closure and regeneration of the industry)

Can you check what just_in_time is set to?
You can check it by pressing the shortcut key i to open the settings dialog, then open the economy tab.

Also, submitting reproducible save data will almost always lead to early resolution of bugs.

merry

A couple of updates:
(1) just_in_time = 4 (this will have come from defaults)
(2) recently, I left the game running for a few game-months - the connections disappeared during that time but it didn't crash (perhaps I didn't open a dialog at a critical point? So I have before & after saves (links in onedrive) if that helps.
Save before (link)
Save after (link)
Hopefully someone will be able to use these to improve the situation (either a fix or workaround). Unfortunately i'm not much of a coder... 'tinkerer' is about my limit these days.

Ranran

I tried using the before save to advance to Feb.1858, but was unable to reproduce the game crash...
However, no industry closures occurred during that time.

jamespetts

Thank you very much for your report and apologies for not having had the chance to respond hitherto. Generally, finding and fixing bugs is only really possible (within the resources of amateur developers such as those who work on Simutrans, at least) with a reliable reproduction case. That means a saved game in which the fault can reliably be reproduced (if necessary, by following specific instructions) within a reasonable time so that we can look inside the game code when the problem occurs or get a backtrace for any crash.

I note that Ranran has had trouble reproducing the crash from the saved game, suggesting that the bug may be hard to find. Unfortunately, intermittent bugs are typically difficult to reproduce and track down. If we can get a reliable reproduction case, especially for the crash, that would be very helpful (although it might turn out that the crash is just a symptom of all the industries losing their connexions, and that what we need to track down is the earlier point in time when this happens).
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.

Modular6638

I'm having the same issue in every map I make. Here are some things I observed
- It does not matter the year or map.
- It seems to happen more often when placing a new stop & line near the end of the month.
- The game doesn't always crash immediately, it only does so when opening a factory info window and clicking on the empty space where the missing supplier/consumer are supposed to be, early on it also seemed to happen if I kept the factory window open.

I tried debugging, and in gui_factory_connection_stat_t::infowin_event the variable target_fab is null and is being accessed. My understanding is that if another factory is not linked, its not supposed to be in fab_list, but the missing connection is still in there. So that is the cause of the crash. Looking into it more, the reason fabrik_t::get_fab(fab_list[line]) returns null is because of the is_factory flag of the associated gebaeude_t is false. I think there might be a problem in the newmonth update because of when the crashes seem to happen and that is also one of the few points where is_factory is modified. Still trying to look into it but my first time looking at the code.

Ranran

Thank you for confirming.
fab_list was originally vector_tpl<koord>, but PJMack changed it to a different type, so it won't get the correct koord if there is no factory.

Ranran

Quote from: Ranran(retired) on April 13, 2024, 10:53:08 AMfab_list was originally vector_tpl<koord>, but PJMack changed it to a different type, so it won't get the correct koord if there is no factory.
I suppose I have taken measures for this problem.
Please check pull request #649 to see if it is working properly.

jamespetts

Quote from: Ranran(retired) on April 28, 2024, 12:38:44 PMI suppose I have taken measures for this problem.
Please check pull request #649 to see if it is working properly.

Thank you very much for this - now incorporated. This should hopefully address the crashing, but will not solve the underlying problem, which originates outside the UI code.

If anyone has a reliable reproduction case for this, that would be very helpful.
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.

merry

So life & work was crazy (in a good way) for months, and i've just come back to see how Simutrans is working now.

Thanks to all who've put in so much work on this and other issues.

So it seems that James' statement above is quite correct.
On the bright side, it seems now stable and doesn't crash...
...unfortunately in the recently downloaded 123.2 build 14.23 nightly 9 Oct 2024 the loss of connections still occurs :-(
[confusingly, the 'history.txt' file in the program folder in inconsistent, & refers to 124.0/r11164 5-May-2024, and has a later line above too... the code claims version 123.2 in the properties though]

Anyway, the industry disconnection is definitely not consistent, but is network-wide when it happens. The issue can happen at any date; after it occurs, if I reload a recent prior save, and then continue, the issue may recur at a later game date. I can't see a rhyme or reason that corerlates in player actions - I might build vehicles, add or alter lines (recently only been working on mail/passenger networks), or just scroll around and look in info. What i can say is that it is not related to anything changing in the industry traffic networks, as those have been untouched.
Passenger connections remain unaffected when the industry disconnect happens - but we know that this is managed by a completely different mechanism, so that is expected.

You might say that really, if this worries me, I should just play passenger & mail. But of course at this date, transport was primarily about the goods & that is where a lot of revenue is to be made (and mixed traffic networks provide the best use of infrastructure!).
Anyway, if anyone has any idea & time to examine why it happens, please do, it would be very welcome. Thank yuo for akll the effort, I wish my coding skills were anywhere near up to helping.
TBH I am looking forward to building properly signalled rail networks (signalling's my particular interest) using the lovely (mostly) prototypical methods now possible, when we have a stable environment to do it in.

jamespetts

Quote from: merry on October 16, 2024, 12:34:53 PMSo life & work was crazy (in a good way) for months, and i've just come back to see how Simutrans is working now.

Thanks to all who've put in so much work on this and other issues.

So it seems that James' statement above is quite correct.
On the bright side, it seems now stable and doesn't crash...
...unfortunately in the recently downloaded 123.2 build 14.23 nightly 9 Oct 2024 the loss of connections still occurs :-(
[confusingly, the 'history.txt' file in the program folder in inconsistent, & refers to 124.0/r11164 5-May-2024, and has a later line above too... the code claims version 123.2 in the properties though]

Anyway, the industry disconnection is definitely not consistent, but is network-wide when it happens. The issue can happen at any date; after it occurs, if I reload a recent prior save, and then continue, the issue may recur at a later game date. I can't see a rhyme or reason that corerlates in player actions - I might build vehicles, add or alter lines (recently only been working on mail/passenger networks), or just scroll around and look in info. What i can say is that it is not related to anything changing in the industry traffic networks, as those have been untouched.
Passenger connections remain unaffected when the industry disconnect happens - but we know that this is managed by a completely different mechanism, so that is expected.

You might say that really, if this worries me, I should just play passenger & mail. But of course at this date, transport was primarily about the goods & that is where a lot of revenue is to be made (and mixed traffic networks provide the best use of infrastructure!).
Anyway, if anyone has any idea & time to examine why it happens, please do, it would be very welcome. Thank yuo for akll the effort, I wish my coding skills were anywhere near up to helping.
TBH I am looking forward to building properly signalled rail networks (signalling's my particular interest) using the lovely (mostly) prototypical methods now possible, when we have a stable environment to do it in.
Thank you for the feedback - sorry that you are still having trouble.

Bugs like this are especially difficult to track down, as, without a reliable reproduction case, there is no way that is not unrealistically time consuming for a spare time developer to understand how the problem arises.

For personal reasons, largely connected to much delayed home renovations, I have not had an opportunity to work much on the Simutrans-Extended code in recent months.

However, it is always good to see a fellow signalling enthusiast!
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.

merry

Hi, I have more information.

Whilst paused, I built railway track, including some road network changes, terraforming and bridges.
Immediately before, connections were in place. After building but still paused, *all* connections were missing.
A slight extra variable was that some road edits/terraforming in a city required the 'cheat' of switching to Public Service player for a short time, to remove a few roads that were otherwise not possible, and back to Default player.
No trains were built, might have built a depot.

What the above suggests is that the problem of disappearing connections is not related to the 'running' of the game clock (no game time passed), but to changes in the networks or map.
Hope this helps anyone who looks into it!

@Jamespetts I also rarely have time to play, mostly due to work. I'm also a heritage absolute block signalman (and have a general interest in the subject). Your AB implementation is pretty good, with (of course) necessary simplifications to make it work automatically & simply, e.g. you ignore the concept of 'clearing point' & don't worry about things like blocking back! Which is no big deal when all drivers obey signals accurately all the time :-)