News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

Add "All Go Home" button in schedule list window

Started by HyperSim, September 15, 2017, 06:52:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

HyperSim

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))

DrSuperGood

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.

Ters

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.

gauthier

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.

Ters

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.

Leartin

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?

Ters

Quote from: Leartin 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?

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.)

Isaac Eiland-Hall

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

HyperSim

Quote from: DrSuperGood 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?

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.

Quote from: gauthier on September 16, 2017, 03:16:47 PM
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?

Ters

Quote from: Isaac.Eiland-Hall 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.

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.

Quote from: HyperSim on September 16, 2017, 06:25:59 PM
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.

Leartin

Quote from: Ters on September 16, 2017, 07:58:44 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.

DrSuperGood

QuoteI 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.

Ters

Quote from: Leartin on September 16, 2017, 08:19:55 PM
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.

Quote from: DrSuperGood on September 16, 2017, 10:04:34 PM
"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.

Vladki

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.

Sent from my ONEPLUS A3003 using Tapatalk


Ters

Quote from: Vladki 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.

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.

Vladki

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.

Sent from my ONEPLUS A3003 using Tapatalk


HyperSim

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.

Isaac Eiland-Hall


gauthier

QuoteUnfortunately, 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.

QuoteIf 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).

HyperSim

Quote from: Isaac.Eiland-Hall on September 17, 2017, 11:41:38 AM
If no terminal, direct to depot?
I think it's the best way.

Quote from: gauthier on September 17, 2017, 08:47:52 PM
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?

Vladki

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.

Sent from my ONEPLUS A3003 using Tapatalk


gauthier

QuoteIf 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.

HyperSim

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

prissi

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.

Ters

Quote from: prissi 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.

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.

HyperSim

Quote from: Ters on September 24, 2017, 07:54:59 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.

HyperSim

Hello everyone,

QuoteHere'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?

prissi


HyperSim

Quote from: prissi on October 05, 2017, 07:44:33 AM
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.

Ters

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.

HyperSim

Here is a new release of "All to Depot" button.

QuoteHere'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

HyperSim

#31
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.

Isaac Eiland-Hall

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.

HyperSim

About a week have passed since last post.
Is there any problem with this patch?

Ters

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.