Giter VIP home page Giter VIP logo

logistic-train-network's Introduction

logistic-train-network's People

Contributors

0ptera avatar 71e6fd52 avatar aulbach avatar duskwuff avatar eduran84 avatar glointhedark avatar harag-on-steam avatar mrvn avatar quezler avatar rockstar04 avatar shanemadden avatar snouz avatar stephansteinert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

logistic-train-network's Issues

Constant signal when train is ready for loading

I just made a rather fancy station by using a bunch of combinators that I'm pretty happy with. However, it uses the fact that the lamp stops being yellow to reset it's counter, which is not optimal. So I was wondering, could you have a "train at station" signal in the output? Not just the composition, but a constant signal that's equal for all trains?

Request: Add signal to identify LTN controled trains & if they are loading or unloading

I could use a signal at the train stop to indicate if the train currently halting is controlled (i.e. was planned) by the LTN as opposed to a player-controlled train, as I often use manually planned, automatic travel to reach far away outposts.

In addition to that I'd welcome an (easy) way to differentiate between an LTN-train there for loading or unloading.

Signal-wise I imagine this could be represented as either two binary signals (LTN/not-LTN and loading/unloading) or perhaps a three state signal with 1: LTN & loading, -1: LTN & unloading, 0: not-LTN.

What is your opinion on this? Btw. thank you for this great mod.

Fluid unloading incomplete due to rounding error

Due to the rounding behaviour of vanilla combined with fluidcount times 10 since 0.15 it happens quite often that a fluid train leaves its unloading station with a small residue (about 0.2 - 0.5) still in its car.
In my case reducing the possible load capacity by factor 2 because the LCCL train alternates between two different sources (gas and oil). This leads to 1 car not being usable at either station because it has a small amount of the other fluid in it.

My crude fix for now: control.lua, line 687, insert in front of "if finish_loading then":

if countOverride == 0 then --unload
record.wait_conditions[#record.wait_conditions+1] = {type = "inactivity", compare_type = "and", ticks = 60 } --wait 1 second, probably 30 ticks are enough, 15 were not
end

Effectively the same as "finish_loading" but for unloading only.

game crashes when train with fluid wagons arrive at LTN depot station in 0.16.7

16152.884 Script @LogisticTrainNetwork/control.lua:367: (TrainLeaves) train.id:162 wasn't found in global.StoppedTrains
16200.334 Script @LogisticTrainNetwork/control.lua:367: (TrainLeaves) train.id:162 wasn't found in global.StoppedTrains
16230.338 Script @LogisticTrainNetwork/control.lua:367: (TrainLeaves) train.id:162 wasn't found in global.StoppedTrains
16264.997 Script @LogisticTrainNetwork/control.lua:367: (TrainLeaves) train.id:162 wasn't found in global.StoppedTrains
16316.076 Script @LogisticTrainNetwork/control.lua:367: (TrainLeaves) train.id:162 wasn't found in global.StoppedTrains
16344.599 Script @LogisticTrainNetwork/control.lua:367: (TrainLeaves) train.id:162 wasn't found in global.StoppedTrains
16379.506 Script @LogisticTrainNetwork/control.lua:367: (TrainLeaves) train.id:162 wasn't found in global.StoppedTrains
16380.286 Error MainLoop.cpp:1013: Exception at tick 19137085: Error while running event LogisticTrainNetwork::on_train_changed_state (ID 23)
Passed index is out of range.
stack traceback:
LogisticTrainNetwork/control.lua:1746: in function 'getWagonCapacity'
LogisticTrainNetwork/control.lua:1761: in function 'GetTrainCapacity'
LogisticTrainNetwork/control.lua:343: in function 'TrainArrives'
LogisticTrainNetwork/control.lua:459: in function <LogisticTrainNetwork/control.lua:456>
16380.286 Error ServerMultiplayerManager.cpp:95: MultiplayerManager failed: "Error while running event LogisticTrainNetwork::on_train_changed_state (ID 23)
Passed index is out of range.
stack traceback:
LogisticTrainNetwork/control.lua:1746: in function 'getWagonCapacity'
LogisticTrainNetwork/control.lua:1761: in function 'GetTrainCapacity'
LogisticTrainNetwork/control.lua:343: in function 'TrainArrives'
LogisticTrainNetwork/control.lua:459: in function <LogisticTrainNetwork/control.lua:456>"
16380.286 Info ServerMultiplayerManager.cpp:696: mapTick(19137085) changing state from(InGame) to(Failed)
16380.300 Info GlobalContext.cpp:661: Waiting for child processes to exit:
16380.583 Info ServerMultiplayerManager.cpp:141: Quitting multiplayer connection.
16380.583 Info ServerMultiplayerManager.cpp:696: mapTick(4294967295) changing state from(Failed) to(Closed)
16380.585 Info UDPSocket.cpp:206: Closing socket
16380.586 Info UDPSocket.cpp:236: Socket closed

Please allow negative priority (1.4.11)

In 2c54b0b you disregard negative signals, including priorities.

I've been using negative priorities to allow me to deprioritize a utility provider. To take a specific example of empty barrels, most of my stations don't specify a priority. A single provider exists that creates and supplies new barrels and has a priority of -1. This means that barrels are when possible taken from regular stops, only taking from the utility provider if there are none available - worked great. The other solution is to explicitly specify a provider priority at all my stations that provide barrels (by emptying them), so that it can be higher than the utility station.

This commit will prevent that from working. Please consider allowing negative priority.

Change license to less permissive version

Hello @Yousei9,

your currently license wouldn't allow to redistribute your mod with slight modifications (e.g. if someone would want a feature you dislike and would like to use most of your code etc.).

Would it be possible to change the license in such a way that redistribution of your mod with modifications is allowed without explicit permission?

Cheers,
~ Victor

Index out of range

Map Version: 0.16.7-4
Mods:

  • LogisticTrainNetwork 1.6.1
  • base 0.16.7
  • creative-mode-fix 0.0.9

Opening the map (attached) results in a migration error:

Error while running on_configuration_changed: Passed index is out of range.
stack traceback:
	__LogisticTrainNetwork__/control.lua:1746: in function 'getWagonCapacity'
	__LogisticTrainNetwork__/control.lua:1761: in function 'GetTrainCapacity'
	__LogisticTrainNetwork__/control.lua:219: in function 'updateEntities'
	__LogisticTrainNetwork__/control.lua:287: in function <__LogisticTrainNetwork__/control.lua:271>

Planning Small 16.zip

[1.7.4] Index nil at control.lua:952

13499.440 Error MainLoop.cpp:1019: Exception at tick 8552892: Error while running event LogisticTrainNetwork::on_tick (ID 0) __LogisticTrainNetwork__/control.lua:952: attempt to index local 'stop' (a nil value)

Occurs after mining a logistics train stop that currently is providing goods via a positive input signal.
Removing the circuit connection before mining the stop prevents the crash. From a quick glance at the code, the following code at line 955 checks whether stop is nil, but the call to bit32.band() occurs first and dereferences stop blindly. I can provide a save if desired. Thanks for the great mod!

Error loading virtual signals when using DyWorld

Under Factorio 0.16.45, LTN cannot be loaded whilst the DYWorld mod is also enabled, because of a missing property in the prototype of the virtual signals LTN introduces. (Extended factorio-current dump at the bottom of this issue)

Error ModManager.cpp:1024: Error while loading virtual-signal prototype "LTN-dyworld-stone-locomotive" (virtual-signal): Key "icon_size" not found in property tree at ROOT.virtual-signal.LTN-dyworld-stone-locomotive

Having a look at the source, it looks like the property in question is commented out on line 44 of data-final-fixes.lua. Before I submit a pull request to fix, do any contributors know if it was commented out for a reason? Will restoring the property introduce a more subtle bug?


Extended factorio-current dump

   0.166 Device reset internal.
   0.169 Desktop composition is active.
   0.169 Graphics settings preset: very-high
   0.170 Graphics options: [Graphics quality: high] [Video memory usage: high] [Light scale: 25%] [DXT: false] [Shader: 1]
   0.170                   [Parallel sprite loading: 1] [Max texture size: 0/8192] [Bmp cache: 0] [Sprite slicing: 1] [Low quality rotation: 0]
   0.368 Loading mod settings DyWorld 0.6.5 (settings.lua)
   0.368 Loading mod settings LogisticTrainNetwork 1.7.7 (settings.lua)
   0.376 Loading mod core 0.0.0 (data.lua)
   0.436 Loading mod base 0.16.45 (data.lua)
   0.844 Loading mod DyWorld 0.6.5 (data.lua)
   1.180 Loading mod LogisticTrainNetwork 1.7.7 (data.lua)
   1.520 Loading mod base 0.16.45 (data-updates.lua)
   1.816 Loading mod DyWorld 0.6.5 (data-updates.lua)
   2.333 Loading mod DyWorld 0.6.5 (data-final-fixes.lua)
   2.711 Loading mod LogisticTrainNetwork 1.7.7 (data-final-fixes.lua)
   2.715 Script @__LogisticTrainNetwork__/data-final-fixes.lua:110: [LTN] found 1747 items, 56 fluids, 26 locomotives, 3 wagons
   3.070 Checksum for core: 2616611262
   3.070 Checksum of base: 2290967896
   3.070 Checksum of DyWorld: 2882425988
   3.070 Checksum of LogisticTrainNetwork: 2620749778
   3.569 Error ModManager.cpp:1024: Error while loading virtual-signal prototype "LTN-dyworld-stone-locomotive" (virtual-signal): Key "icon_size" not found in property tree at ROOT.virtual-signal.LTN-dyworld-stone-locomotive
Modifications: LTN - Logistic Train Network
   3.702 Loaded shader file D:/Program Files (x86)/Steam/steamapps/common/Factorio/data/core/graphics/shaders/game.cso
   3.704 Loaded shader file D:/Program Files (x86)/Steam/steamapps/common/Factorio/data/core/graphics/shaders/zoom-to-world.cso
   3.705 Loaded shader file D:/Program Files (x86)/Steam/steamapps/common/Factorio/data/core/graphics/shaders/alpha-mask.cso
   3.707 Initial atlas bitmap size is 16384
   3.708 Created atlas bitmap 192x5 [none]
   3.708 Created atlas bitmap 132x24 [no-crop, trilinear-filtering, icon, light]
   3.746 Sprites loaded
   3.746 Convert atlas 132x24 to: trilinear-filtering
   3.753 Custom inputs active: 0
   3.755 Factorio initialised
   3.757 Mods to disable:Failed to load mods: Error while loading virtual-signal prototype "LTN-dyworld-stone-locomotive" (virtual-signal): Key "icon_size" not found in property tree at ROOT.virtual-signal.LTN-dyworld-stone-locomotive

Factorio desynch on connect with LTN enabled

we're late stage in a multiplayer game and after stopping to play yesterday (we expanded the base, nothing out of the regular) now all of a sudden only 1 player can concurrently connect/play.

tried with headless hosted server, only 1 player could connect.
tried with normal windows game client hosting, no player could connect.
according to the log, the disconnect happens due to a failing CRC check

34.522 Error GameActionHandler.cpp:2676: Multiplayer desynchronisation: crc test (heuristic) failed for crcTick(18621407) serverCRC(880134861) localCRC(1558050798)

we enabled/disabled all other mods and nailed the problem down to LTN.

  • if we play without any mods, the map works
  • if we play with any other mods, the map works
  • only basemod+LTN enabled --> desync

we really love the mod and don't want to continue without it! :)

we documented one setup: both players on windows, hosting a normal multiplayer game.
all mods disabled besides LTN, the player disconnected with desynch

client desync report: https://drive.google.com/drive/folders/1BiGaEdoL0QtQJv4owsluEfzKgYoKuK3j
only the log file: https://drive.google.com/file/d/1N_Ch-68QzqMwDDb3DcyVF7US0O8IIkJI/view

server log

 171.719 Info ServerRouter.cpp:409: Replying to connectionRequest for address(IP ADDR:({77.56.208.212:51261})).
 171.719 Info ServerSynchronizer.cpp:557: nextHeartbeatSequenceNumber(434) adding peer(1)
 171.751 Info ServerMultiplayerManager.cpp:699: mapTick(18613662) changing state from(InGame) to(InGameSavingMap)
 171.802 Info ServerMultiplayerManager.cpp:795: mapTick(18613662) received stateChanged peerID(1) oldState(Ready) newState(ConnectedWaitingForMap)
 173.178 Info ServerMultiplayerManager.cpp:855: MapTick(18613662) Serving map(C:\Users\vossi\AppData\Roaming\Factorio\temp\mp-save-0.zip) for peer(1) size(25640924) crc(961567700)
 173.178 Info ServerMultiplayerManager.cpp:699: mapTick(18613662) changing state from(InGameSavingMap) to(InGame)
 173.285 Info ServerMultiplayerManager.cpp:795: mapTick(18613669) received stateChanged peerID(1) oldState(ConnectedWaitingForMap) newState(ConnectedDownloadingMap)
 188.134 Info ServerMultiplayerManager.cpp:795: mapTick(18614560) received stateChanged peerID(1) oldState(ConnectedDownloadingMap) newState(ConnectedLoadingMap)
 190.484 Info ServerMultiplayerManager.cpp:795: mapTick(18614701) received stateChanged peerID(1) oldState(ConnectedLoadingMap) newState(TryingToCatchUp)
 190.551 Info ServerMultiplayerManager.cpp:795: mapTick(18614705) received stateChanged peerID(1) oldState(TryingToCatchUp) newState(DesyncedWaitingForMap)
 190.551 Info ServerMultiplayerManager.cpp:872: mapTick(18614705) received playerDesynced peer (1)
 190.567 Info ServerMultiplayerManager.cpp:699: mapTick(18614705) changing state from(InGame) to(InGameSavingMapForDesyncReport)
 199.201 Info ServerMultiplayerManager.cpp:855: MapTick(18614705) Serving map(C:\Users\vossi\AppData\Roaming\Factorio\temp\mp-save-1.zip) for peer(1) size(104135349) crc(767865006)
 199.201 Info ServerMultiplayerManager.cpp:699: mapTick(18614705) changing state from(InGameSavingMapForDesyncReport) to(InGame)
 199.319 Info ServerMultiplayerManager.cpp:795: mapTick(18614712) received stateChanged peerID(1) oldState(DesyncedWaitingForMap) newState(DesyncedCatchingUpWithMapReadyForDownload)
 199.319 Info ServerMultiplayerManager.cpp:795: mapTick(18614712) received stateChanged peerID(1) oldState(DesyncedCatchingUpWithMapReadyForDownload) newState(DesyncedSavingLocalVariantOfMap)
 208.285 Info ServerMultiplayerManager.cpp:795: mapTick(18615250) received stateChanged peerID(1) oldState(DesyncedSavingLocalVariantOfMap) newState(DesyncedDownloadingMap)
 268.752 Info ServerMultiplayerManager.cpp:795: mapTick(18618878) received stateChanged peerID(1) oldState(DesyncedDownloadingMap) newState(DesyncedCreatingReport)
 275.485 Info ServerMultiplayerManager.cpp:901: Disconnect notification for peer (1)
 275.485 Info ServerMultiplayerManager.cpp:795: mapTick(18619281) received stateChanged peerID(1) oldState(DesyncedCreatingReport) 

Requester stations turn into provider stations

Hi,
I'm facing an issue in my game where a station I've set up to request some item, starts providing that item - so trains come to that station waiting to be loaded, but of course that never happens, since I only have unloading inserters there :)

I do have a decider combinator that makes sure only negative counts are ever emitted to the station input signal.

However, here's a log from the game:

8044.341 Script interface.lua:46: [LTN] (UpdateStop) Simple smelting.in(quartz)[1] updating requested count with delivery: item,quartz -101138 + 64000
8044.341 Script interface.lua:46: [LTN] (UpdateStop) Simple smelting.in(quartz)[1] updating requested count with delivery: item,quartz -37138 + 64000
8044.341 Script interface.lua:46: [LTN] (UpdateStop) Simple smelting.in(quartz)[1] updating requested count with delivery: item,quartz 26862 + 15857
8044.341 Script interface.lua:46: [LTN] (UpdateStop) Simple smelting.in(quartz)[1] updating provided count with train inventory: item,quartz 42719 - 8060

As you can see, the initial circuit count (-101138) was tipped above 0 by registered incoming deliveries, which made the station register as a provider. I think this all happened in one call of the UpdateStop function, so there's really nothing you can do ingame to prevent that.

I think the logic for deciding whether a station is a provider here: https://github.com/Yousei9/Factorio-LogisticTrainNetwork/blob/master/control.lua#L1373 should not take into account the deliveries that just registered, so perhaps it should simply use the value from the circuit network, before adding incoming deliveries.

Requester Priority

Again, thanks for the awesome mod! Now on to my idea/request:

Set priority of request stations - Higher priority gets delivers first. Why? Because I am tired of plastic going to the circuit factory before batteries, lol. I think it would give us a little more control in where we want materials first. : )

Mixed loading stations - Merged requests never complete

I have a few mixed loading stations that have logistics chests loading into logi train stops. They look like this:
image

Occasionally LTN will merge two orders from these mixed stations (awsome!). Unfortunately the constant combinator dosent update as the train unloads, so it only ever loads the first item and gets stuck waiting forever.

Like This is related to #7, I'm hoping for an easy solution.

If not I'm thinking about PR'ing similar change that uses the polling logic from #7 to change the combinators output every ~30 ticks or so between the items that are still waiting to be loaded.

Thoughts?

Disable warnings for a station?

I think this is not a feature, so this is probably a feature request.
I have stations in my base, that request something odd like uranium rods.
Uranium rods take long to create, and i prefer them to be brought to my nuclear power plant whenever they are ready.
As a result this and a few other of my train stops keep throwing the "NUCLEAR ROD is not available for NUCLEAR STOP" or something along those lines.
I know that this is the case, if this were the iron stops this would be a disaster. But nuclear rods, not so much.

Can we get a signal or command to pass to a stop so it is no longer considered as a chat warning for that specific stop? So it can warn me for ALL other stops, except the few that i know will be throwing the warning but i do not care about.

LTN does not Provide Crotinnium Ore

Hello, we have a MP game running with more then 100 LTN stations right now. Today we tried to add Crotinnium Ore but no trains comming. We store the ore in a Warehouse, but we also tried to use smaller chest, but nothing. Also we triedto provide the ore on

Base Mods we use:
Angels Mod
Bobs Mod

LTN crashes under 0.16.31

screen shot 2018-03-19 at 5 23 58 pm

Posted the bug to the [release thread](https://forums.factorio.com/viewtopic.php?f=3&t=58853) but it hasn't be approved yet.

limit trains by composition signal

There are two kind of trains available to LTN, a 1-1-1 and a 1-2-1.

The target station outputs 5 for encoded locomotive location, but LTN keeps creating the order on a 1-2-1 train, which doesn't match the locomotive locations asked for.

It also created an order on a 1-1-1 afterwards for a target station requesting a locomotive location of 9 and cargo wagon location of 6, which is asking for 1-2-1 trains.

LTN 1.6.1 on Factorio 0.16.10

Feature Request: "Do not provide from this station" signal

I have a mineral processing station which requests various minerals. Sometimes it receives more than it requested and item request signal becomes positive.

When it is positive LTN create some routes to receive these extra items. But there are only unloading inserters in this station so train get stuck waiting in this station.

If there is a signal "Do not provide from this station" It should solve this problem.
I know i could solve this with combinators but this feature would be great.

Supply or Request by distance.

Making possible to make rules to make transport cargo by short or long distances.
I think this is will be great if someone want to make 2 big base, and only long trains will transport between the bases, short trains will stay inside the bases.

Update train inventory storage limit

i changed the size on my cargo wagon while playing, but LTN still use the previous limit and do the same delivery, even the train have free space.

Perhaps LTN just check the limit cargo on the first start on the game?

edit1:just a question
edit2: to be more specific, i changed the inventory_size of cargo wagon from factorio core, and reload my save file.

logging levels

given the amount of spam that logging level 2 generates just from all the route announcement messages i started using logging level 1 with the expectation that now i will only get to error messages like no station found supply resource or train timed out, but given that i havent seen either message after switching to logging level i would say this assumption was wrong. Because of that i would greatly appreciate it when it would be possible to filter out the other lvl 2 messages and still get those errors

When using Noxy's Multidirectional Trains mod, LTN Dispatcher forgets old train state when locomotive is "rotated"

Symptom: LTN dispatcher generates duplicate requests to the max number of trains for a given station (i.e. if a request for 75k crude is needed, and the station can handle up to 4 trains, it will generate 4 trains for the same request).

My hypothesis: When the rear train is rotated, Factorio is "remaking" the train, so it's not technically the same train, and so LTN regenerates the request as it doesn't think any train is assigned.

Latest version of Factorio, LTN, and Noxy's Multidirectional Trains (0.16.30, 1.7.5, 0.0.1 respectively.)

Addendum: I posted this first on their end, and felt they provided an informative reply so figured I'd repost here, with a link to the issue there:

NoxyNixie/Noxys_Multidirectional_Trains#2

small amounts of unwanted items in trains

Hello,

I have ran into a rather small issue with some deliveries, and that is that once in a blue moon a small amount of cargo gets left in the car. Not sure how, but it does, and again this isn't a huge issue since most if not all my stops use filter inserts to unload. But here comes the change I would love to see... Instead of waiting for (example) "Cargo: Iron plate = 0", change it to "Empty Cargo Inventory". This way when it eventually goes to a station needing those random items, but is delivering something else (I lean on having multiple items delivered to a single requesting station) it will wait till they are pulled. I know it is a random issue, but I have not found any work arounds to the problem as of yet. Anyway thanks for the great mod! It is making my train network awesome! No trains not working : )

non localised resource names

Is it possible that the localised name is used instead of the internal one for missing resources, as the internal resource name doesn't really help in most cases

Mixed loading stations - Items left in inserters

I have a few mixed loading stations that have logistics chests loading into logi train stops. They look like this:
image

A bunch of chests wired to the lamp, a bunch of filter inserters wired to the constant output.

The problem is, as you can see in the screenshot, the train leaves while the inserters are still moving, causing many of them to get stuck with an item in the hand. These items get dropped into the next unsuspecting train, which is probably going to pick something different up.

I'm hoping there is an easy fix, if not I was thinking of PR'ing a change that moves the train un/loading logic into the mod, polling every few ticks to see if the conditions were met. If they were met then stop outputting on the constant combinator, wait a few ticks then update the trains route.

train.fluid_wagons and train.cargo_wagons in branch 1.6.2

Hi. I found your new branch for version 1.6.2 on github, because of the getWagonCapacity bug with the fluid wagons.
I just wanted to note that it seems that the variables are turned around for fluid and cargo wagons.
Thanks for your mod! I have fun playing with it.

https://github.com/Yousei9/Logistic-Train-Network/blob/6640684a323de8dfa91b20b73a186151c2c82ac3/control.lua#L1768

for _,wagon in pairs(train.cargo_wagons) do
local capacity = global.WagonCapacity[wagon.name] or getCargoWagonCapacity(wagon)
fluidCapacity = fluidCapacity + capacity
end
for _,wagon in pairs(train.fluid_wagons) do
local capacity = global.WagonCapacity[wagon.name] or getFluidWagonCapacity(wagon)
inventorySize = inventorySize + capacity
end

Mod crashes when i am deconstructing rails

I used drones to deconstruct my depots and got this exception:
Error while running event LogisticTrainNetwork::on_robot_pre_mined (ID 15)
LogisticTrainNetwork/control.lua:689: attempt to index field '?' (a nil value)

I am running version 1.6.2 of the LTN and 0.16.15 of Factorio

Provider priority should not be overridden by the current number of active deliveries

I'm deep in a Bobs+Angels game and I'm trying out the LTN mod. I slowly setting up a full LTN and running some tests, I noticed that I was unable to get my empty barrels to get picked up from my subfactories to get refilled because empty barrels were systematically taken from the barrel factory.

Even when setting a very high provider priority to the station providing empty barrels in the sub factories trains decided to go to the barrel factory. After reading the code, it seems that the number of active deliveries is actually more important than priority (https://github.com/Yousei9/Logistic-Train-Network/blob/master/control.lua#L791). So given that I have a single station providing all the trash (including all empty barrels) in my subfactories, I usually have many active delivery scheduled going through this station.

Bug on non existing items

It looks like there is something unhandled when items get removed, because a mod updated in the meantime while the train was on it's way or something like that.
Here is the error message:

Error while running event LogisticTrainNetwork::on_train_changed_state (ID 23)
Unknown item name: angels-barrel-mineral-sludge
stack traceback:
	__LogisticTrainNetwork__/control.lua:1170: in function 'UpdateTrain'
	__LogisticTrainNetwork__/control.lua:514: in function <__LogisticTrainNetwork__/control.lua:513>

In this case i guess angels-refining mod updated its items. After this error message factorio goes back to the main menu.

"Notice: no station supplying ...." loop

Hi,

Sometimes LTN starts putting no station notices in a loop. I wait for sometime but it doesn't stop.
untitled

I guess it should stop when all requested items create notice. Then it should wait for a time.

Until a patch is live, is there a way to disable this notices?

Failed to load mod after installation of Dectorio

Cannot start the game after adding Dectorio mod. It says:

Failed to load mods: error in assignID, virtual-signal with name 'signal-light-grey' does not exist.

Source: logistic-train-stop-input (lamp)

Is this on your end, or should we create an issue in Dectorio?

"Provide Threshold" seemingly not doing anything

Hi!
I absolutely love the way this mod has developed over the last couple of weeks, and that it has been getting a few more options with which to work with!

One problem I am having is understanding "Provide Threshold" for providing stations though. I have the following problem:

When a station (without either provide or request thresholds set) requests X amount of a material, but the requested amount is below the default threshold of 1000, nothing will happen.
EVEN IF another station is providing the material, with a provide threshold set that is below the amount the station is requesting.

At the same time, however, once I set a request threshold for the requesting station, EVERYTHING gets overridden - both the default thresholds as well as the provide thresholds for the providing stations.

As such, I am a bit confused as to what the provide threshold is used for since it has no apparent function the way I am seeing it right now.

recipe doesn't work when modified by other mod

Hi Yousei9,
I'm modder of hardCrafting and I just experienced a very rare and weird issue :)

Depending on the order of mod loading the recipe for the logistic-train-stop won't contain the correct resulting items (In the case of this issue, just contains normal train-stops which is not usual).

The issue is that hardCrafting modifies the result of the normal train-stop and adds another resulting item: scrap-metal. That means the prototype does not contain .result but rather the .results variable.
If LTN is loaded afterwards it will copy the prototype but not be able to change the result in lib.lua:

function copyPrototype(type, name, newName)
  if not data.raw[type][name] then error("type "..type.." "..name.." doesn't exist") end
  local p = table.deepcopy(data.raw[type][name])
  p.name = newName
  if p.minable and p.minable.result then
    p.minable.result = newName
  end
  if p.place_result then
    p.place_result = newName
  end
  if p.result then
    p.result = newName
  end
  return p
end
return copyPrototype

Can you add a check to make sure the result will also be changed if the recipe uses the .results variable?
I tested it with this fix and it would work:

	if p.results then
		for _,itemTable in pairs(p.results) do
			if itemTable.name == name then
				itemTable.name = newName
			end
		end
	end

Thanks for your help :)

Request: LTN Network ID

I would like to be separate LTN network by some sort of Identifier, Mostly to allow for smaller inside base train logistic (either for one or most LTN networks) and for my longer reaching resources outside my base.

I do not know if this helps PVP scenarios.

Multiple trains claim the same resources when there is not enough resources to satisfy a request

Version: 0.3.2
When there is not enough resources to satisfy demands, multiple trains will claim the same resources.

for example if there is 5000 Steel being requested but only 1000 available, multiple deliveries will be created against the same 1000 steel, leaving many trains trying to load up for a non existent resource.

One possible solution below.

--return name of station with highest count of item or nil
function GetStationItemMax(item, min_count ) 
  local currentStation = nil
  local currentMax = min_count
  for stopID, storage in pairs (global.Dispatcher.Storage) do    
    for k, v in pairs (storage.provided) do      
      if k == item and v > currentMax   then
        local ltStop = global.LogisticTrainStops[stopID]
        if ltStop then
          local outstanding = GetExistingDeliveries(ltStop.entity.backer_name, item);
          if v - outstanding > currentMax and v - outstanding > 0 then
            if global.log_level >= 4 then printmsg("found ".. v .."  ".. k.." at "..ltStop.entity.backer_name) end
            currentMax = v - outstanding
            currentStation = {entity=ltStop.entity, count=v - outstanding, maxTraincars=global.Dispatcher.Storage[stopID].maxTraincars}
          else
            if global.log_level >= 4 then printmsg("found ".. v .."  ".. k.." at "..ltStop.entity.backer_name.. " But it was already claimed") end
          end
        else
          if global.log_level >= 1 then printmsg("Error(GetStationItemMax): "..stopID.." no such unit_number") end
        end
      end
    end --for k, v in pairs (storage.provided) do      
  end
  return currentStation
end


function GetExistingDeliveries(station, item)
  local count = 0
  for _, value in pairs(global.Dispatcher.Deliveries) do
    if value.from == station and value.item == item then
      count = count + value.count
    end
  end
  return count;
end

Multiple Trains going to one requesting train stop.

Hello,

First off - love the mod, it is helping manage my massive train network very well. However I have ran into a small issue. Not a bug necessarily, but a change in function, or an additional option.

Here is the problem: To minimize the number of train stops I need at a remote factory I combine Providers and Requester. Now the problem is when I add a stop that -10,000 of an item, the providers of said items get inundated with several trains (I got 12 depots, with 12 trains), and end up clogging the main line in the area.

To resolve this I would love to see a circuit condition to dictate how many trains can queue up at a provider, or requester station. Thus preventing trains from going to the station if it already has a train planning on going to it.

Again, thanks for the awesome mod, and if you need an image of the issue I am running into let me know.

LTN Research Dependency

Producing a LTN Station requires red chips.
There is one minor problem when playing with 0.15 complex recipes and complex research modes enabled: The LTN research can be done without actually having red chips researched. Thus, you are not able to build it.

I think the LTN research should therefore depend on "Advanced Electronics" (in addition to the existing "Automated rail transportation" dependency) when the above mentioned modes are set.

Fluid wagons being overfilled

I have noticed with my setup i have trains with 2 fluid wagons for delivering various fluids.

when a request is started it states 75000 units but the problem is each fluid wagon now only holds 25k each. i haven't checked in depth yet but it seems it is not taking into account the latest change in fluid wagon capacity

Factorio version 0.16.10
LTN version 1.6.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.