TL;DR
Community needs possibility to exclude leaving train from Train Count in train stop, but default behaviour includes leaving train. It breaks a lot of ideas for smart train systems. So need to exclude leaving train from Train Count or support both variants via "Include leaving" or "Exclude leaving" checkbox for example.What?
There are 2 ways:1. Low priority: add new checkbox in "Read train count" section which allows to have both possibilities to count trains with leaving train and without leaving train. Check image in first comment.
2. High priority: remove leaving train from "Train count" in default behaviour. I think including leaving train is useless. Explanation of my opinion is below in "Why" section.
UPD: IMPORTANT MOMENT, for both realizations, leaving train should not be counted accurate at the same moment, when Train ID disappear from "Read stopped train". In other words, first frame: you have Train ID - 1234 and leading Train count - 4 on first station and leading Train count - 0 on second station, second frame: you have empty Train ID and leading Train Count - 3 on first station and leading Train Count - 1 on second station, where this leaving train leads.
Why?
This idea was already discussed in this bug topic: viewtopic.php?t=123091But it was created as bug and was closed by Moderator with result "Works as intended, you can make suggestion".
This is suggestion.
Me and other players (from bug topic) wants to create smart train system based on "Train count" feature.
Below is description of my smart train system:
What we have:
- My base is planned as city blocks
- All train stops in city blocks are connected to one global circuit network based on radars
- All trains have only 1 permanent station (Depot) in there schedule and have 2 interraptions: 1 interraption for fuel and 2 interraption for cargo delivering (or fluid delivering for another train group).
- Cargo interration works next way: it adds 2 temporary stations to schedule, first for loading and second for unloading
- This system allows to not link trains directly to 2 stations. You can have only 2 train groups: first for cargo, second for fluid. So one cargo train can transfer different goods, according requests in global network.
How my smart train system works:
1 step - Start:
- There is iron ore mine, in the text will be "Mine"
- There is iron plate foundry, in the text will be "Foundry"
- Foundry block is just connected to network and requests 4 trains with iron ore. Also this requests set train limit for train stop.
- So we have 4 requests for iron ore in global circuit network. It's OK.
2 step - Getting request and leading to mine:
- Train in Depot see this requests and interraption is triggering and train gets 2 temporary station: loading on mine, unloading on foundry
- Train leading to mine
- Leading train affects on circuit logic on mine, which decrease global requests for iron ore by "Train count" feature in mine train stop.
- It becomes 3 requests in global network, because we have 4 (from foundry) minus 1 (trains leading to mine from "Train count")
- Train loading iron ore. It's still 3 requests = 4 - 1. It's OK.
3 step - Leaving mine and leading to foundry:
- Leading train affects on circuit logic on foundry, which decrease global requests for iron ore by "Train count" feature in iron plate train stop.
- And there is a big critical problem related to "Train count" behaviour.
- While train leaving mine train stop it is STILL counted on mine train stop and it is ALREADY counted on foundry train stop.
- It should be 3 requests in global network = 3 (foundry requires 4 trains minus 1 leading train to foundry from "Train count").
- Leaving train should not affect global requests for iron ore because it's already counted as leading train on iron plate station. BUT IT AFFECTS! We have extra decreased request.
- We have absurd situation, when single train counted 2 times!
- In fact we have 2 requests in global network = 3 (foundry (4 requests - 1 leading to foundry)) - 1 (leaving from mine). It's not OK!
4 step - Leaved mine and leading to foundry:
- Leading train affects on circuit logic on foundry, which decrease global requests for iron ore by "Train count" feature in iron plate train stop.
- We have 3 requests (foundry (4 requests - 1 leading to foundry)).
- Train unloading iron ore. It still 3 requests = 4 - 1. It's OK.
- Now foundry requres and requests only 3 trains with iron ore.
5 step - Leaving foundry and leading to mine:
- Leading train affects on circuit logic on mine, which decrease global requests for iron ore by "Train count" feature in mine train stop.
- And there we have the same critical problem!
- While train leaving foundry train stop it is STILL counted on foundry train stop and it is ALREADY counted on mine train stop.
- It should be 2 requests in global network = 3 (foundry requires 3) - 1 (trains leading to mine)
- But in fact we have only 1 request as the same single train counted 2 times! It's not OK!
In general I think it's clear how my system works.
And if you have only 1 request from foundry you can get -1 (negative) request during leaving train station. Which can lead to train system bugs.
In general my system works, but sometimes I catch some bugs. But smart train system of other players may be more sensitive to this issue.
So for correct system work I just need to have possibility for exlcusion leaving train from "Train count".
Let check discussion from original bug topic:
1. bountygiver wrote:
I totaly agree with him. It's obvious behaviour!- What did you expect to happen instead? It might be obvious to you, but do it anyway!
The train count should drop to 0 when the train leaves the station, as per the description it says it outputs the number of train that is coming to the station including stopped trains, which should not include trains leaving the station.
2. Reimerboi wrote:
Exactly what I described in my system! It's base of smart train system. So, if you want to make something similar you will think the same way!I agree with bountygiver.
This seems like a bug.
I'm trying to use the feature to automate the balance of requesting and supplying train stations.
Subtracting one from the requesting train stations whenever a train is en-route to supplying train station.
Then removing the request from the requesting train station when a train is en-route to that station.
3. Reimerboi wrote:
In general my system works, but it works with bugs. Sometimes I catch trains which are stuck on loading train stop, because unloading train stop is closed, because it has 0 requests and it closed by "Train limit" feature.With the feature working as it currently is it's impossible to do this as the train count sums to two, even though only one train is on the tracks.
It's impossible to distinguish a train en-route versus a train blocking the station as the train ID also resets to 0 when the train is leaving.
So, sometime I unstuck in manual mode. Someone can decide that it's impossigle to play this way.
4. Muche provided blueprint where he trying to help with detecting train phases, like leading, entering, loading, departing, leaving, leaved.
I checked this blueprint, using train signals can help to decrease train leaving window from 2 seconds to 0.2 seconds and significantly complicates schema of combinators for each train station and doesn't remove leaving window at all.
So it's not the solution of this problem.
5. Next Nivertius checked Muche's blueprint also and wrote a lot of text with details.
And he found the same result. Using train signals it's not the solution. It has a lot of problems and bugs.
6. Next boskid (moderator) provided screen with example of railway schema as approve that leaving train should be counted.
In my humble opinion, this type of railway planning on screen shows very little experience in Factorio. In fact it's schema of Factorio beginner. Pro and advanced players can make correct railway system with avoiding such trains stucking without included leaving train in "Train Count".
And also, such beginners don't use circuit network yet, they learn base of game and maybe some arithmetic and decider combinators. But not "Train count" logic.
So, my opinion is including leaving train feature is useless for beginner, as they don't use it yet.
And including leaving train feature is also useless for pro players, as it doesn't work as expected for big smart train systems.
As result
I think removing leaving train from "Train count" will be usefull update for big train systems in Factorio.Beginners have possibilities to solve train stucking by updates their railways and more smart base planning without using "Train count" logic at all.
But pro players can't solve their problem with their train system, while leaving train add count to "Train count".
But if you want to keep current behaviour in game, there is option to add additional checkbox like "Include leaving" or "Exclude leaving", where players can switch behaviour what they need.
Thanks a lot for your game!



