News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

[patch] new schedule options

Started by gerw, November 04, 2008, 06:12:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gerw

I wrote a new patch for simutrans which adds two schedule option.

The first option is "skip stop if full". If this option is choosen, a full train will skip a station if he can't unload there anything. He will not skip checkpoints.

The second is "leave stop if convoi of same line arrives". Sounds like Rollercoaster Tycoon and there it comes from ;) This option is only available for lines. If a convoy arrives in a station he will causes all convoys (waiting for x%) of his line leaving this station.

Both options can be justified in the schedules dialogue.

Feel free to discuss!

Edit: prissi mailed me two threads where this options was discussed in the past:
Skip station if full:
http://archive.forum.simutrans.com/topic/03235.0/index.html

Leave if other train arrives:
http://archive.forum.simutrans.com/topic/05125.0/index.html

VS

#1
I can't really say much since my route/line construction habits leave little room for this "dynamic" kind of behaviour.

About skipping stations: If the train does not stop, where is the advantage? It has to drive through the same place again, no?

As I see it, both options enrich possibilities of routing when platform selection is used frequently. Which is good news, since this is how many people build their networks... and I don't :)

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

whoami

#2
If I have understood the patch correctly, then the convoy will *entirely* skip a stop marked "skip stop if full" if
- the convoy is full and
- the stop is not a waypoint and
- the convoy has nothing to unload there
This may work well for road vehicles, ships and airplanes, but not for track-bound vehicles, because they depend on matching tracks and signals. Using the skipped station as a waypoint (instead of moving directly to the next schedule entry) would still be an improvement, because the convoy wouldn't have to reaccelerate.
I am not sure about the performance penalty of checking the next halts for all contained goods "packages" in the loop. (For passengers and mail, the number of those can be quite high.)

Regarding the "leave stop if convoi of same line arrives": it sounds useful as an additional abort condition for the "wait until full" function.

maister

Nice !! Thank you very much !! I would use this options surely. *a big hurray*
first option: all clear
second option: would be nice if the train in the station start a little bit earlier, that the second train not must wait before the gate is free. Completive the player can that define how long the train wait in the gate. It`s there a chance?

Are this options also by the aircraft and truck lines available?
" border="0 (swiss) *pak 128*

prissi

To enrich the discussion my personal remarks on this.

The skip stop if full I am not liking very much, for the reasons discussed in the old forum. SImutrans has a quite static routing system, and I would like to keep this without any surpirses (which is why I was very skeptical about the choose signal and still very seldomly using it.) Furthermore, any bus does not know beforehand nobody will get off at a certain stop; neither it knows that nobody is waiting there. Apart from the issue that a delivery at a station after departure will not register until next time. More worse, given that more than one bus is doing this schedule, then the bunching of busses will get even worse. To conclude this is very unrealistic and introduced a lot more on undetermined routing issues and convoi bunching problems.

The second option is imho unnessessary for a proper game, since with the right number of convois there is no need to have this. If you need this behaviour, you are running too many convois. It removes a quite simple but core challenge from the game, i.e. do not waste resources liek convois; furthermore it force people to use lines and will give rise to many other demands like wait for another line, wait for convoi xyz and so on. But my main point is that is facilitates wasting of resources and forces to play with lines.

If you even had a look at the schedule option of a recent OpenTTD version, you will see what I want to avoid ...

whoami

#5
Quote from: prissi on November 04, 2008, 09:08:14 PM
SImutrans has a quite static routing system, and I would like to keep this without any surpirses
Because of that, I suggested to still treat the to-be-skipped stop like a waypoint.

QuoteFurthermore, any bus does not know beforehand nobody will get off at a certain stop; neither it knows that nobody is waiting there.
As to my experience, a bus driver will not stop at a bus stop (but may slow down) if nobody waits there *and* nobody presses the halt request button. The patch simulates the second part of that, and the first would be easy to add on top. This would lead to some speed-up of busses for suburb stops with little passenger generation. Mail and goods trucks would, for realism, still have to stop to check for things to be loaded, *unless* they are full *and* don't have to unload anything there.

Combuijs

QuoteFurthermore, any bus does not know beforehand nobody will get off at a certain stop

In real life you mean? Because in Simutrans it is known for the next stop.
Bob Marley: No woman, no cry

Programmer: No user, no bugs



isidoro

My opinion is:

  • Skipping a station if full and nothing to unload:  I like it.  In real life, one can know if there is anything to deliver or people can push the "ask for halt" button.  I would skip the station entirely.  I wouldn't make it a waypoint.  I'm with Prissi in that it should be optional, since in some routes (specially rail ones) it can break a schedule.  Busy mail lines would be a little more profitable too.
  • Skipping a station if nothing is waiting for us to load or unload (proposed in the thread in the old forum): seems more unrealistic to me.  Generally, I would say that I have to stop there to know if there is something for me or not.
  • Making a vehicle leave if other arrives: I don't think I would use it.  I always reserve a platform for every waiting vehicle.

There may be an issue about performance though.  If I have a A,B,C,D route and I am in A and have to skip B and C, the vehicle should recalculate the route and that is time consuming.  Otherwise, skipping is not such an advantage.

Thinking about the issue, another option for the schedule window occurred to me:  turning the "Replicate backwards" button into a check box.  It would then be easy to modify one such schedule.  Besides, all that sort of lines and routes will spend half memory.

z9999

#8
Skipping a station if full and nothing to unload: I support this idea. I like it. But the position of UI button might confuse players.

Making a vehicle leave if other arrives: I never use this. There is no merit for me.



When A* was added in simutrans, people said "Why my bus don't run the same route, this never happen in RL.". That was big surprise for us. :)

gauthier

If you don't like, you don't use ;)

I'm looking forward to see this patch in nightlies. I support all of new options !

VS

Quote from: gauthier on November 05, 2008, 11:35:30 AM
If you don't like, you don't use ;)
Hehe, I more or less identify with this stance... In this case it can even work.

On the other hand, bloating the game with enough options to make two games isn't good either!

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

prissi

And I have to explain users  and maintain it then for long times. Thus I would like to include only stuff a majority uses.

maister

Something that not hurts the transportation but enrich. This patch enrich and not hurts the transportation. If this patch unwanted, how can this game developed in the Future? I see this game in the future, over the time, as most played game ever. But i think thats only works, if the game has more content than the commerce trash.
" border="0 (swiss) *pak 128*

Dwachs

I like both options. The first one is useful for bus ring lines. Usually I build such lines with one railway station on the schedule. If the bus is full and does not need to travel all other scheduled stations that will help alot. Has such a behaviour some negative consequences internally? So that some information is not updated if the buses does not drive to all stops?

The second one I would like to use for transporting goods. There it may happen that a producer did not get material from the supplier and so the stations nearby are full of trains waiting for full load.
Parsley, sage, rosemary, and maggikraut.

whoami

The first option seems to be meant (and implemented) on a per-schedule basis. For track-bound convoys, it needs to be settable per halt (unless the halts are treated as waypoints instead). Otherwise, trains will choose random routes between any halts without the user having control over that, which is a no-go.

Combuijs

QuoteAnd I have to explain users  and maintain it then for long times

I can see the point Prissi makes here. It's absolutely true, making the code does not take much time (relatively speaking), most of the time is spend maintaining it. And if it's an often used option, then that time spend is worthwhile, but if it's just filling a niche, you should be careful about including it.

QuoteSomething that not hurts the transportation but enrich

Definitely not true. If there is a small bug in it that has consequences for normal play (e.g. play that does not use this option) it might really hurt and destabilise you whole program. Further it makes programming the game more complex and therefore more error-prone and unstable.

QuoteThe first one is useful for bus ring lines

Yes, true, I like this option. Very useful. But how do you explain unsuspecting users that the bus is not following its designated route. Especially with track (trains, tram) the vehicle might take unexpected and unwanted routes. Your whole network might come to a stop if you are not very careful. Already the "wait for full load" option can block your whole network if you are careless, but that's easy to detect. This one is a lot more hidden. I don't know, I'm still in doubt about this option.

The second one is not that useful in my opinion and "dangerous" in the sense that it might lead to other related extension requests (leave when other lines arrive or when any vehicle arrives) which might seriously complicate the game. (For example, after the introduction of the choose signal, the end-of-choose signal had to be introduced. The choose signal is still not well understood by a lot of users.)
Bob Marley: No woman, no cry

Programmer: No user, no bugs



gerw

Quote from: Combuijs on November 05, 2008, 07:30:39 PMYes, true, I like this option. Very useful. But how do you explain unsuspecting users that the bus is not following its designated route. Especially with track (trains, tram) the vehicle might take unexpected and unwanted routes. Your whole network might come to a stop if you are not very careful. Already the "wait for full load" option can block your whole network if you are careless, but that's easy to detect. This one is a lot more hidden. I don't know, I'm still in doubt about this option.

Before the trains do ugly things the option has to be checked in the schedule GUI.

I think it's important to improve the features of the game but otherwise it's not very nice if you have thoundsands tabs of options (like in OTTD). So we have to decide very well which feature should be included and which not! So please go on :)

Tillo

Hey, I like your patch. But I think it would make much more sence if it worked exactly the other way:

Let convoys depart, that are NOT on the same line or that are on a specified line. This way you can create feeder lines, that feed other lines with passengers. This also can solve much of the schedule problem (see others topics about it and the high demand for precise timetabling).

I will explain one scenario in which this feature will be very useful. You have a suburban railway that covers a region of a city. At each station outside the city there is beginning a bus line, that covers the local area around the station. These bus services have conventional simutrans schedules with a medium or high maximum wait time at the beginning of the line.
The suburban railway uses this modified schedule: Every time it arrives at a station the buses immediatly depart. This way we have the optimal solution for passenger friendly connections. In order to finetune the system we just need to ensure that there is always a bus waiting at the first stop, when a train arrives (quite simple).
So we have simple but good shedules.

To improve the patch we make this setting station specific (so trains going to the city with only few passengers changing for the bus will not make the buses depart).
Another improvement could be to select the lines which should be affected. This way we can avoid that at bigger stations others trains depart due to our trains arrival although we just want to make our bus lines (or specific bus lines) depart.

The Code without these optimizations should look similar to this:

         halt->book(1, HALT_CONVOIS_ARRIVED);
         state = LOADING;
         go_on_ticks = WAIT_INFINITE;   // we will eventually wait from now on
+         if (line.is_bound() && line->get_fahrplan()->leave_arrive){// Other convoys have to leave.
            vector_tpl<linehandle_t> lines(0);
                     simlinemgmt.get_lines( simline_t::line, &lines);
                     const uint32 offset = simrand(lines.get_count());
                     for (uint32 h = 0;  h<lines.get_count();  h++  ) {
                           linehandle_t line = lines[(h+offset)%lines.get_count()];
+               for ( uint8 i = 0; i < line->count_convoys(); i++){
+                  convoihandle_t other_convoi = line->get_convoy(i);
+                  if (other_convoi != self && other_convoi->get_state() == LOADING && other_convoi->gib_fahrplan()->aktuell == fpl->aktuell){
+                     // This convoy is loading in the station we arrived at.
+                     other_convoi->drive_to_next_stop();
+                     other_convoi->state = ROUTING_1;
+                  }
+               }
+            }
         }

(I am programming - only as a hobby and only in java - and have never touched simutrans code before so the code will contain errors - but I hope you understand what I want to tell you xD. Hint: in this code all convoys at that station are departing - we should avoid departs of trains on the same line)

I think the first mentioned improvement should be quite simple to implement - save the setting not line wide but per station/position in a line. The second one is more sophisticated because I never saw a multi item selectable component in simutrans (as far as I know right now) which would be nesscessary to make it easily possible to select the lines you wish to influence - per station of course.  This list then should be filtered by lines that stop at that specific station and no others.

Do you also think this would be an very interesting feature - especially for passenger transport - concerining the minimization of waiting times at interchanges?

Best regards - Tillo

Isaac Eiland-Hall

Well, bear in mind that this topic is 3.5 years old...