The International Simutrans Forum

 

Author Topic: Add "All Go Home" button in schedule list window  (Read 6254 times)

0 Members and 1 Guest are viewing this topic.

Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Add "All Go Home" button in schedule list window
« on: September 15, 2017, 06:52:21 PM »
Hello, all!

I developed a button to send all convoys in the same line to nearest depot, "All Go Home" button, in the schedule list window.

The feature
-When you press "All Go Home" button, all convoys in the line have been sent to the nearest depot.
-If you cancel the button, all convoys will return to the regular schedule.
-When no convoy is going to a depot after pressing "All Go Home" button, the button will automatically set to be unpressed.



If you use this feature, you can easily switch locomotives or carriages that are out-of-date, or add some cars when the capacity of the line is short.
This patch will help you to play simutrans more, especially playing with "timeline" option.

.diff file is in attachments. (for the latest source code (r8293 on Sep, 2))

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2524
  • Languages: EN
Re: Add "All Go Home" button in schedule list window
« Reply #1 on: September 15, 2017, 07:03:41 PM »
Surely "All to Depot" would be a better name for the button? Do convoys have a "home" as they are technically objects?

I think the biggest usability problem is that one can simply withdraw all convoys and buy new ones at the depot you want. There is seldom ever justification for the time and effort needed to send to depot and process the convoys. Let us not forget the spam it makes in network games as everyone gets notified about every convoy entering a depot, even if it has little to do with them.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Add "All Go Home" button in schedule list window
« Reply #2 on: September 15, 2017, 08:17:04 PM »
I usually send vehicles to depot to retire them, even for single vehicles, but vehicles have to be emptied before sending them to the depot, or the contents will be lost. This takes a lot of time. A button to send all to depot at once therefore doesn't seem useful. In fact, it might be harmful to players who do not know this. To avoid overcrowded stops while doing this, it is also a good idea to take out one vehicle at a time.

Another problem is that they may scatter to a whole bunch of different depots.

Offline gauthier

  • Devotee
  • *
  • Posts: 3620
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #3 on: September 16, 2017, 03:16:47 PM »
I agree with Ters, and to go further I would say that a better option is sending convoys to depot after terminus. That's how I usually replace vehicles on a line, I stay at the terminus, as convoys arrive here I set the empty button, send them to depot as soon as they unloaded everyone at the terminus station, and process them. Sometimes I replace a loc, sometimes I replace cars, sometimes I replace the entire convoy but want to keep the old one for other uses.

I know that's already partially doable by adding the depot in the line's schedule, but then I need to ensure that new convoys won't return to depot too.

A little further: a "go to depot after terminus" button (with a shorter caption, of course) in vehicle's window would be great for lines having heterogeneous stock.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Add "All Go Home" button in schedule list window
« Reply #4 on: September 16, 2017, 03:51:58 PM »
Unfortunately, the game has no idea what a terminus is. Furthermore, most of my train lines (in fact, almost everything except buses and mail trucks) have two. Unlike much else I do, I don't think that is particularly unusual.

Freight is probably easier, as most of those probably only serve two stops: One where they wait for a full load and one where they don't. And they usually don't load anything at the latter. However, I usually send vehicles to the depot next to the stop they load at, to avoid having to see the newer, and most likely more expensive, vehicle start its life by making a journey without profits.

Sometime, I do replacements/enhancements at both ends if I quickly need more capacity, or if the vehicles in question are slow and this causes a bottleneck for other vehicles.

Offline Leartin

  • Devotee
  • *
  • Posts: 1079
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Add "All Go Home" button in schedule list window
« Reply #5 on: September 16, 2017, 04:56:34 PM »
If the load is a problem, why not disallow loading while the button is pressed, and vehicles only go to a depot once they are empty?

Probably more work: What if you could set a stop at a depot in the schedule, which is ignored until the "All to Depot" button is pressed?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Add "All Go Home" button in schedule list window
« Reply #6 on: September 16, 2017, 05:46:56 PM »
If the load is a problem, why not disallow loading while the button is pressed, and vehicles only go to a depot once they are empty?

You would have no control over which depot it ends up in. (Unlike your next idea.) For me, that would not be much of an issue for buses (and mail trucks), as it basically ends up automating what I do anyway. And I usually don't have more than one depot near any given bus route. Trains are different, but it is mainly buses I send en masse to the depot. (I take out trains one-by-one for modification to avoid disrupting the service more than necessary. Buses can't be modified, only replaced, so I send out the replacements before I withdraw the old ones.)

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3594
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Add "All Go Home" button in schedule list window
« Reply #7 on: September 16, 2017, 05:54:08 PM »
So we clearly need a multi-depot interface that shows all the depots at once - basically a window that contains all the depots and you can scroll down to each one. Also the ability to name depots.

And need to be able to mark multiple stops in a schedule/line as "special". Then you can have multiple options for the depot-sending:

1. Send all to one named depot. (default: closest depot)
2. Send immediately, or send after empty, or send after the next "special" stop
3. Refuse loading and only allow unloading for the next stops until conditions are met (empty, or reaching special stop) to send to depot

The above would each be its own option. So you could set, for example, to send to one named depot + send after next "special" stop + only allow unloading until sent to depot

I don't expect this to happen, mind, but it would be nice - if we had a bunch of coders sitting around waiting to implement ideas. hehe

Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #8 on: September 16, 2017, 06:25:59 PM »
Surely "All to Depot" would be a better name for the button? Do convoys have a "home" as they are technically objects?

In the code, "Go to Depot" button is labeled as "go home", so I named this button "All Go Home".
I think translation file (.tab file in text folder) will solve this problem.

A little further: a "go to depot after terminus" button (with a shorter caption, of course) in vehicle's window would be great for lines having heterogeneous stock.

I support this idea and I'll try to implement it.
It would be nicer and more useful than my idea.

To identify "terminus", why don't you use loading time/rate options?
Is there any problem?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Add "All Go Home" button in schedule list window
« Reply #9 on: September 16, 2017, 07:58:44 PM »
So we clearly need a multi-depot interface that shows all the depots at once - basically a window that contains all the depots and you can scroll down to each one. Also the ability to name depots.

If that window somehow lists the contents of that depot, even disassembled parts, that would solve another problem I have of finding usable surplus equipment I might have stashed somewhere.

To identify "terminus", why don't you use loading time/rate options?
Is there any problem?

Rarely do my termini on passenger lines have anything special about them in the schedule.

For trains, if one of them has a minimum load set, it is the remote end of branch lines, and I might want to do the modifications to my trains at the hub end. This is because I either want to leave the surplus equipment there for easy transfer to other lines at that hub or to other hubs, or because I want to use equipment that has been left there by other lines or shipped in along the mainlines.

Buses may have minimum load set on either the hub end or the remote end, depending on circumstances. My first and only bus in a small town will wait at the station. Buses out to remote attractions on the other hand, will wait for a load at the stop by the attractions, so they don't block the bus stop at the station shared with possibly all the other lines in town.

The hub, or most major terminus, is usually the first entry, but not always. If it isn't, it is usually only preceded by a waypoint.

Offline Leartin

  • Devotee
  • *
  • Posts: 1079
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Add "All Go Home" button in schedule list window
« Reply #10 on: September 16, 2017, 08:19:55 PM »
If that window somehow lists the contents of that depot, even disassembled parts, that would solve another problem I have of finding usable surplus equipment I might have stashed somewhere.

Perhaps easier if at least disassembled parts are not stored per depot, but only once, and accessible from every depot? Not sure if it is useful for complete convois, since they would retain schedules with places you might not even reach from a different depot.
How about replacing the Arrow-Buttons that switch between Depots with a drop-down box (like schedules) to switch to different depots? Depots would always be listed by their name and coordinates. Name being the translation string for the type of depot or whatever the player set.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2524
  • Languages: EN
Re: Add "All Go Home" button in schedule list window
« Reply #11 on: September 16, 2017, 10:04:34 PM »
Quote
I usually send vehicles to depot to retire them, even for single vehicles, but vehicles have to be emptied before sending them to the depot, or the contents will be lost. This takes a lot of time. A button to send all to depot at once therefore doesn't seem useful. In fact, it might be harmful to players who do not know this. To avoid overcrowded stops while doing this, it is also a good idea to take out one vehicle at a time.
"Withdraw All" does this already. It only removes convoys after they are empty. Further more they are instantly removed so you do not waste any money moving them to a depot and neither do they generate traffic on ways to do so. Sure you lose the novelty down payment, usually 15% of convoy cost, however the inconvenience of sending to depot is well worth this and you can be sure all cargo gets delivered. In the mean time you are free to start your new replacement convoys.

Especially in pak64 convoy costs are a joke and most will pay for themselves multiple times a year. In pak128 they are less so but still earn so much profit that they cover maintenance and more than enough for their value deflation due to aging.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Add "All Go Home" button in schedule list window
« Reply #12 on: September 17, 2017, 08:20:47 AM »
Perhaps easier if at least disassembled parts are not stored per depot, but only once, and accessible from every depot?

Easier, but that's not what I want in this case. I want the real-life challenge of moving equipment around. I just need to know where it is.

"Withdraw All" does this already. It only removes convoys after they are empty. Further more they are instantly removed so you do not waste any money moving them to a depot and neither do they generate traffic on ways to do so. Sure you lose the novelty down payment, usually 15% of convoy cost, however the inconvenience of sending to depot is well worth this and you can be sure all cargo gets delivered. In the mean time you are free to start your new replacement convoys.

Especially in pak64 convoy costs are a joke and most will pay for themselves multiple times a year. In pak128 they are less so but still earn so much profit that they cover maintenance and more than enough for their value deflation due to aging.

But if all I need is an extra carriage on the trains, or a faster locomotive, modifying existing trains is less work than creating new ones. Especially finding the correct line to assign them to is a hassle.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2348
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Add "All Go Home" button in schedule list window
« Reply #13 on: September 17, 2017, 10:38:29 AM »
Perhaps this is a chance to get some features from extended back to standard. In extended there is an interface to upgrade a convoy, which will open a window similar to depot, and let you preset the replacement convoy. Once confirmed the convoy will stop loading cargo and go to depot when empty. A new convoy will emerge from the depot immediately. It has lot of knobs to twist.




Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Add "All Go Home" button in schedule list window
« Reply #14 on: September 17, 2017, 11:03:40 AM »
Perhaps this is a chance to get some features from extended back to standard. In extended there is an interface to upgrade a convoy, which will open a window similar to depot, and let you preset the replacement convoy. Once confirmed the convoy will stop loading cargo and go to depot when empty. A new convoy will emerge from the depot immediately. It has lot of knobs to twist.

That does not sound like what I want. For trains, I want the train to survive, just modified. For buses, I want the new vehicles to appear at the same time as the old vehicles stop loading. (Preferably heading out the the stop the corresponding old vehicle stopped loading.) It is also unclear what happens to the old vehicles. They should not be sold.

But as long as I have to option of keeping doing it my way, I don't mind.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2348
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Add "All Go Home" button in schedule list window
« Reply #15 on: September 17, 2017, 11:22:37 AM »
I said it has lot of knobs. One is to reuse existing vehicles, another is to keep/sell old vehicles, do it for the whole line or single vehicle, etc...

For buses, you can even now, do it another way. Just buy and dispatch new busses and, retire old ones - if i'm not mistaken there is already a button to stop loading and sell of send to depot when empty.




Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #16 on: September 17, 2017, 11:40:52 AM »
Now, I started with adding "terminal" option to the line dialog like this.



I'm going to use this method.
When "All to Depot" button are pressed, the convoy try to drive next "terminal" stop, and after the stop, the convoy is going to nearest depot.
I should consider some problem of this method, if there are no "terminal" in the line for example, but I think this method will solve the problem.

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3594
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Add "All Go Home" button in schedule list window
« Reply #17 on: September 17, 2017, 11:41:38 AM »
If no terminal, direct to depot?

Offline gauthier

  • Devotee
  • *
  • Posts: 3620
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #18 on: September 17, 2017, 08:47:52 PM »
Quote
Unfortunately, the game has no idea what a terminus is.
Obviously ... just take the first stop, it's as simple as that. Yes I know, there are loop lines with no terminus: then just don't load things that want to go farther than the first stop. That's already done when you insert a waypoint at the depot in a convoy's schedule.

I know it's not an optimal solution is some cases, but it's still a simple solution, not so hard to implement, a good compromise which, I think, is enough for a replacement problem that occurs once in some decades for a given line. It also assumes that depots are near termini of lines, indeed, but at least all convoys will go the same depot.

Quote
If the load is a problem, why not disallow loading while the button is pressed, and vehicles only go to a depot once they are empty?
You have a line (a nice bidirectionnal line with two ends) with many stops and convoys scattered along it. You press the magical button, all convoys stop loading anything, so all your stations soon start overcrowding until the new convoys are well in place while the old convoys could have kept taking people until the terminus (the first stop, yes).

Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #19 on: September 18, 2017, 12:05:44 AM »
If no terminal, direct to depot?
I think it's the best way.

Obviously ... just take the first stop, it's as simple as that. Yes I know, there are loop lines with no terminus: then just don't load things that want to go farther than the first stop. That's already done when you insert a waypoint at the depot in a convoy's schedule.
I know that and it looks a nice solution to solve this problem.
However, there are some problem.
If you don't want to send all of convoys in the line, you have to open schedule window of each convoy and remove depot entry after setting depot entry in line schedule window.  After deleteing, check where the convoy was going and set next destination.  Isn't it troublesome?
It does not happen frequently?  I don't think so.
In my case, many passanger convoys and a few mail convoy shere the same line, and I often change only passanger convoys.
If I want to withdraw passanger convoys, press "withdraw all" button, open mail convoys' info and cancel withdraw.
Why I have to do more steps than in case of withdraw?

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2348
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Add "All Go Home" button in schedule list window
« Reply #20 on: September 18, 2017, 06:47:24 AM »
Well I really recommend trying how replacement in extended works. It has options to replace all vehicles on line, all vehicles of the same type or just this one vehicle. Also something about scheduling but I am not sure how that works.




Offline gauthier

  • Devotee
  • *
  • Posts: 3620
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #21 on: September 18, 2017, 04:54:13 PM »
Quote
If you don't want to send all of convoys in the line, you have to open schedule window of each convoy and remove depot entry after setting depot entry in line schedule window.  After deleteing, check where the convoy was going and set next destination.  Isn't it troublesome?
Yes it is, that's why a button to go home after terminus would be nice on convoys too. But having it on lines is already a good start.

Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #22 on: September 23, 2017, 06:21:48 PM »
Here is a new release of "All to Depot" button.

I add "terminal" option button in the schedule dialog. (see the post above)
When the "All to Depot" button pressed, the convoys will go to depot after stoppint at next "terminal".
If there's no "terminal" in the line, the convoys imediately go to nearest depot.

I think passenger who want to go to the stop after "terminal" should not ride on convoy which is scheduled to go to depot, but it is not implemented yet.

.diff file is in attachments. (for the latest source code (r8293 on Sep, 2))
And you can also see source code on git.  https://github.com/HyperSimu/simutrans/tree/AllGoHomeButton

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Add "All Go Home" button in schedule list window
« Reply #23 on: September 24, 2017, 12:29:27 AM »
The withdraw all button is exactly for the purpose of replacing obsolete vehicles on a line. The reason is that all passengers going via a certain route will be lost when all vehicles enter the depots. The withdraw all will onlz affect running vehicles. Thus withdraw all, then buz a vehicle, assign a line and send them out while there is still one running will preserve all the pax.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Add "All Go Home" button in schedule list window
« Reply #24 on: September 24, 2017, 07:54:59 AM »
The withdraw all button is exactly for the purpose of replacing obsolete vehicles on a line. The reason is that all passengers going via a certain route will be lost when all vehicles enter the depots. The withdraw all will onlz affect running vehicles. Thus withdraw all, then buz a vehicle, assign a line and send them out while there is still one running will preserve all the pax.

DrSuperGood has already mentioned that, but we are not (just) addressing the problem of replacing entire vehicles. For trains (and perhaps trams), modifying existing vehicles is also an issue. Having them scatter to depots all along the line isn't the easiest way of dealing with that. Having them all go into no-load mode at the same time might not be ideal either.

Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #25 on: September 25, 2017, 06:07:13 AM »
DrSuperGood has already mentioned that, but we are not (just) addressing the problem of replacing entire vehicles. For trains (and perhaps trams), modifying existing vehicles is also an issue. Having them scatter to depots all along the line isn't the easiest way of dealing with that. Having them all go into no-load mode at the same time might not be ideal either.
I agree with you.  So, I provide a new option for this feature.



In the schedule list window, there's a "terminal" button.
You can set any stop as a terminal and as many stops as you want.
I recommend setting a stop near depot as terminal.



When you press "All Go Home" button, convoy show status "go home after terminal" and after reaching the next "terminal" stop from the current schedule.

If there's no "terminal" stop, convoys will go to depot directly.

However, there's an issue.
- passangers who want to go to a stop after the "terminal" are sent to depot too.

Here's my plan to solve this.
- Do not load passanger who want to go to a stop after the "terminal" when "All Go Home" button pressed.
- Unload all passanger at "terminal" stop to prevent passanger sent to depot.

Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #26 on: October 05, 2017, 04:34:57 AM »
Hello everyone,

Quote
Here's my plan to solve this.
- Do not load passanger who want to go to a stop after the "terminal" when "All Go Home" button pressed.
- Unload all passanger at "terminal" stop to prevent passanger sent to depot.

I'm trying to implement this feature, but I'm struggling because I can't find what function in the source code to change.
So, could you tell me which function works re-routing goods or people when the schedule of a convoy is changed?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Add "All Go Home" button in schedule list window
« Reply #27 on: October 05, 2017, 07:44:33 AM »
There is none. Rerouting is done at stations.

Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #28 on: October 05, 2017, 04:58:19 PM »
There is none. Rerouting is done at stations.

Really? When I change schedule (for example, remove some stops), the destination of passengers in the convoy will change immediately, I think.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Add "All Go Home" button in schedule list window
« Reply #29 on: October 05, 2017, 05:43:26 PM »
There might be a difference between changing the schedule of an individual vehicle, which causes it to stop while the schedule window is open, and changing the schedule of a line, which does not cause vehicles to stop.

Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #30 on: October 07, 2017, 02:42:57 PM »
Here is a new release of "All to Depot" button.

Quote
Here's my plan to solve this.
- Do not load passanger who want to go to a stop after the "terminal" when "All Go Home" button pressed.
- Unload all passanger at "terminal" stop to prevent passanger sent to depot.

I implemented these feature and fixed the bug I reported in the bug report topic. (see the topic below)
http://forum.simutrans.com/index.php?topic=17410.0

When a convoy arrives at a stop and it will go depot next, all passangers or goods get off the convoy and wait for next one come.
Now, no passanger will send to depot and disapper if the convoy does not go to depot directly.

Any questions or ideas for improvement are welcome!

.diff file is in attachments. (for the latest source code (r8300 on Oct, 7))
And you can also see source code on git.  https://github.com/HyperSimu/simutrans/tree/AllGoHomeButton

Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #31 on: October 09, 2017, 04:59:13 PM »
Here are screenshots of this release.
This pictures show you how it works.



I've already pressed "All to Depot" button, and this bus will go depot after stopping at City Hall stop(this is a "terminal" stop).
In this bus, 10 passengers are loaded.  8 will get off at City Hall but 2 want to go further.
In current simutrans, 2 will go to depot with convoy and disapper.



But now, 2 passengers got off the bus at City Hall too and start to wait.
And the bus is empty, so nobady will disapper!

What do you think about this feature?
I think all features have implemented for this patch to integrate standard.
« Last Edit: October 11, 2017, 04:07:45 AM by HyperSim »

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3594
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Add "All Go Home" button in schedule list window
« Reply #32 on: October 10, 2017, 06:31:47 PM »
Can't see screenshots, but this sounds like a need addition to have when it's integrated. :)

I think it's interesting to think about the simulated world vs. reality. Obviously, in reality, no transit authority would pull the buses mid-route, eject the passengers, send all the busses to the depot, then magically instantly be able to purchase new busses and send them out. lol. But in the reality of Simutrans, where passengers will wait days… months… years or more at stations waiting to be transported… it works. :) I mean to say: I think this is a great solution for Simutrans.

It's easy to remember to say in situations like this: I love that even after all this time, fresh ideas for making the game better and better still happen. What's harder to remember to say is thanks to everyone who fixes bugs and does all the background work that isn't so visible or causes much excitement, but keeps us all playing.

Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #33 on: October 17, 2017, 05:12:36 PM »
About a week have passed since last post.
Is there any problem with this patch?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Add "All Go Home" button in schedule list window
« Reply #34 on: October 17, 2017, 06:59:19 PM »
As already mentioned, there are some problems with the images. Some of us might have problems applying patches due to other work, and/or would rather see a preview of what it is. Or are just plain busy with non-Simutrans things. (I just got an apology for a patch being forgotten for a year or so.) Some might also like to comment on the looks without knowing how to apply patches or even how to compile.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Add "All Go Home" button in schedule list window
« Reply #35 on: October 18, 2017, 04:56:51 AM »
The patch removes a lots of stuff which can cause troubles, like wanting a convoi in a depot to send to one. When sending it out, it may be return to the depot after one round, because it can have the entry twice in its schedule. The comment
"// limit update to certain states that are considered to be safe for schedule updates"
is there for a reason.

Also adding a stop while its schedule is edited sound like a rife recipe for disaster. Same for sending convois to non-existent depots ...

A convoi could just check, if the next stop is a depot and otherwise unload everything as you do. This "is_terminal" is not very safe (what happens, if this emain stuck during loading and removing the depot before arriving?) I think a lot of extra stuff is there.

Finally, what happens, if I have all_go_home, then sent out new convois, then want to send them back all agin. The go_home state will stay untill all convois are in the depot, you could not trigger the button before.


Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #36 on: October 18, 2017, 04:44:38 PM »
Thank you for reviewing.  I will check my code again.

The patch removes a lots of stuff which can cause troubles, like wanting a convoi in a depot to send to one. When sending it out, it may be return to the depot after one round, because it can have the entry twice in its schedule.

I'm sorry but I can not understand well.  What do you mean "it can have the entry twice"?

Quote
Finally, what happens, if I have all_go_home, then sent out new convois, then want to send them back all agin. The go_home state will stay untill all convois are in the depot, you could not trigger the button before.

I want to use "All go home" button as "Withdraw all" button.
When I want to sell "almost all" convoi in the line, just press "Withdraw all". Then open convoi info window and cancel "Withdraw".
I suppose a situation that buses(or train) and mail van(or mail car) share the same schedule line and the situation is not so rare.
Then, how about sending almost all convoi in the line to depot?
I think "All go home" button should work as "Withdraw all" button does.
(You can cancel sending depot/selling for each/all convoi any time.)

Quote
As already mentioned, there are some problems with the images.

I made google photo album for who cannot see images I attached before.
I hope that now you can see how it works.
https://photos.app.goo.gl/wYB0GGeCzVTjr4523

Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #37 on: October 24, 2017, 03:01:15 AM »
Here's new release of this patch.

I solved these problems.
  • Problem with convoi that has indivisual schedule
  • Destroying depot where convoi is going (as prissi mentioned)
  • Some bug fixes

.diff file is in attachments. (for the latest source code (r8316 on Oct, 24))
And you can also see source code on git.  https://github.com/HyperSimu/simutrans/tree/AllGoHomeButton

Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #38 on: November 05, 2017, 02:10:23 PM »
About 10 days have passed and there's no reaction.
Are you reviewing my patch now? or just busy with other things?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Add "All Go Home" button in schedule list window
« Reply #39 on: November 05, 2017, 08:26:20 PM »
I've told you to be patient. Simutrans developers are not full time employees. They are hobbyist. It may take weeks to get some spare time for it. Bugs take first priority, and there has been some of them lately, including possible bugs in one of the bugfixes.

(Personally, I haven't even played Simutrans since this discussion started. I may play Simutrans almost every day for a few weeks, then not for months.)

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Add "All Go Home" button in schedule list window
« Reply #40 on: November 06, 2017, 02:00:43 AM »
You entered an unload all button, which is a little different from the go all home. But then this unloading only happens when there is a depot next, even though fully unloading before a depot does not need this (and I think I submitted this to the trunk already). Adding a terminal for the absolute rare case of going to depots is not a good idea. The code is long enough as it is.

You add new flags (like in-service) with to few comments (purpose, when set etc).

All in all, sending many convois to a depot is something which happens really rarely, since mostly this is done with outdated vehicles, and then withdraw them all is a more logicial choice. So yes, a withdraw all button is possible, but all the state logic around it is not likely to be included.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Add "All Go Home" button in schedule list window
« Reply #41 on: November 06, 2017, 07:12:16 AM »
withdraw them all is a more logicial choice.

Not for locomotive hauled trains, especially if all one wants to do is add more carriages. Unless the train only has two stops in its schedule, withdraw all will cause a drop in service while all the trains slowly empty over the course of a round-trip (or half of one). This causes overflowing, which might be exactly the thing you're trying to combat by adding more carriages. With all-in-on vehicles and fixed multiple-units, you can buy the new vehicles first so that they are already start filling in for the old ones (if there is room for them on the network). But with trains, you can often reuse the parts that are not obsolete yet.

I have no comments on the actual implementation, as I have not looked into it. Nor am I familiar with the code being changed from before.

Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #42 on: November 07, 2017, 07:19:44 AM »
You entered an unload all button, which is a little different from the go all home. But then this unloading only happens when there is a depot next, even though fully unloading before a depot does not need this (and I think I submitted this to the trunk already). Adding a terminal for the absolute rare case of going to depots is not a good idea. The code is long enough as it is.

You mean Terminal option for stop is not needed, right?
Then, this patch will become the one as I suggested at first.
When all go home button pressed, all convois will go depot directly.

Quote
All in all, sending many convois to a depot is something which happens really rarely, since mostly this is done with outdated vehicles, and then withdraw them all is a more logicial choice. So yes, a withdraw all button is possible, but all the state logic around it is not likely to be included.

When you use trucks or buses, theres little benefit by this button.
But when you use trains, especially locomotives and carriages, you sometimes want to add a few more carriages for each trains instead of replacing or adding convois.
This button should be useful in those situation. (And that is a situation when I want this button.)

Offline gauthier

  • Devotee
  • *
  • Posts: 3620
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #43 on: November 07, 2017, 05:59:34 PM »
Quote
All in all, sending many convois to a depot is something which happens really rarely, since mostly this is done with outdated vehicles, and then withdraw them all is a more logicial choice. So yes, a withdraw all button is possible, but all the state logic around it is not likely to be included.
I do this quite often. The typical situation:
_ Several lines opened in the same era, all with same kind of stock
_ All these lines get their demand increase with time, maybe some of them are extended
_ Now I have to satisfy the higher demand, I don't want to buy the same stock wich is now more than a decade old, but I also don't want to mix newer and older stock on the same line as older stock will cap performances of newer one. So I move old stock of the most important line to the others and put only new stock on this line. This replacement is done by waiting at the terminus to tell every old convoy individually to unload before the station, and go to depot after the station. Besides that, I launch new convoys when old ones leave.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Add "All Go Home" button in schedule list window
« Reply #44 on: November 09, 2017, 01:51:43 PM »
Would it not be easier to just change the line in each convoi your want to reassign? The extra detour to the depot seems then uneccessary.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Add "All Go Home" button in schedule list window
« Reply #45 on: November 09, 2017, 04:36:38 PM »
You still need to empty the train first.

Apart from that, in my case, it may take months or even years before the vehicles are put to use elsewhere, and for trains, it may be in a different configuration. I may have two lines using similar rolling stock. Traffic on one grows faster than the other, and I soon find that I need cars with higher capacity. So I send those trains to the depot one by one to replace the cars. Then I send that upgraded train back out as soon as possible. This causes a temporary decrease in capacity on the line, but not as drastic as putting all trains into unload only. Point-to-point lines suffer less than circular ones, since they only need to force unload at one end. Circular lines can take a complete circle to unload. I later on use the cars I just removed from the first line to extend the trains on the second line. Maybe I have some old, but still useful, locomotives in store to build new trains, for either the second line or some completely new line. I get the impression that is how it's done in real life as well.

Offline gauthier

  • Devotee
  • *
  • Posts: 3620
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #46 on: November 09, 2017, 07:03:01 PM »
Would it not be easier to just change the line in each convoi your want to reassign? The extra detour to the depot seems then uneccessary.
I also do that, but in fact it's even more complicated as you need to open the schedule window (stopping the convoy and eventually blocking ones after) and look for the line in a potentially very long menu. Sending convoys to depot, disassembling them and eventually reassemble some of them to go on another line is a less tedious operation.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Add "All Go Home" button in schedule list window
« Reply #47 on: November 09, 2017, 08:16:45 PM »
open[ing] the schedule window (stopping the convoy and eventually blocking ones after)

Sometimes I use this as a feature, but in this case, it is indeed a serious drawback.

Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #48 on: November 10, 2017, 06:30:07 AM »
I do this quite often. The typical situation:

I didn't imagine that situation but I understand that thing may occur and that is what real railway company do.
However, I doubt this patch will solve this problem but I think this patch may help you.

I repeatedly say that this patch will help these situation.
  • Sending some of convoys in the same line.
  • Adding cars in the same line or replacing only locomotive or cars.

The Transporter

  • Guest
Re: Add "All Go Home" button in schedule list window
« Reply #49 on: November 18, 2017, 05:58:01 PM »
It's  good idea.
Question:
Why must be a convoy (Train) empied when entering a depot?
It would be better to leave it loaded for a certain time.
if the conwoy is started again before the time is gone, all load stays in the convoy. after this time the convoy is automaticly emptied.
This would be helpfull for Trucks (adding or removing Trailer) and Trains (adding or removing Trailer or Lokos. For Busses, Ships and Airplane it is not required.

Offline HyperSim

  • *
  • Posts: 104
  • Languages: EN, JP
Re: Add "All Go Home" button in schedule list window
« Reply #50 on: November 19, 2017, 01:10:23 AM »
Question:
Why must be a convoy (Train) empied when entering a depot?
It would be better to leave it loaded for a certain time.

Well, at first, the convoys go directly to depots and they don't unload anything.
However, it may cause that convoys are scattered in some depots, so I implemented "terminal" feature.
In the discussion, I thought that it is not good when a convoy goes to depot, the passanger (or freight) in the depot will disapper.
I reported it and the developers fixed it.
Anyway, if you don't set any "terminal" in the line, convoys go directly to depots.