Page 1 of 1

Auto separation

Posted: 18 Jul 2014 15:39
by pavel1269
Another auto separation patch. I tried to use the slim auto separation and some other one but I am constantly running into issues I don't like and I don't want to handle them by hand or worse, check if it even works. This version does not need any timetabling, it uses the implicit route times and as such, it handles changes of routes pretty well as it does not need times in timetable to be adjusted by hand. Also I am not setting vehicles to be late to catch up as they probably won't manage that anyway and instead I set others that they are early. The whole synchronization is happening at the first order and as such I heavily recommend to timetable that one, because waiting vehicles will change the implicit value accordingly which is not desired (it makes the whole route looks longer than it is).

Problem(s): -

edit: Problem solved, patch updated.
edit2: Patch which works with my day length patch now included as well.

Re: Auto separation

Posted: 14 Sep 2014 11:05
by Pyoro
Just wanted to say that it seems to be working. ;) Sort of would've expected the DL one to come with the DL-patch itself, but otherwise straightforward in application and use ^^

Re: Auto separation

Posted: 14 Sep 2014 19:19
by pavel1269
One one hand you are right, the "my DL" compatible version doesn't work standalone and as such it could be merged. On the other hand, if anyone would use my true day length patch already (own patch pack usually I guess), it would just complicate things.

Also thanks for the feedback as now I know at least about one person which is running this patch and it seems to work not just for me :) .

Re: Auto separation

Posted: 29 Jun 2017 18:28
by Pyoro
dunno if anyone is still using this, but it still works with a few small changes:
For src/saveload/order_sl.cpp the CONDVARs need to be VARs

Code: Select all

+		SLE_REF(OrderList, first,              REF_ORDER),
+		SLE_VAR(OrderList, auto_separation,    SLE_BOOL,   200, SL_MAX_VERSION),
+		SLE_VAR(OrderList, separation_valid,   SLE_BOOL,   200, SL_MAX_VERSION),
+		SLE_VAR(OrderList, next_vehicle_ticks, SLE_UINT16, 200, SL_MAX_VERSION),
+		SLE_END()
And the error message thing goes elsewhere now, if I got this right:
Needs to be removed in src/timetable_gui.cpp:

Code: Select all

+
+			case WID_VT_AUTO_SEPARATION:
+				uint32 p2 = 0;
+				if (!v->orders.list->GetAutoSeparated()) SetBit(p2, 0);
+				DoCommandP(0, v->index, p2, CMD_TOGGLE_AUTO_SEPARATION);
+				FOR_ALL_VEHICLES(v) {
+					SetWindowDirty(WC_VEHICLE_TIMETABLE, v->index);
+				}
+				break;
and added in command.cpp:

Code: Select all

+	DEF_CMD(CmdToggleAutoSeparation,							   0, CMDT_ROUTE_MANAGEMENT,	   NULL,			   GetErrConstant<STR_ERROR_CAN_T_TIMETABLE_VEHICLE>), 		   // CMD_TOGGLE_AUTO_SEPARATION