Time Stamp Event

boleyd

Well-known member
Is there a way to time-stamp and event? As an example, I have 10 stations on a route and three trains. I want to know when each train arrives at a station or trackmark. This way I get a good picture of the passenger service and how well it is working. This is needed since AI causes strange multi-second delays that appear to have no logic. Also, once I have a good picture of the passenger service I can then integrate a freight service with object arrival times. But to do this I need to know the time of each arrival or perhaps some intermediate trackmarks.
 
I think what you would need is a rule that records the time, as a variable, each time it is activated and then must be able to store that variable as, possibly, an array for later review. I know of no such rule (but this does not mean the rule does not exist - somewhere).

Alternatively, and this would work but it would be very tedious for you - use triggers, trigger check rule and the message popup rule to immediately report each arrival at a station but you would have to note the time of arrival yourself. With some planning and the use of some session logic (i.e. variables to keep track of trains and events) this could be streamlined but it would be a lot of session programming work using existing rules.
 
It is a bit odd that there is no way to review the timelessness of a route. The on-time TANE-Train is not as important as the actual arrival of the train. True, given that there are some residual logic problems just getting there is the accomplishment.

If I could capture the current time at triggers, trackmarks, etc that would be great. If I were running the railroad and a special had to be run, what is the overall impact of that special and how much do I have to alter the base schedule due to its impact? Or, an engine is late arriving from the shop by 10 minutes. What are the new arrival times and can I make up some time here and there to only impact 25% of the schedule? There are many other contingencies that you could simulate and arrange the schedule to accommodate them - trackwork to landslides..... Someday N3V will introduce real weather - that will be interesting.
 
Last edited:
Hi Dick.

A rule script or a driver command script can easily retrieve either the current game time (current simulation time between 0h00mn00sec and 23h59mn59sec) or the current elapsed time (number of seconds since the start of the current session). Depending on what you want to do with this time value, the script can store the time value in a session variable for future use by another script ; the script can also display the time value retrieved with a message in the UI or it can write it to the log ... Or anything else ... Many thing can be done via scripts.

Such rule or driver command do not currently exist, but it will be very easy to write. So if you are interested in having such rule or driver commands, just specify more what you want to do with the time value and let me know what you wish. It should not be long to make it available to the community.

Regards.
Pierre.
 
Might be fun to (optionally) link it to your MCStops and Timetables manager rule, such that a run-time monitor could report Actual vs Scheduled arrival / departure times.

John
 
Thank you for your generous offer.

A simple list that showed the train, stop name and time of a stop. We know the start time but the arrival varies.

Orient Express AliBaba 1400
Brooklyn Express O'Hara Street 2044
Orient Express Cairo 2011
Seoul Central Seoul 2200

Once this is begun there are probably many items that could either be posted from the program or as notation by the user.

Get real fancy and randomize the passenger load and unload numbers within a "reasonability" range to simulate real passenger activity and adjust stop times accordingly.. Show that in the list. Some coach cars could be programmed to have random numbers of passengers on and off a coach. Many more things could emerge from a base set of times. This is the most critical element of a traditional rail system - TIME.
 
I would like to see this. But I suggest that to keep it simple/easier to program, each event be added to the end of a .txt file external to Trainz.
 
Agreed. There is no reason to spend any effort to make it fancy and integrated. Later, after it is fleshed out, it could be integrated as the largest missing element in the railroad stimulation - Timetable. It could be used simply as a decoration or as a real set of objectives. Tony could issue points for those who are competitive and make an AI scenario with some number of trains operating concurrently with a timetable (schedule). Scoring based on the number of trains times times the number of stops minus the number of minutes from the timetable as an arrival or departure. If you drive to the timetable amongst some number (a point multiplier) of AI trains you receive achievement awards. Now instead just getting an overloaded train up a mountain the accomplishment is more rewarding. Toss in multiplayer where everyone has the time table working amongst the same AI trains and each other. Someone missing a scheduled departure could really gum up the works. It may be prudent to let that train go and wait for the next opportunity that will allow to to return to schedule at a different time. As they say in the "old Country" jolly good fun".
 
Hi.

From what I have read, one solution would be to create a new rule TimeStampManager, that will offer to select a subset of the route industries, stations, trackmarks, MCPathStops to be surveyed at run time by the rule, that will register for all these selected objects the trains that stops at and the game time where the event happens. The rule will include a run time monitor that will display the results with filtering option possible on trains or on path objects names.

for schweitzerdude, sorry but scripts executed in Trainz don’t have any access to the file system and cannot read or write in any .txt file. That has been a choice done initially by Auran then now by N3V for performance reason that is a constraint for all third party développer. That is why the rule needs to include its own display module.

If in the future, we want to expand the system so that other rules or driver commands can retrieve the already collected information, it will be still possible by adding some internal API so that other scripts can retrieve the information.

I have a few updates on EIT in progress to finish first, but I expect I should be able to start this new development end of August, so the new rule may be ready for first beta test about mid September ...

Regards.
Pierre.
 
I would hope that N3V offers any support you might need. A timetable/schedule is a major railroad element that has been absent from the simulation (TANE). Multiplayer and competitions (which I never use) will strongly benefit with the "players" being able to have achievements related to yet another measure. Maybe Pguy can also see the time a trackmark is passed. That would tell the train driver that they may be late hitting a critical mark and they should head for a siding as a passenger train will be coming. Or, the AI might be told to take them to a siding with a cautionary message. The session author would include an appropriate caution in the daily schedule so the driver is aware that they my be off to a siding for a few minutes rather than reporting another AI bug. When the virtual driver "arrives for work" the session designer would have a proper schedule prepared to account for traffic, maintenance delays, temporary track restrictions and of course our new Real Weather feature.

I wonder if rail companies have training simulators that do this now for driver training and situation simulation. As an example what is the network impact if a freight is directed to a speed restricted route due to maintenance on the main route? Whoops, we promised to never run trains through that town during rush hour because of that darn crossing tying up traffic. Thanks computer for remembering that.
 
Back
Top