Page 1 of 2
Train counter
Posted: 05 Apr 2006 12:33
by scatan
I know that there's been suggestions concerning signals counting how trains that have passed ubt I think maybe waypoints or something similar could be just as suitable.
My thought is that this would make it possible to place counters on different track in a complex tracksituation to see whether the trains take the routes that was considered when building the track. Without having to constantly check where the trains are going that is.
What do you think? Have you ever wondered if any train has taken that highly improvised improvement you've spent time building?
Posted: 05 Apr 2006 13:22
by ZxBiohazardZx
what is the use in knowing how much trains passed?
Posted: 05 Apr 2006 13:38
by gigajum
i coded that last week, but i'm busy with recode my first patch (replace old bridges without deleting them with new).
I haven't found a thread where someone has requested signals or waypoints to count trains going through at the weekend. And i had no idea what to write, so here it is now
I used waypoints to count trains. signals have the problem that you build much of them, and every statistics need to be saved somewhere. And with a lot of signals you need more memory to save such things. The other question is how to get the saved information displayed.
The waypoints count trains every month, and keep is another month. I think this should be enough. Additionally it counts the highest value ever measured.
I haven't tested this patch enough to say it's bug free.
(Screenshots were made before some changes in the lang files)
(May a mod move this thread to the developer forum)
Posted: 05 Apr 2006 20:16
by MeusH
Nice work. Let's see what would developers say
Posted: 05 Apr 2006 20:55
by gkirilov
Nice feature

. Would love to see it in the nighlies or at least in the IN.
Posted: 05 Apr 2006 21:28
by peter1138
I'd say, make the window smaller
I had already thought of doing this, but never got around to it...
Here's a revamp:
http://195.112.37.102/ottd/waypstats.diff
Posted: 06 Apr 2006 02:20
by sc79
Think thats just the default size, wouldnt bother me either way.
I use non-stop stations for waypoints usually, mainly because its much less work if I need to expand it over multiple tracks later. But I'd really love this for certain situations, especially debugging lost trains and station/junction designs. Nice job.
Posted: 06 Apr 2006 02:24
by sopio
That is really good, that can good to know the traffit in detail. that can help the rail design.
What I am thinking before, how many train pass here need two one-direction rail? Now, that information can give digi to measure it.
Posted: 06 Apr 2006 04:22
by gigajum
Nice revise. I left it out of the saving function, since such stats are not really needed to be saved.
The window size, yeah something what can be changed.

Posted: 06 Apr 2006 12:47
by Moriarty
Nice. How about an average over lifetime too?
Total Number trains been through / Number of months waypoint exists = Average trains per month.
That way you can see if it's just a fluke couple of months or not (Yes I realise you'd have to store another two numbers for each waypoint).
Posted: 06 Apr 2006 13:25
by gigajum
No, it's only one

every waypoint has a build date.
But average trains per month is not needed. I wanted something which checks if my trains use some parts of my railtrack, so that i do not have to watch myself. Due to some parts of track are not uesed every month i decided to record 2 Months.
Well you can make an array out of it, to stor 12,24,36,48,60 ... 2040 months but the question is for what? only to look at?
Posted: 06 Apr 2006 13:55
by Nappe1
actually... I got an idea to make additional patch based on this.
How about another signals that are depending waypoint traffic density?
I mean you could split up one way track to two lanes and train would pickup the one which has less traffic...

Especially with Subsidies patch, this would allow way more trains on same main route. PBS used to serve as same way, but it's not in anymore (or right now) and needs way more processing power than this...
Posted: 06 Apr 2006 16:20
by Silver-Knight
Nappe1 wrote:
How about another signals that are depending waypoint traffic density?
I mean you could split up one way track to two lanes and train would pickup the one which has less traffic...
Now THAT will come in handy.... Excellent feature!
Posted: 06 Apr 2006 17:49
by tempus_46_2
Nappe1 wrote:How about another signals that are depending waypoint traffic density?
I mean you could split up one way track to two lanes and train would pickup the one which has less traffic...

Especially with Subsidies patch, this would allow way more trains on same main route. PBS used to serve as same way, but it's not in anymore (or right now) and needs way more processing power than this...
Sounds good, but it would need some fuzzy logic.
It would just split trains to alternating paths. For example, both counters at 0, the train would go to wp1. The next train would go to wp2, since the counter for wp1 is higher. Then they would be equal, so the next train would go to wp1. Then the next train... yeah you see the pattern.
I love the idea of trains choosing the less busier path, but I don't see how these cool counting waypoints could acheive it. Anyone?
Ok, just thought, if you were to have many counters on a line with many junctions, then maybe it could be feasible. If a train enters a junction and has a choice of two lines, it would add up the total of the counters along the line, else you would just have the first scenario, alternating trains. But the question is, how many counters to add? The whole network, or to the end of the line, or what?
Man, I went off on a tangent. It's late and I'm rambling, sorry.
Posted: 07 Apr 2006 06:44
by gigajum
The question is take which waypoint to ge the information you want. Using 2 Waypoints after 2 exit signals (waypint #1 and #2 on pic) is not hard to code (maybe i'm wrong, need to look at the signal code and realize how it works).
But what if the track layout looks like waypoint #3 on picture? The first waypoint (waypoint #2) does not count tracks coming through waypoint #3. So the track with waypoint #2 and #3 can have more load then the track with waypoint #1.
I could continue with examples....
But i think perfect load balance is not possible. Neither with signals nor waypoints counting trains.
Posted: 07 Apr 2006 07:02
by Haukinger
You have to move Waypoint2 to a little to the upper left. Those traffic-monitors must be in spots with the maximum traffic on the track. Or better the part of the network that trains at the signal are going.
It might be a bit harder to choose the correct waypoint for a traffic-monitoring-signal, so I suggest to either make link-waypoints (a waypoint directly behind the signal, reading "see Waypoint3" if "Waypoint3" is the actual monitoring waypoint) or waypoints named with signal-positions (waypoint "0x1234/0x4567" would be control the signal state of the signal in tile 0x1234/0x4567)
Posted: 07 Apr 2006 07:47
by Nappe1
Waypoint for this split feature is a bit bad choice because orders do not support branching. Still,you don't need to put that waypoint to orders to get it count the train going thru it, do you?
Still, using waypoint as just "dummy counter" for controlling some signals may cause confusion for users.
you could make things even more efective using global counters that user could select which increment on that checkpoint. This would allow two entraces to same section of track count total numbers of trains.
... or why not take it even further with global counters?

if you have two closed sections of track, like 2 same way going lanes, you could make increase counter point in input sections and decrease counter point in output sections and the signals would direct the train on lane that has less trains going on on that moment.

Posted: 07 Apr 2006 09:12
by Haukinger
I like this.

Make the counters float, so you can add 1/reliability instead of 1 for each train passing a increase-waypoint. So a train which is likely to break down makes it's lane less attractive for other trains than one which won't break down.
Posted: 10 Apr 2006 07:20
by BeSt-Com
would it be possible to show the current number of passing trains in the waypoint-sign?
Posted: 16 Apr 2006 19:42
by Jannis
i have dowloaded the train counter but, i don't know how to get it to work?
(My fisrts post

Dont shot me if my english is bad)