Train counter

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

scatan
Engineer
Engineer
Posts: 7
Joined: 28 Mar 2006 19:22

Train counter

Post 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?
ZxBiohazardZx
Tycoon
Tycoon
Posts: 1534
Joined: 14 Mar 2006 12:46
Location: Netherlands

Post by ZxBiohazardZx »

what is the use in knowing how much trains passed?
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post 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)
Attachments
screenshot
screenshot
waypoints.png (36.29 KiB) Viewed 13630 times
waypoint stats 2.diff
patch/diff file
(11.41 KiB) Downloaded 392 times
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

Nice work. Let's see what would developers say
User avatar
gkirilov
Chief Executive
Chief Executive
Posts: 696
Joined: 03 May 2005 09:32
Location: Othala

Post by gkirilov »

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
Image
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.
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1732
Joined: 30 Mar 2005 09:43

Post by peter1138 »

I'd say, make the window smaller :D

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
sc79
Director
Director
Posts: 586
Joined: 22 Feb 2005 09:51

Post 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.
sopio
Engineer
Engineer
Posts: 39
Joined: 20 Feb 2006 03:34
Location: Shanghai, China

Post 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.
Play TT,TTD for more than 10 years. Now is OTTD
The best PC game I played.
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

peter1138 wrote:I'd say, make the window smaller :D

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
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. :)
Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Post 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).
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post 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?
Nappe1
Traffic Manager
Traffic Manager
Posts: 175
Joined: 19 Jan 2004 17:25
Location: kotka or Savitaipale, Finland
Contact:

Post 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...
Silver-Knight
Engineer
Engineer
Posts: 34
Joined: 14 Sep 2004 20:54
Contact:

Post 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!
tempus_46_2
Engineer
Engineer
Posts: 64
Joined: 10 Jan 2006 15:57

Post 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.
swing on the spiral
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post 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.
Attachments
picture
picture
Harzdorf Transport, 16th Dec 1950.png (27.67 KiB) Viewed 13317 times
Haukinger
Engineer
Engineer
Posts: 110
Joined: 15 Mar 2006 16:38

Post 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)
Attachments
harzdorf_transport_16th_dec_1950_136a.png
harzdorf_transport_16th_dec_1950_136a.png (46.8 KiB) Viewed 13311 times
Nappe1
Traffic Manager
Traffic Manager
Posts: 175
Joined: 19 Jan 2004 17:25
Location: kotka or Savitaipale, Finland
Contact:

Post 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. :)
Attachments
keke.png
mockup about the most complex idea...
(252.16 KiB) Downloaded 415 times
Haukinger
Engineer
Engineer
Posts: 110
Joined: 15 Mar 2006 16:38

Post 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.
User avatar
BeSt-Com
Traffic Manager
Traffic Manager
Posts: 180
Joined: 25 May 2005 18:19
Location: Berlin/Germany
Contact:

Post by BeSt-Com »

would it be possible to show the current number of passing trains in the waypoint-sign?
Jannis
Engineer
Engineer
Posts: 5
Joined: 16 Apr 2006 19:37
Location: Hartsad, Norway

Post by Jannis »

i have dowloaded the train counter but, i don't know how to get it to work?

(My fisrts post :lol: Dont shot me if my english is bad)
[right]Image
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 20 guests