Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timetable based auto-separation patch #1128

Closed
DorpsGek opened this issue Aug 14, 2007 · 18 comments
Closed

Timetable based auto-separation patch #1128

DorpsGek opened this issue Aug 14, 2007 · 18 comments

Comments

@DorpsGek
Copy link

@DorpsGek DorpsGek commented Aug 14, 2007

MagicBuzz opened the ticket and wrote:

With timetable feature added to the trunk, the main feature I expected to find was an auto-separation system.
But it doesn't exist, so I created this patch.

It will change the timetable feature : there is no option flag, it is just activated when using timetable option and shared orders vehicles.

Features:
- Automatically reorder the shared vehicle chain according the actual order of passage to the station. This chain order is checked when a vehicle enters the first "stop" station in the shared order table. This uses a new in the Station class in order to store the last vehicle of each shared order chain that visited the station (applies only to the first "stop" station in the shared order tables).
- Compute the waiting time at the first "stop" station of the shared order table. This time is computed from the timetable total duration, the number of vehiclessharing the order, and the current theorical separation with the first vehicle of the shared order chain (includes its lateness counter). This waiting time does not apply to the first vehicle of the chain, as its the referential for separation feature.
- After this time, the vehicle lateness counter is updated with "remaining waiting time" * -1 : if the vehicle uses proper separation, it's 0, if the separation with the first vehicle of the chain is too big, then it's the lateness the vehicle have against it's theorical position if correctly separated.

This patch does NOT affect the savegame format.

Tests :
- Works as expected with road vehicles
- Works as expected with planes
- Works as expected with ships (I think it's the best thing that patch can do)
- Works as expected with trains
- Tested with multiplayer game (only 1 client plus the server, machine) and did not throw any problem

Patch is made from source code revision 10887 (and applies without any warning on the 10892 revision)

I hope you'll enjoy this patch, I do ;)

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/1128
@DorpsGek
Copy link
Author

@DorpsGek DorpsGek commented Aug 15, 2007

MagicBuzz wrote:

Update :
- Removed the list I added to the sation class. Replaced by an "on the fly" compute.
- Fix : A minor bug making the second vehicle separation lower than expected in some cases.

New patch made from trunk r10908

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1128#comment1876
@DorpsGek
Copy link
Author

@DorpsGek DorpsGek commented Aug 25, 2007

MagicBuzz wrote:

Fix : There were an issue when the vehicles where computing separation while another vehicle was waiting at the station. Now it works all the time and the separation works fine.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1128#comment1959
@DorpsGek
Copy link
Author

@DorpsGek DorpsGek commented Aug 25, 2007

MagicBuzz wrote:

(sorry, lastest patch is for trunk r10977)


This comment was imported from FlySpray: https://bugs.openttd.org/task/1128#comment1960
@DorpsGek
Copy link
Author

@DorpsGek DorpsGek commented Aug 26, 2007

MagicBuzz wrote:

- Fix : The bug fixed in 10977 wasn't correctly handled. Not it is completely corrected.

r01980

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1128#comment1965
@DorpsGek
Copy link
Author

@DorpsGek DorpsGek commented Aug 26, 2007

MagicBuzz wrote:

- Optimisation : Separation computation code moved from HandleLoading() to BeginLoading() function in order to save CPU. Now the separation computation is done only one time when the vehicle enters the first route station.

Still r10980

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1128#comment1970
@DorpsGek
Copy link
Author

@DorpsGek DorpsGek commented Aug 27, 2007

MagicBuzz wrote:

Small update : added a patch option to enable/disable the feature.

r10990

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1128#comment1987
@DorpsGek
Copy link
Author

@DorpsGek DorpsGek commented Nov 4, 2007

TrueBrain wrote:

Although I am unsure this patch is really useful, for sure it fails codestyle.

- Don't include any other language than english.txt
- Use spaces to align english.txt
- Follow coding style.
- Don't do: ++index; Do: index++;
- Don't use doxygen comments inside functions
- Single line comments are: /* */. Not ///
- ... (the list is pretty long ;) Look up the wiki please)


This comment was imported from FlySpray: https://bugs.openttd.org/task/1128#comment2595
@DorpsGek
Copy link
Author

@DorpsGek DorpsGek commented Feb 1, 2008

MagicBuzz wrote:

Patch update against trunk r12032.

Fixed those small remarks.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1128#comment3423
@DorpsGek
Copy link
Author

@DorpsGek DorpsGek commented Feb 1, 2008

MagicBuzz wrote:

ignore last file.

here is the lastest r12032 patch file.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1128#comment3426
@DorpsGek
Copy link
Author

@DorpsGek DorpsGek commented Feb 2, 2008

MagicBuzz wrote:

New update. This times it should not remain any issue about comments and coding style rules

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1128#comment3429
@DorpsGek
Copy link
Author

@DorpsGek DorpsGek commented Feb 4, 2008

MagicBuzz wrote:

r12059

The patch was replacing the simple function "IsSharedOrderList(const Vehicle *v)" to a Vehicle method class, but now the trunk already contains this change (r12040), so I removed the change from the patch.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1128#comment3457
@DorpsGek
Copy link
Author

@DorpsGek DorpsGek commented Feb 7, 2010

steven wrote:

Updated to r19051.

(Note that the configuration option actually will not be saved in this revision, thus loading a game will always have timetable separation enabled).

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1128#comment7550
@DorpsGek
Copy link
Author

@DorpsGek DorpsGek commented Sep 4, 2013

planetmaker closed the ticket.

Reason for closing: Implemented

Somewhere along the way... before r25557


This comment was imported from FlySpray: https://bugs.openttd.org/task/1128
@saveman71
Copy link

@saveman71 saveman71 commented Apr 21, 2020

Has this really been implemented? Quoting the request to re-open from FlySpray:

2016-12-28: A request to re-open the task has been made. Reason for request: I cannot find any evidence of auto-separation in the 1.6.1 release (r27609) so I do not understand how you can claim this feature is "Implemented". Control-clicking "Start date" is the exact opposite of auto-separation, in case that wasn't obvious.

@embeddedt
Copy link

@embeddedt embeddedt commented Apr 21, 2020

@saveman71 I believe this is implemented in the JGR Patch Pack, but not in vanilla OpenTTD.

@auge8472
Copy link
Contributor

@auge8472 auge8472 commented Apr 22, 2020

Autoseparation is implemented in vanilla but only with the Ctrl-clicking mechanism, saveman71 criticises. JGRPP includes a patch, that automates the mechanism via a setting.

@saveman71
Copy link

@saveman71 saveman71 commented Apr 23, 2020

Thanks @auge8472 it makes more sense as of why it was closed originally.

To be honest I had even missed the Ctrl+click mechanism on vanilla. Even now, I'm not sure how it works. It's a one time thing? I.e. I add more train, do I have to set it up again? It's also missing documentation on https://wiki.openttd.org/Timetable.

Screenshot from 2020-04-23 12-37-28

I'm now playing with JGR's patch and yes it's a very different approach that has been implemented.

Screenshot from 2020-04-23 12-40-34

I think (I have not played enough) that as it says "automatically adjusts the timetable", that it does manage the timetable for you, as they are different train to train and that it would automatically adjust if I were to add a train to the shared orders:

Screenshot from 2020-04-23 12-42-53

@saveman71
Copy link

@saveman71 saveman71 commented Apr 23, 2020

Okay I just understood @auge8472's explanation: This issue/patch is about MagicBuzz's patch, which indeed landed in vanilla.

On JGRPP's patch: https://www.tt-forums.net/viewtopic.php?f=33&t=46391

This patch was inspired by this patch from MagicBuzz but handles separation in a new way.

So it's two different things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.