Rail Logistics Dispatcher

by Viidi

Adds a dispatcher (building) to automate railway logistics based on provide and request stations. Has intuitive interface. Was inspired by LTN but went a different way.

Content
a month ago
1.1 - 2.0
4.36K
Logistics Trains

g Frame drop when closing the dispatcher

a month ago

Hi mate,

At the moment, we have a mid-game save, but I can’t remember when the issue first started.
We’re playing on a dedicated server, so everyone is a client.

There’s no problem when opening the dispatcher, but when closing it or pressing the "Apply" button, all players experience a brief frame drop. The average FPS drops is 60 to 52 for less than a second.

It’s a bit annoying, which is why I’m reaching out here, maybe there’s a solution I’m unaware of.
If you'd like to take a look, here’s the save:
https://drive.google.com/file/d/1TMcf7tWLN4sSf2unk3REWi2rhFzGFb7r/view?usp=sharing

Thanks :)

a month ago

Hi.

First, try disabling "Save interrupts (hack)" in the mod settings. During delivery, train interruptions will be removed (due to a Factorio API flaw) and restored only at the depot, but the freezes should stop.

a month ago

That option is already disabled. The frame drop occurs only when applying or exiting the dispatcher, and the issue persists even when no trains are running. When I open the dispatcher at a station and click 'Apply' or the 'X' button, the frame rate drops to 53 for all connected players.

a month ago

Very strange. I looked at the sent save, the problem was reproduced locally too. I found the cause of the freeze and will fix it one of these days.

a month ago

Wow, very nice! :D I’m looking forward to the patch! Thank you for your time!

a month ago

Unfortunately, this bug seems to be getting worse, with the frame rate drop now around 47 fps. Could it be that the bug intensifies with each station I place down? You mentioned that you found the cause of the freeze, could you explain? I'm curious to know more.

a month ago

Hi. I tried to fix the problem in 2.0.24. Please check it thoroughly before overwriting the save game (or better yet, don't overwrite it at all), because I did it very quickly - not enough time, unfortunately.

a month ago

I’m going to backup my save and test it intensively for you. I’ll make a report here. Thanks! :)

a month ago

Okay, it seems to be working really well. I tested it in multiplayer with my friends, and both of us were spamming 'Apply' without any crashes. We ran many tests, changed values, and checked our factory to ensure all the trains were functioning properly, and no crashes occurred.

However, there is one issue, though it’s unrelated to the topic of this thread. When you deconstruct a dispatcher (and also the train stop) while a train is waiting to be emptied, if you cancel the deconstruction, a crash will happen. The only way to reproduce this is by having a train waiting to unload—like when buffer chests are full, and the train can’t discharge. At that point, deconstruct both the dispatcher and the train stop, then cancel the deconstruction.

The problem is that I don’t understand why I can’t reproduce it every time. However, I can reproduce it consistently at two specific stations, which is why I’m sharing again my save file with you. When you load into the save, the character will be near the two stations where the bug occurs.

This isn't an urgent bug, so don’t worry about it.

Save file: https://drive.google.com/file/d/1SLMntOzE-B3U_54boRz79iuwdLNe100V/view?usp=sharing

The error:

The mod Rail Logistics Dispatcher 2 (2.0.24) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event RailLogisticsDispatcher::on_cancelled_deconstruction (ID 25)
RailLogisticsDispatcher/script/entity.lua:40: attempt to index local 'disp' (a nil value)
stack traceback:
RailLogisticsDispatcher/script/entity.lua:40: in function 'dispUpdateStop'
RailLogisticsDispatcher/script/entity.lua:631: in function 'entityHandleBuiltStop'
RailLogisticsDispatcher/script/entity.lua:660: in function 'entityHandleBuilt'
RailLogisticsDispatcher/control.lua:112: in function <RailLogisticsDispatcher/control.lua:103>

New response