[Patch] Slim Timetable Separation (new V60 out)

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

AndiK
Engineer
Engineer
Posts: 53
Joined: 07 Dec 2004 18:34
Location: Grafing bei München (Munich)
Contact:

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by AndiK »

Thanks for the proposed fix. :-) I'll look into it.
aantono
Traffic Manager
Traffic Manager
Posts: 211
Joined: 15 Apr 2010 21:01
Location: Midwest, US

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by aantono »

Now, that CargoDist is integrated into truck, can there be an updated patch diff against it, as it would be very great to use combined with cargo-dist.

Thanks
bokkie
Transport Coordinator
Transport Coordinator
Posts: 327
Joined: 19 Jan 2007 19:26

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by bokkie »

User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1354
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by MagicBuzz »

I still haven't tested this patch, but I hope it will be integrated to trunk as soon as possible.

As the "father" of the idea (I wrote the first timetable separation patch) I'm conviced that this feature is needed as soon as you try to make a passenger and mail network.

I was very surprised the cargodist was integrated first, as IMHO cargodist is absolutely useless without timetable separation (link graph will compute very badely when having all the vehicles running together instead of being separated along the path).
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1354
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by MagicBuzz »

I'm not sure to understand...

Is that the patch already integrated to trunk ?
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2822
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by ChillCore »

Yes, autoseparation for vehicles with shared orders is in trunk. ;)

The provided link is just the HG repository instead of the SVN one, otherwise it is exactly the same code and commits.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1354
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by MagicBuzz »

Hmmm :bow:

Ok, I downloaded the last trunk binary.

I see the "CTRL + Click" tip, but... My vehicule don't get separated ?(
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by Transportman »

MagicBuzz wrote:Hmmm :bow:

Ok, I downloaded the last trunk binary.

I see the "CTRL + Click" tip, but... My vehicule don't get separated ?(
It sets the start dates for all vehicles with the same shared orders and separates based on that. So you need to actually start your vehicles to get them to separate (by late/earliness at the first order).
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2822
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by ChillCore »

Do you have a comletely filled timetable?
Without that vehicles have nothing to base their start dates on.


Also,
Not sure if this is the place to discuss recent trunk; I have absolutely no clue which version of the feature made trunk myself.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1354
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by MagicBuzz »

I did some deeper tests and... As far as I see, it doesn't work.

As soon as I use "autofill" timetable, the separation stops. And when I enable it again, it looks like to work for a few seconds then... doesn't separate anything ?(

Thus, "ctrl + click" is somewhat an "hidden" feature. And... I still haven't understood why I should type a "start date" to make the separation.

May I don't use it properly, but at this time, it really need a documentation, I guess.

-- Edit : Oh, I think I understood the way it "works". Well the guy who wrote this didn't understand anything about separation based on timetable.

It I understand, as soon as the timetable changes (new station, new path, etc.) then we must set a new start date, then ctrl+click again ?
The same when buying/replaceing/selling a vehicle ?

This isn't what I call a "timetable based separation". It's just a "timetable based start time" or another stuff like this.
The "start time" must be recomputed automatically each time there is a change on the timetable, or when adding/changing/removing vehicles from the shared orders.

I just hope this is a "pre-release" and not the final implementation.
For me, autosepration should not be linked to manual start date, and start date of any but the first one vehicle of the shared orders list should be recomputed automatically each time timetable changes or vehicle number changes.
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by Eddi »

MagicBuzz wrote:This isn't what I call a "timetable based separation". It's just a "timetable based start time" or another stuff like this.
The "start time" must be recomputed automatically each time there is a change on the timetable, or when adding/changing/removing vehicles from the shared orders.
maybe "semi-automatic distribution of start times" is a better description. anyway, after changing the timetable, just ctrl+click on start date again, and it will re-separate. without timetable change, no need to adjust anything (provided you have enough buffer time and places to overtake at the waiting stations)

it certainly is the most minimalistic way to implement the feature, but it IS a great help (if you can use the feature correctly).

it may need a step backwards if you used the old "fire and forget" kind of autoseparation, but i always felt that this was over the top and not sensibly usable if you have more than one line.
habnabit
Engineer
Engineer
Posts: 1
Joined: 10 Sep 2013 11:39

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by habnabit »

Hi! I registered here to post about this.

I've updated the patch so that it cleanly applies against current OpenTTD trunk (as of writing this, r25755). I also fixed a couple of minor bugs and added a feature: the timetable separation will tell you if the timetable is incomplete (and thus separation won't happen) instead of showing initializing/running.

All of my work is posted to github. (The branch is named 'tut' because 'trunk-uniform-timetabling' is too long.) For convenience, I'm also attaching the patch against current trunk.
Attachments
timetable-separation.patch
A patch for timetable separation against OpenTTD trunk r25755
(36.78 KiB) Downloaded 256 times
User avatar
MasterMeNL
Engineer
Engineer
Posts: 86
Joined: 12 Oct 2012 17:16
Location: Netherlands

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by MasterMeNL »

Thanks a lot habnabit!
I assume I can also patch it against 25760 since the only changes are basically translation and a bugfix. I'll report back if it works.
Works perfectly!

The control+click feature on regular OpenTTD is pretty useless, it still requires you so send everything to depot and release them all manually to be on schedule or wait a year for them to catch up.

Really, why is this not in trunk yet? Maybe disable it by default if "this makes the game too easy". But manual timetables are just a chore and not hard to do at all, just takes a lot of time.

Edit: made a thread for compiled combined patch stuff here in case someone needs it.
AndiK
Engineer
Engineer
Posts: 53
Joined: 07 Dec 2004 18:34
Location: Grafing bei München (Munich)
Contact:

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by AndiK »

Hi all,

thanks for maintaining (& using) my patch. :) Much appreciated. I neither have time nor motivation to do it myself.

Edit:

@ MasterMeNL:
Could you elaborate on what you mean by useless Ctrl+Click / Waiting a year? I don't quite understand. Maybe I can help. :)
zooks
Transport Coordinator
Transport Coordinator
Posts: 262
Joined: 29 Jun 2006 08:36

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by zooks »

AndiK wrote:Hi all,

Edit:

@ MasterMeNL:
Could you elaborate on what you mean by useless Ctrl+Click / Waiting a year? I don't quite understand. Maybe I can help. :)
He's talking about the recent trunk feature to separate vehicles based on their timetable. If you ctrl-click on start date, it computes separation for all vehicles and sets start dates accordingly. However, it often takes a while for the vehicles to catch up with their new timetable start dates. See http://vcs.openttd.org/svn/changeset/25377/
AndiK
Engineer
Engineer
Posts: 53
Joined: 07 Dec 2004 18:34
Location: Grafing bei München (Munich)
Contact:

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by AndiK »

Ah, thanks. I seem to be a bit out of touch. ^_^
KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by KeldorKatarn »

I don't get why such a crappy version was added to trunk. I'm using that other auto-seperation patch (never saw this one unfortunately as it is not used in any patchpacks which I used for reference to look into patches, but it seems to do the same on auto-mode, or possibly that part is even the same code), and that is easy to use and works fine. I go to the timetable, click on automate and the rest is handled for me. No strange CTRL-Click or any other hidden stuff. Really don't get this one... The UI in the first post and the description of the feature sound great. Honestly I cannot see how any normal player would ever wrap his head around the current time table UI anyway. I don't even think that should be in there. it's WAY too complicated and too much micromanagement.
This automation is exactly what is needed and it should be easy to use and clearly visible. I would even make that the default UI and hide all the manual stuff back behind some "advanced" button. The standard player will never use that. It is just too much work and nobody gets it at first glance.
Karmorak
Engineer
Engineer
Posts: 1
Joined: 18 Nov 2015 18:17

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by Karmorak »

Hi AndiK,
I have al little question, do you can upload an ready zip file with the patch and so on. Because i cant programming.
PS. sry my enlgish is not so good.
MfG Karmorak
KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by KeldorKatarn »

I found a problem with this patch. If the first order in the list is a "via" order, e.g. for ships with buoys that can happen a lot,
then the separation never initialized. If I simply move the orders around so the first one is a loading order it works, despite the ordering of the orders themselves not having changed. I'll look into how to fix that but it definitely is an issue.
KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Re: [Patch] Slim Timetable Separation (new V60 out)

Post by KeldorKatarn »

This should fix it (as long as there's at least one station in the orders list...)

Code: Select all

	/* If all requirements for separation are met, we can initialize it. */
	if (_settings_game.order.automatic_timetable_separation) {
		int first_load_order_index = -1;

		for (int i = 0; i < this->orders.list->GetNumOrders(); ++i) {
			Order* order = this->orders.list->GetOrderAt(i);

			if (order->IsType(OT_GOTO_STATION) && !order->IsType(OT_IMPLICIT)) {
				first_load_order_index = i;
				break;
			}
		}

		if (this->IsOrderListShared() &&
			this->orders.list->IsCompleteTimetable() &&
			(this->cur_implicit_order_index == first_load_order_index)) {

			if (!this->orders.list->IsSeparationValid()) {
				this->orders.list->InitializeSeparation();
			}
			this->lateness_counter = this->orders.list->SeparateVehicle();

		}
	}
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 12 guests