Timetable Improvement Patch

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

Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Timetable Improvement Patch

Post by Eddi »

yes, compiling generally needs the "-devel" version of packages. you probably need a version compiled for mingw
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 »

zlib1g-dev is installed as well as I see now. What´s missing is the variant compiled for mingw cross compiling.

I came across https://answers.launchpad.net/ubuntu/+s ... ion/202604 (and the bug referenced there), according to that two years old bugreport, it is (was in 2012) simply missing in the mingw distribution, and people there argue that compiling it yourself is not easy.

How is this issue solved when compiling the OpenTTD nightlies / releases - are the windows-versions cross-compiled?

Anyway, unless someone has a good idea regarding this, I probably won´t invest too much time into this; I will continue bugfixing and improving the patch, and maybe in the end someone can compile a patched windows version in a native manner once.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Timetable Improvement Patch

Post by Eddi »

the official windows binaries are compiled on a windows virtual machine, not cross-compiled.

alternatively, you could apply for a repository on the devzone, and use their setup for providing binaries.
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 »

Ok, at least I configured it. I finally got zlib from https://launchpad.net/~mingw-packages/+ ... /+packages (uncompress the deb archive and manually copied libz.a to /usr/i686-w64-mingw32/lib/, then found that lzo was also missing, and found that there is already a Wiki page on that topic:

http://wiki.openttd.org/Cross-compiling_for_Windows

Using the instructions there, I managed to run configure:

Code: Select all

./configure --host=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32/ --enable-static CPPFLAGS=-I/usr/i686-w64-mingw32/include LDFLAGS=-L/usr/i686-w64-mingw32/lib
Now, at the beginning of make, I run into a problem that seems to be unrelated to those libraries, I´ll inspect...

(and yes, I know that my approach is quick&dirty, as I just want to provide some release for testing a patch, and not more...)
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 »

Bugfix release:

Fixed:
- Timetable dialog, "Enter Duration" dialog, and "Enter arrivals/departures in a fast manner" dialogs should scale correctly now if font size is changed
- Speed limits can be entered again
- The (in this version of the patch) superfluous Set Routes button is gone
- Textual bugs in the timetable lines in the order list are fixed (e.g. a superfluous "and" at the line end)

Known tasks left:
- If no arrival / departure is set I set lateness counter to INVALID_DATE, unfortunately this translates to a delay "-1" display on viewport. I need to treat that case in a better way.
- Cleanup tasks in the patch queue

My vision is that once I fixed all problems known for now, I release precompiled versions of
- this patch
- more heightlevels patch + this patch

Let´s see in what way I´ll be able (or not) to compile them...
Attachments
stip_v6.zip
(117.49 KiB) Downloaded 176 times
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 »

... and another bugfixing session.

Fixed:
- If no arrival/departure is set, no (wrong) delay information is displayed as none exists
- Entering conditional order variables works again
- Entering a timetable start date immediately updates the timetable window
- Up to now, when the timetable start date was changed, the arrivals / departures shifted accordingly. I once thought that to be a good feature, but playing experience showed that this usually isn´t what you want - you e.g. want to move timetable by 10 days because you add a new order at the beginning, and don´t want to mix up your timetable because of that. Thus, I removed that feature.
- Instead, once an order is outside the interval [Timetable start, timetable start + offset[, the corresponding line is marked red to indicate the problem (also red are orders with arrival > departure, and departure > arrival of the next order).

[those problems are non-fatal in a sense that code can cope with them, e.g. a train departs when its time to depart, regardless of wether that time is technically outside the range]

Known bugs:
- When the start date is edited using the shift forward/backward buttons, this also affects the timetable of other windows. They do not yet get updated in that case.
- There are two still function-less buttons (<< and >>) near the timetable length button.
Attachments
stip_v7.zip
(108.48 KiB) Downloaded 168 times
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 »

I am currently implementing the Autofill feature for my patch. I want to introduce two configuration variables, storing (1) Number of days a vehicle stays in a station by default (i.e. Departure = Arrival + <this number>), and (2) A factor to be multiplied on the measured travel time (i.e., the idea is, the vehicle needs 10 days between stations A and B, factor is e.g. 20 percent extra, thus define Arrival = Departure + 12 days in order to get some extra margin for breakdowns etc.).

The rationale behind both is trying to generate a timetable using Autofill which needs as less manual corrections as possible.

Question: Where should those variables go to in the configuration tree?

Possibilities I can think about:
(a) Vehicles
(b) Vehicles / new subitem "Timetables"
(c) Interface
(d) Interface / new subitem "Timetables"
(e) ...?

Opinions?
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 »

I´ve finally implemented autofill for my patch.

Features:
- Configurable stay time in stations, e.g. Departure = Arrival plus 5 days
- Configurable percentage added to measured travel times, e.g. Departure 1st May, Measured Arrival 11th May, Percentage 20 percent ==> Calculated Arrival 13th May.
- Both variables can be configured in Advanced Settings -> Vehicles -> Timetable
- Autofill can start at any order

Limitations / Questions to be discussed:
- Autofill so far doesn´t know anything about breakdowns and explicitely stopped vehicles. I.e. while the extra percentage above is meant to generate extra time for potential breakdowns (and other extraordinary events), breakdowns currently sum up to the measured travel times. It would be better if there would be a way to exclude them from measured travel times, unfortunately I can´t think of a reasonable way to store that information in a way that survives save/load. I would need some extra variable that can hold a Date (start of recording gap, i.e. start of breakdown), plus some that can hold a correction value (number of days to subtract from travel time). While I might use the lateness counter for the latter, I don´t have an idea for the former...

- When does Autofill finish? In this version of the patch, it doesn´t finish at all. But that introduces the danger of accidentally overwriting what one recorded earlier. Unfortunately, I don´t have the knowledge about at which order autofill started once, i.e. I cannot simply stop autofill after one round.
Is automatically stopping Autofill after the last order a reasonable behaviour?

[there is also the small, additional problem that when Autofill switches to the first order before the timetable duration is finished, it will generate Arrivals / Departures for the first order outside the timetable range. They will be marked red, and aren´t a real technical problem either, but this is maybe an additional argument for stopping after the last order]

- Other questions / feedback?
Attachments
stip_v8.zip
(113.14 KiB) Downloaded 181 times
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 »

Thanks to Truespace, here is a Windows binary of the current v8 version

http://www.tt-ms.de/forum/showthread.ph ... 6#pid86186
bokkie
Transport Coordinator
Transport Coordinator
Posts: 327
Joined: 19 Jan 2007 19:26

Re: Timetable Improvement Patch

Post by bokkie »

Truelight, Truebrain and now he's called Truespace? Make up your mind already! ;)
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Timetable Improvement Patch

Post by Alberth »

At a .de forum? Quite unlikely :)
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Timetable Improvement Patch

Post by Eddi »

Alberth wrote:At a .de forum? Quite unlikely :)
he speaks the worst german i ever heard :p
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 »

The next release:

Implemented:
- Autofill now stores the order where it started, and stops after exactly one round
- Autofill now triggers a message once it has completed.
- Autofill now stores the time spent for breakdowns during recording, and doesn´t include it into its estimate

Furthermore, I started to use the bugtracker at the project at openttdcoop. The first bug is related to breakdown delays:

https://dev.openttdcoop.org/issues/7041

Feel free to report bugs here or there.
Attachments
stip_v9.zip
(116.96 KiB) Downloaded 183 times
Logital82
Engineer
Engineer
Posts: 58
Joined: 15 Feb 2010 12:03
Location: Germany, Berlin

Re: Timetable Improvement Patch

Post by Logital82 »

Will this patch work together with 24h patch (departureboardswallclock24)?
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 »

No.

I have already code for a arrival / departure boards based on this patch (however not 24h), for the sake of smallness of patch they are not included in current patch versions.

I don´t know the patch you mentioned, but it almost certainly is based on timetables as present in current trunk, and as my patch aims to improve and replace them, I also changed the logic that patch relies on.
Logital82
Engineer
Engineer
Posts: 58
Joined: 15 Feb 2010 12:03
Location: Germany, Berlin

Re: Timetable Improvement Patch

Post by Logital82 »

Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Timetable Improvement Patch

Post by Wahazar »

Arrival / departure boards are rather for aesthetic reasons, more important question is about compatibility with any daylenght patch?
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 »

To avoid misunderstandings, could you elaborate a bit about what such a daylength patch does / point me to a patch you would like to cooperate?

Regarding departure boards, I disagree a bit, when designing a big network, they are more than just aesthetic, in that they give a easily accessible, quick overview about what´s going on at some station, e.g. when one wants to find a free slot for some new train.

Anyway, here is the next release:

Changes:
Autofill now can operate in two different modes:
(1) Only set arrivals/departures, leave start date and length of timetables untouched, the player is responsible for setting them up.
(2) Set arrivals and departures of orders, and additionally start date and length of timetable.

Variant (1) is for people who synchronize different timetables, or who just want to update some limited section of a timetable. E.g. if you want to synchronize a new timetable with some old timetable of length 2 months, then your timetable needs a multiple of 2 months, otherwise the vehicles won´t meet at a defined place in every iteration. I.e., in that case autofill is useful for setting up the detailed arrivals / departures (maybe with some manual corrections afterwards), but not for timetable length etc.

Variant (2) is for people for want autofill to define the whole timetable. Here, the start date of the timetable is set to the arrival at the first order, and its length to the total time (measured in days) the vehicle needs for the timetable. But, the drawback is that a timetable of length e.g. 68 days doesn´t synchronize well with a timetable of length e.g. 91 days.

Some known limitations / things to be fixed exist:
- It currently only works for vehicles with offset zero.
- Some visual improvements need to be done, e.g. during autofill, some portions of the timetable are marked as inconsistent, although you just look at a perfectly valid working state of autofill.
Attachments
stip_v10.zip
(119.16 KiB) Downloaded 172 times
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Timetable Improvement Patch

Post by ic111 »

Another version. Changes:

- Finished Autofill
- Implemented a mass changing mode for applying the same offset on multiple arrivals / departures (consider the << and >> button you see when selecting the very first summary line of a timetable).

These were the last new features I wanted to implement. Maybe I re-introduce the already implemented arrival / departure boards for stations into this patch. I once removed them (together with some other stuff) to make the patch queue smaller, but on the other hand side, they are a straightforward extension, and already the mass changing mode mentioned above is implemented as the last patch in the queue that can be removed without affecting the remaining queue in any way.
Attachments
stip_v11.zip
(124.58 KiB) Downloaded 160 times
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Timetable Improvement Patch

Post by Wahazar »

ic111 wrote:To avoid misunderstandings, could you elaborate a bit about what such a daylength patch does / point me to a patch you would like to cooperate?
Apt remark.
Awhile forget about - I didn't found any working properly, yet.
ic111 wrote: Regarding departure boards, I disagree a bit, when designing a big network, they are more than just aesthetic, in that they give a easily accessible, quick overview about what´s going on at some station, e.g. when one wants to find a free slot for some new train.
Text boards are not very useful for such purposes. Graphic diagrams of station occupancy are much more suitable.
You can also utilize your time-distance diagram taking into account finite train and station length.
Instead of line, plot train and station as bands, something similar like this:
http://kmkrakow.pl/images/thumbnails/at ... 99x404.jpg
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 12 guests