[Patch] Improved Timetable Management [V2.31tr SVN15778]

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Realistic timetables [V1.30 for SVN14216]

Post by PhilSophus »

Unfortunately, now you can not load cargodest-timetable V1.20 games with cargodest-timetable V1.30. But both can load games from older cargodest and trunk versions.

Maybe I should have taken the approach of splitting the savegame version space as someone already did with his patches (wasn't that you, Roujin?). But I was so lazy :roll:


Edit: And BTW the bump is necessary because the timetable start needs to be saved for all vehicles.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: [Patch] Realistic timetables [V1.30 for SVN14216]

Post by Tekky »

PhilSophus wrote:Unfortunately, now you can not load cargodest-timetable V1.20 games with cargodest-timetable V1.30. But both can load games from older cargodest and trunk versions.
Is that correct? My understanding is that it can load current and old trunk versions and the current cargodest version, but not old cargodest versions.
bokkie
Transport Coordinator
Transport Coordinator
Posts: 327
Joined: 19 Jan 2007 19:26

Re: [Patch] Realistic timetables [V1.30 for SVN14216]

Post by bokkie »

I've been playing for a few minutes with the cargodest+timetables 1.20 build provided and encountered the following: after autofilling the timetable and tuning it, using headway to seperate the vehicles (seems to work like a charm! :)) and playing a few months, somehow 2 out of 3 trains with shared order were almost an entire timetable too late. It seems like somehow their order got mixed up but I don't get it yet. Loading an old savegame and fast-forwarding doesn't give the same problem, which makes it harder to track the problem down.

(Also, some building are not the right color but I haven't tested which patch/build accounts for this bug).

GRFs:
pb_av8w.grf
pikkindw.grf
pikbrikw.grf
pb_ukrs.grf
ukrsap1w.grf
NewTramTracksW_v0.4.1.grf
newshipsw.grf
egrvts.grf
Attachments
Dokkerk Transport, 2 Dec 1979.png
Screenie
(346.43 KiB) Downloaded 124 times
Dokkerk Transport, 2 Dec 1979.sav
Something just happened :D
(585.21 KiB) Downloaded 199 times
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: [Patch] Realistic timetables [V1.30 for SVN14216]

Post by Roujin »

PhilSophus wrote:[...]Maybe I should have taken the approach of splitting the savegame version space as someone already did with his patches (wasn't that you, Roujin?).[...]
Yes that was me, and I don't recommend it to you. As the savegame system is not designed for such things as branches, my approach was rather hacky.
While it did work (load both savegames from a bumped trunk and from older versions of the patch), it required extra additions for each trunk change since the first version of the patch supported for loading from.

e.g. my patch started when trunk had savegame version 90. I gave my patch savegame versions from, say, 120 on.
Then in 91 a new patch setting was introduced in trunk - I have to change it from "this setting exists in versions from 91 to VERSION_MAX" to "this setting exists in versions from 91 to 119, and from 12x to VERSION_MAX", where 12x was the version i bumped my patch to when I updated it to the trunk revision where the bump occurred.

I can only say, save yourself the hassle. If people are annoyed that their savegames keep breaking, they can go bug the devs to include your patch ;) :twisted:
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Realistic timetables [V1.30 for SVN14216]

Post by PhilSophus »

Tekky wrote:
PhilSophus wrote:Unfortunately, now you can not load cargodest-timetable V1.20 games with cargodest-timetable V1.30. But both can load games from older cargodest and trunk versions.
Is that correct? My understanding is that it can load current and old trunk versions and the current cargodest version, but not old cargodest versions.
As cargodest is already a patch to trunk, you might actually be right.

@bokkie: I'll have a look at your savegame, although I probably need one before it started and which reproduces the problem.
Roujin wrote:I can only say, save yourself the hassle. If people are annoyed that their savegames keep breaking, they can go bug the devs to include your patch ;) :twisted:
Hehe, now that is a very good reason not to use that system (besides being lazy) :lol:


Edit @bokkie: I have watched your game for bit and haven't observed the effect with the same vehicles but something similar with another line. I suspect, the reason is the following: You have very tight timetables and have servicing enabled (you should provide more overhead for catching up). Both directions of the ring use the same depot for servicing (you should set the other one as service depot for the other direction) and may thus interfere with each other. Normally, the vehicles can catch up their delay of 7 days due to servicing, but if a vehicle of the other direction is in the way, the delay may get larger. Additionally, more passenger could have piled up, causing a longer station turn-around further increasing the delay. If this happens, the delay keeps increasing. At some time the delayed train might even be overtaken by a timely train when in depot and then be stuck after this train.

So I suspect, it is not a bug, but normal behavior. If you see that behavior again and think my explanation is wrong, please post a savegame of before and one of after the problem.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: [Patch] Realistic timetables [V1.30 for SVN14216]

Post by Tekky »

I have compiled a working Win32 binary of cargodest-timetables version 1.30. You can download if from this link:

http://rapidshare.com/files/141931326/r ... t.zip.html
EDIT: This binary is now out of date. Later in this thread, I posted a binary for version 1.40

However, please note that I had a lot of trouble building this version, as the latest version of cargodest has two bugs that I had to fix manually:
  1. On line 294 of cargodest.cpp, I got the following warning from Microsoft Visual C++ 2008:
    warning C4146: unary minus operator applied to unsigned type, result still unsigned
    I had to cast to signed integer to fix this bug.
  2. The files in the "data" directory of the cargodest repository were invalid. I had to replace them with the latest files in trunk.
Since I am not 100% sure whether I fixed these bugs properly, you are using this binary at your own risk. :-)
Last edited by Tekky on 03 Sep 2008 19:55, edited 1 time in total.
bokkie
Transport Coordinator
Transport Coordinator
Posts: 327
Joined: 19 Jan 2007 19:26

Re: [Patch] Realistic timetables [V1.30 for SVN14216]

Post by bokkie »

PhilSophus wrote: Edit @bokkie: I have watched your game for bit and haven't observed the effect with the same vehicles but something similar with another line. I suspect, the reason is the following: You have very tight timetables and have servicing enabled (you should provide more overhead for catching up). Both directions of the ring use the same depot for servicing (you should set the other one as service depot for the other direction) and may thus interfere with each other. Normally, the vehicles can catch up their delay of 7 days due to servicing, but if a vehicle of the other direction is in the way, the delay may get larger. Additionally, more passenger could have piled up, causing a longer station turn-around further increasing the delay. If this happens, the delay keeps increasing. At some time the delayed train might even be overtaken by a timely train when in depot and then be stuck after this train.

So I suspect, it is not a bug, but normal behavior. If you see that behavior again and think my explanation is wrong, please post a savegame of before and one of after the problem.
That was my first idea as well but I couldn't recreate the problem in the few minutes I had to try. If I'll observe otherwise I'll post again :). BTW thanks for the patch, seems like a worthwile addition!
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Realistic timetables [V1.30 for SVN14216]

Post by PhilSophus »

bokkie wrote: That was my first idea as well but I couldn't recreate the problem in the few minutes I had to try. If I'll observe otherwise I'll post again :). BTW thanks for the patch, seems like a worthwile addition!
BTW: Sending the in-time train to depot and letting the other two trains overtake solved the problem within a bit more than a year without pressing "reset lateness" or letting it overflow. The two late trains were indeed stuck behind the other one. So, you had enough overhead, but were missing a possibility to overtake. I've let it run in express mode for a few hours after this, but they kept in time on average (always fewer than 10 days delay).
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
User avatar
BlueEagle_nl
Transport Coordinator
Transport Coordinator
Posts: 352
Joined: 28 Jan 2006 09:44
Skype: tilly5014
Location: Tillywood, The Netherlands

Re: [Patch] Realistic timetables [V1.30 for SVN14216]

Post by BlueEagle_nl »

Guys, great patch!

Can't wait to compile it here, along with Infrastructure Sharing and Daylength

Someone tested this patch with Daylength already?
AndiK
Engineer
Engineer
Posts: 53
Joined: 07 Dec 2004 18:34
Location: Grafing bei München (Munich)
Contact:

Re: [Patch] Realistic timetables [V1.30 for SVN14216]

Post by AndiK »

Hmm. Didn't the original Autosep-patch order trains by some kind of FCFS approach at the first station in the timetable? If a late train had been overtaken by another one, the train would take the place of the late one. At least this is what I believe how it worked. ^^
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Realistic timetables [V1.30 for SVN14216]

Post by PhilSophus »

AndiK wrote:Hmm. Didn't the original Autosep-patch order trains by some kind of FCFS approach at the first station in the timetable? If a late train had been overtaken by another one, the train would take the place of the late one. At least this is what I believe how it worked. ^^
Not exactly, it calculated the time from start of the timetable and ordered by this time. This patch builds upon this code (you might have noticed that I referenced MagicBuzzes patch), so, this one works similar in this respect, although it doesn't sort the shared vehicle list permanently but builds an internal sorted list just when headways are requested.
BlueEagle_nl wrote:Someone tested this patch with Daylength already?
Just be careful: I use some 32-bit signed integer counters measuring in ticks since the year 0. This means 79000 years without daylength, but I can not guarantee that nothing overflows if you use a daylength factor.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: [Patch] Realistic timetables [V1.20 for SVN14187]

Post by DaleStan »

Regiovogel wrote:- this is my own case - I don't understand what the wiki says what files are needed really. (On the one hand, it says "install this", and a few lines later it says "do not install, just copy some files out of it")
If you think the wiki is incorrect, quote the exact lines, and report which page or pages they are on.
If you think you followed the directions, report the exact error message(s).
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: [Patch] Realistic timetables [V1.30 for SVN14216]

Post by Eddi »

there's a space at the beginning of line src/date.cpp:235 (i hope my counting is correct ;)), the line with the closing }
AndiK
Engineer
Engineer
Posts: 53
Joined: 07 Dec 2004 18:34
Location: Grafing bei München (Munich)
Contact:

Re: [Patch] Realistic timetables [V1.30 for SVN14216]

Post by AndiK »

Hmm. I've been playing with RTT130 for a few hours now and I've got some proposals:
  • Concerning headways/Autosep: Why not use the FCFS method I thought MagicBuzz's patch already was using? Right now, timetable separation might get confused when you build additional trains. I've had trains standing in the first stop for hours on end with a big traffic jam at the entry signal. Idea: Store the time since the last vehicle left the first station in the list. The next vehicle arriving (regardless of any order in any internal list that no user will ever see) gets "last_train_dep_time + headway" set as its own departure time. This could save you one list and quite some confusion at the station. :-) (Of course I am aware that I don't know the source - If there's a reason for the way it works now, then so be it)
  • A button for Auto-Auto-Headway. Changes Headway as soon as trains in the shared timetable get created/removed and/or started/stopped [in a depot].
  • Swap the headway button functions. I haven't used manual headway a single time. Auto-hw should get priority here, IMO.
I think that's all. :-) Great patch, really. I've never had as much fun with passengers as with cargodest and RTT. :bow:

Edit: I've seen the "It's not a bug, it's a feature" in the first post. This seems to be a functional workaround. :-) I'd still like my proposal No 1 better. :-P
Last edited by AndiK on 02 Sep 2008 18:50, edited 1 time in total.
User avatar
Regiovogel
Engineer
Engineer
Posts: 48
Joined: 03 Feb 2008 23:25
Location: Nürnberg, Germany

Re: [Patch] Realistic timetables [V1.20 for SVN14187]

Post by Regiovogel »

DaleStan wrote:If you think the wiki is incorrect, quote the exact lines, and report which page or pages they are on.
If you think you followed the directions, report the exact error message(s).
Just while reporting the things which didn't make sense for me, I read some information closely enough this time and some things are clear now... Shame on me :oops:

Now the question how to apply patches is left... many patches are not compatible with TortoiseSVN, and a whole lot of patches which are made to work with BuildOTTD are rejected as "unknown patch format". (not to tell about the problems since the server moved, but that's pretty off topic here)
After resolving those problems, I could eventually be able to compile it...

--------------------------

PhilSophus, apologies for hi-jacking your thread. Tekky, thank you very much for your binary! I love the new features :)
The timetables with vehicle separation are a great addition to CargoDest...
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: [Patch] Realistic timetables [V1.20 for SVN14187]

Post by Tekky »

Regiovogel wrote:Now the question how to apply patches is left... many patches are not compatible with TortoiseSVN, and a whole lot of patches which are made to work with BuildOTTD are rejected as "unknown patch format". (not to tell about the problems since the server moved, but that's pretty off topic here)
After resolving those problems, I could eventually be able to compile it...
Sorry for being off-topic, but I had the same problems as you. Eventually, I threw away TortoiseSVN for this reason and reverted to the official SVN client, which uses text mode. For applying patches, I first used the "patch" program of GnuWin32, but this program was only able to handle Windows and not UNIX line endings. So I finally tried the "patch" program from this site, which is at least five years old, but works perfectly with both types of line endings.
EDIT: I'm sorry for having posted wrong information. The UnxUtils patch program does NOT support both types of line endings. I had mixed it up with the MSYS patch program, which supports both types of line endings.
Last edited by Tekky on 10 Oct 2008 16:44, edited 2 times in total.
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Realistic timetables [V1.40 for SVN14234]

Post by PhilSophus »

V1.40 is out (see top post). Main feature is the integrated station timetable when <CTRL>-clicking any of the vehicle icons of the station window. A few bug fixes are also included.

Unfortunately, there was a savegame bump in trunk in SVN 14232, so the diff against trunk breaks savegame compatibility. The cargodest version does not as this trunk revision is not yet merged into cargodest branch.

From my point of view the patch is now feature-complete concerning the main features I had in mind when starting. So now the polishing starts.


AndiK wrote:Concerning headways/Autosep: Why not use the FCFS method I thought MagicBuzz's patch already was using? Right now, timetable separation might get confused when you build additional trains. I've had trains standing in the first stop for hours on end with a big traffic jam at the entry signal. Idea: Store the time since the last vehicle left the first station in the list. The next vehicle arriving (regardless of any order in any internal list that no user will ever see) gets "last_train_dep_time + headway" set as its own departure time. This could save you one list and quite some confusion at the station. :-) (Of course I am aware that I don't know the source - If there's a reason for the way it works now, then so be it)
My thought when in implementing it like it is now was: The user knows what he is doing. He may choose for which vehicle he pushes the headway button. I've though about the following alternative to the current behavior: Starting at the vehicle you pushed headway for, use a negative headway for vehicles between first order and the vehicle which executes the headway and positive headway for the vehicles following it. So, you could still define the reference point of the headway but vehicles wouldn't have to wait for a full round. Please all of you make comments which behavior you would prefer.
AndiK wrote: A button for Auto-Auto-Headway. Changes Headway as soon as trains in the shared timetable get created/removed and/or started/stopped [in a depot].
One of the main design goals of my patch is retaining control of what is happening, while not having too much micro management (which it will always be, that lies in the nature of timetables). That is, the focus is not on having it all automatic, but on having the control (yeah, call me a control freak :P) So, I prefer that the user has to give an explicit order. Pushing headway is not that much work.
AndiK wrote: Swap the headway button functions. I haven't used manual headway a single time. Auto-hw should get priority here, IMO.
Makes sense. You have the possibility to change the value anyway before executing. So, I probably should always preset the value. If you want another value changing from zero or a reasonable preset doesn't make that much difference :wink:
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
bokkie
Transport Coordinator
Transport Coordinator
Posts: 327
Joined: 19 Jan 2007 19:26

Re: [Patch] Realistic timetables [V1.40 for SVN14234]

Post by bokkie »

PhilSophus wrote: My thought when in implementing it like it is now was: The user knows what he is doing. He may choose for which vehicle he pushes the headway button. I've though about the following alternative to the current behavior: Starting at the vehicle you pushed headway for, use a negative headway for vehicles between first order and the vehicle which executes the headway and positive headway for the vehicles following it. So, you could still define the reference point of the headway but vehicles wouldn't have to wait for a full round. Please all of you make comments which behavior you would prefer.
I click most of the time on just any vehicle when I've changed something in the timetable/added vehicles to auto-seperate them (headway), so behavior that accomodates this has my preference (and is the most fool-proof ;)).

There seems to be a bug in Tekky's v1.30 build with cargodest, YAP(P/F) doesn't seem to work right. Trains always want to choose the shortest route, even if that isn't a free path and there's a free path right next to it which is 1 tile longer. Playing with the v1.00 without cargodest the same error seems to occur, look at the screenshot provided. Or am I doing some wrong signalling here... haven't been playing with many trains for a while :).

EDIT: same happens with clean trunk and clean config (nightly 14228). Probably my bad signalling then... but I could swear I used to do this when YAPP wasn't in trunk yet :D.
Attachments
Klein Kollumetricht Transport, 2 Mrt 1970.png
Train 2 is waiting for nothing :)
(215.2 KiB) Downloaded 79 times
Last edited by bokkie on 03 Sep 2008 14:15, edited 2 times in total.
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: [Patch] Realistic timetables [V1.40 for SVN14234]

Post by Tekky »

bokkie wrote:There seems to be a bug in Tekky's v1.30 build with cargodest, YAP(P/F) doesn't seem to work right. Trains always want to choose the shortest route, even if that isn't a free path and there's a free path right next to it which is 1 tile longer. Playing with the v1.00 without cargodest the same error seems to occur, look at the screenshot provided. Or am I doing some wrong signalling here... haven't been playing with many trains for a while :).
This is strange. What do you have the patch setting pf.yapf.rail_pbs_cross_penalty set to? In order to find this out, enter "patch pf.yapf.rail_pbs_cross_penalty" in the OpenTTD console. I think the default value is 300.
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Realistic timetables [V1.40 for SVN14234]

Post by PhilSophus »

RTT does not touch code in any way related to YAPP or YAPF. My guess is that cargodest doesn't either. So, as Tekky said: Check if you haven't played around with penalties. If you didn't please try to check if the same happens with clean trunk or clean cargodest.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 20 guests