0ptera / Logistic-Train-Network

Factorio mod adding logistic network for trains.
Other
155 stars 55 forks source link

LTN Provider station doesn't recognize the new network ID after change from -1 to something else. #326

Closed Ranger203 closed 1 year ago

Ranger203 commented 1 year ago

The scenario is I fill a depot with 1000 materials with the LTN combinator in the Off position with Network ID1. In the off position no signal is sent so LTN sees the train stop as network ID -1. The LTN GUI shows 1000 items available at the station on network -1 to confirm. When I flip the combinator to the ON position for Network ID 1 ( or 2 or 4 or 8 for example) a provider the LTN still registers the old values in the LTN GUI for for network -1, and Not network ID 1. After a train picks up and leaves, it is still seeing it as Networ ID -1.

0ptera commented 1 year ago

Is that bug report for LTN or LTN Manager?

PS: Depots store trains not materials.

Ranger203 commented 1 year ago

By depot I meant a PYanodon’s depot. So I should have used the words “some chest connected via green circuit to an LTN combinator”.

Great question. I’m not sure the rest. I open LTN manager and it reports the train station has materials available on network -1, when I switched the combinator to Network 1 and waited at least two minutes to make sure refreshes happened.

0ptera commented 1 year ago
  1. Load a save before the issue
  2. Enable debug logging in LTN options
  3. Reproduce the issue
  4. turn off debug logging and close Factorio
  5. Attach factorio-current.log and also post stop an train names
Ranger203 commented 1 year ago

Good news. Waiting long enough seems to have cleared up the issue (Latex screenshot). I am not sure if it is because of the mega base (2800 stations) but waiting 5 minutes did not solve the issue, but it looks like it has (Latex -1 screenshot). I will run the debug so you can see. standby.

Latex -1 Latex

Ranger203 commented 1 year ago

Enabled Debug Logging. Settings before turning on:

image

Station Name is "Oxygen Provider 3 (Electrolysis Square)"

image

Enabled, then waiting 5 minutes......

Sending Signals according to Green wire off the light: image

Ranger203 commented 1 year ago

Waited 5 minutes and same result: image

I'm sure if I wait longer it will fix itself like the others. Debug attached. factorio-current.zip

0ptera commented 1 year ago

Thanks, I See nothing wrong with the log.

LTN updated "Oxygen Provider 3 (Electrolysis Square)" from NetworkID 0xffffffff to 0x1 the next cycle after a Delivery "Oxygen Provider (Pressurized Hydrogen)" >> "Oxygen Requester (Plastic Plant)" was created.

One cycle took around 1600 ticks if your game runs at 1x speed that'd be 27seconds. LTN Manager should've updated one cycle later.

The only potential issues I can see is having lots of stops neither providing nor requsting and around 100 open requests at all times.

To improve performance:

  1. remove unused stops
  2. try to spread LTN load better by increasing "Updates per tick" to 3 or 4 while keeping "Update frequency (ticks)" at 1 This has a huge impact on how LTN queues up stop and delivery updates, so monitor changes carefully
Ranger203 commented 1 year ago

Thank you. Will do.