Train counter
Moderator: OpenTTD Developers
Train counter
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?
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?
-
- Tycoon
- Posts: 1534
- Joined: 14 Mar 2006 12:46
- Location: Netherlands
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)
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)
- Attachments
-
- screenshot
- waypoints.png (36.29 KiB) Viewed 13630 times
-
- waypoint stats 2.diff
- patch/diff file
- (11.41 KiB) Downloaded 392 times
Nice feature . Would love to see it in the nighlies or at least in the IN.
OTTDCoop NewGRF Pack|Different sets of GRFs for TTDPatch (some of them work in OTTD) - 1|- 2|GRF sets for OTTD|OTTD nightly
I hooked up my accelerator to my brake lights. I hit the gas, people behind me stop, and I'm gone.
Understeer is when you hit the wall with the front of the car. Oversteer is when you hit the wall with the rear of the car. Horsepower is how fast you hit the wall. Torque is how far you take the wall with you. Spoilers and bodykits are how much of the wall you take with you. Rollcages and windownets are how much of a mess you leave on the wall.
I hooked up my accelerator to my brake lights. I hit the gas, people behind me stop, and I'm gone.
Understeer is when you hit the wall with the front of the car. Oversteer is when you hit the wall with the rear of the car. Horsepower is how fast you hit the wall. Torque is how far you take the wall with you. Spoilers and bodykits are how much of the wall you take with you. Rollcages and windownets are how much of a mess you leave on the wall.
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
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
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.
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.
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.
What I am thinking before, how many train pass here need two one-direction rail? Now, that information can give digi to measure it.
Play TT,TTD for more than 10 years. Now is OTTD
The best PC game I played.
The best PC game I played.
Nice revise. I left it out of the saving function, since such stats are not really needed to be saved.peter1138 wrote: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
The window size, yeah something what can be changed.
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?
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?
-
- Traffic Manager
- Posts: 175
- Joined: 19 Jan 2004 17:25
- Location: kotka or Savitaipale, Finland
- Contact:
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...
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...
-
- Engineer
- Posts: 34
- Joined: 14 Sep 2004 20:54
- Contact:
-
- Engineer
- Posts: 64
- Joined: 10 Jan 2006 15:57
Sounds good, but it would need some fuzzy logic.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...
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.
swing on the spiral
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.
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.
- Attachments
-
- picture
- Harzdorf Transport, 16th Dec 1950.png (27.67 KiB) Viewed 13317 times
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)
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)
- Attachments
-
- harzdorf_transport_16th_dec_1950_136a.png (46.8 KiB) Viewed 13311 times
-
- Traffic Manager
- Posts: 175
- Joined: 19 Jan 2004 17:25
- Location: kotka or Savitaipale, Finland
- Contact:
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.
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.
- Attachments
-
- keke.png
- mockup about the most complex idea...
- (252.16 KiB) Downloaded 415 times
Who is online
Users browsing this forum: No registered users and 20 guests