News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

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.

prissi

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.


HyperSim

Thank you for reviewing.  I will check my code again.

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

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

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

QuoteAs 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

HyperSim

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

HyperSim

About 10 days have passed and there's no reaction.
Are you reviewing my patch now? or just busy with other things?

Ters

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

prissi

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.

Ters

Quote from: prissi on November 06, 2017, 02:00:43 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.

HyperSim

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

gauthier

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

prissi

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.

Ters

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.

gauthier

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

Ters

Quote from: gauthier on November 09, 2017, 07:03:01 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.

HyperSim

Quote from: gauthier on November 07, 2017, 05:59:34 PM
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

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.

HyperSim

Quote from: The Transporter on November 18, 2017, 05:58:01 PM
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.