Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buses still stops at bus stop #1

Closed
jackfood opened this issue Oct 21, 2020 · 16 comments
Closed

Buses still stops at bus stop #1

jackfood opened this issue Oct 21, 2020 · 16 comments
Labels
enhancement New feature or request

Comments

@jackfood
Copy link

jackfood commented Oct 21, 2020

I am not sure if this is an issue or is it intended.

I have a line of 5 stops, there are 2 stops without people alighting or boarding. the buses will enter the empty bus stop, stopped and resumed service immediately if no passenger movement for that stop. Although the bus resumed faster than the vanilla, is it suppose to have a very brief stop at every empty bus stop or is it a drive-by (non-stop)? Of course, this does not include the starting of the line where there is unbunching for the buses.

@Vectorial1024
Copy link
Owner

Yes, the "stop at (non-terminus) bus stop and depart immediately" is intended and is a result/limitation of how the game works.

Basically, with this mod installed, the bus stop procedure looks something like this:

  1. General event occurs: bus arrives at bus stop
  2. Bus AI tries to unload passengers
  3. I count how many is unloaded
  4. Bus AI tries to load passengers
  5. I count how many is loaded
  6. Enter loop:
  7. If non-first bus stop & loaded + unloaded = 0 then depart immediately, else (other waiting conditions)

If the bus do not stop at bus stops, then there is no loading/unloading, and I cannot count, and so the mod would not work.

PS: buses still need to stop at bus stops to pick up and drop off potential "equivalent route" passengers from other bus lines. It is a bit difficult to explain explicitly, but you can try to see for yourself by duplicating a bus line in your city, give the two of them different colors, and watch as they pick up passengers from their own line and from their duplicated line.

@Vectorial1024 Vectorial1024 added documentation Improvements or additions to documentation wontfix This will not be worked on labels Oct 21, 2020
@jackfood
Copy link
Author

jackfood commented Oct 21, 2020

Thank you for the wonderful mod and reply.

Though i do not know much about coding, though learn some visual basic years ago
and I wouldn't know about the limitation of CSL, asking maybe possible to perform such procedure,

  1. General event occurs: bus arrives at bus stop
  2. Check next bus stop & count number of passenger
  3. check load for current bus stop passenger
  4. check unloaded at next bus stop
    4a. If next bus stop no. of passenger = 0, and unloaded at next bus stop = 0, then loop + 1 check next next bus stop
    4b. else destination = loop number to skip station
  5. Recorded station ID = drive.

I am not sure possible to check next bus stop along the lines

@Vectorial1024
Copy link
Owner

It seems you are proposing the following procedure, I try to understand it:

  1. General event occurs: bus arrives at bus stop
  2. Unload, load, count passengers, etc.
  3. With or without leaving the bus stop, enter loop:
    2a. Safely find the next bus stop that requires loading/unloading
    2b. Exit loop if such bus stop exists (avoid infinite loops)
  4. Drive to that bus stop

Practically, the loop part will be part of the game simulation ticks.

I can think of a problem with the above procedure is that, I as the bus AI will not know where I am at when I wake up in the middle of the bus journey and look at my notes (i.e., the data that is stored by me).

Let's say I am at the 1st stop of line. After unbunching, and before I start the bus, I determine that I should travel straight to the 5-th stop in line. And so I start the bus, write down that "I left the 1st stop and will now travel to the 5th stop", plot a course to the 5th stop, activates auto-pilot, and sleeps.

Now suddenly I am woken up by a signal: "someone arrived at the 3rd stop of the line". I tell myself, "OK, because 3 < 5, and someone arrived there, I should update my notes. I should travel to the 3rd stop if I still haven't arrived at the 3rd stop.".

The problem appears: where am I in the line? Am I at the 2nd stop? Am I in the middle of the path from the 2nd to the 3rd? Or am I already past the 3rd, and is already approaching the 5th and will arrive at the 5th in seconds? Did I pass the 3rd stop? Or am I just slowly driving my way there because traffic is dense today? I do not know, because the last thing(s) I wrote are "I left 1st" and "I will arrive at 5th", nothing about "3rd" is written. There is no way to tell where I am at in the bus line.

"Perhaps just check the map, then," I say. But checking the map is expensive, because I now have to think hard where am I in the GPS grid system? What is the driving path of this bus line that I am in charge of? Am I able to know that path as a bus driver, or is it buried deep inside the game and I have no easy way of knowing it? And it may not work 100% of the time, because it may be that the bus line is extra roundabout, and the direct path from the 1st to the 5th is not equal to the cumulative path if I travel along 1st-2nd-3rd-4th-5th in order.

And there is the potential problem of "passenger arrives at bus stop but buses already decided to skip stop a long time ago", which leaves the waiting passengers waiting in vain.

And so it would not be a good procedure to skip stops ahead of time before actually arriving at the said stops (or getting very close to it) and then skipping it, because then I won't know where I'm at, and some passengers will be sad.


At some point in programming, it is no longer about whether the program can be written like this (even though there are problems that you cannot solve using a program), but rather whether it would be good to make it work like this.

@jackfood
Copy link
Author

jackfood commented Nov 7, 2020

Thank you for the effort to write a detail explanation on this for me to understanding better.

@helloiamson
Copy link

Hi, not sure if I spotted a bug.

It seems like the skip-stop behaviour is only occurring when a vehicle is also empty (i.e. zero passengers on board). If the vehicle carries some passengers, no skip-stop behaviour is observed even when nobody needs to board or alight at the stop.

Would greatly appreciate a fix if it is really a bug. Thanks.

@Vectorial1024
Copy link
Owner

Vectorial1024 commented Nov 26, 2020

Because it seems you are using IPT2 with this mod (and the sister mod), did you mean the situation happened when it is used together with IPT2?

Edit: it still happened without IPT2, so this is definitely a bug.

Edit2: confirmed; it happened because I mistakenly added two values together: people dropped and people still on the bus. This has the unintended effect where if the bus already has some passengers and no one drops, it will not insta-depart.

@Vectorial1024
Copy link
Owner

With ModTools available (I started off without knowing that it exists) I now begin to notice the severity of the problem. The bug is so bad that this mod might have been a false advertisement.

Basically the mod fails when there is someone (>= 1) inside the bus. Just that, in my testing (and playthrough), I don't place bus stops at those not-yet-developed areas, and inner-city bus-full pass-through scenarios are hard to catch.

@Vectorial1024
Copy link
Owner

It is now fixed.

Next time it would be better to open a new topic. Originally this started as a post on the design and features of this mod, and then suddenly it became a bug report of this mod albeit being very similar in topic.

Leaving open for a longer while for now.

@helloiamson
Copy link

Thanks for the fix. Everything is working as intended.

@Vectorial1024
Copy link
Owner

Unexpected update: klyte45 from TLM actually made something that is very similar to the original proposal above, thereby shattering my earlier point about it being undoable. I must admit here that I shot down the idea originally because of my lack of experience in how CSL works and my lack of time to go into details, thus preferring a simpler solution aka the current solution of stop-and-check.

As permitted by klyte45 themselves I may later learn from and adapt their code to update this mod with the proposed features.

See this issue on their side for more details: klyte45/TransportLinesManager#37

@Vectorial1024 Vectorial1024 added enhancement New feature or request and removed wontfix This will not be worked on documentation Improvements or additions to documentation labels Apr 20, 2021
@thomaschow19
Copy link

Hi, I am from Hong Kong as well. Would be nice if you could kindly update on this issue. I personally find TLM a bit too complicated to use and would prefer a simpler mod that focuses on one task. It would be very nice for all those "Chair-Movers" to skip stops. Thanks

@Vectorial1024
Copy link
Owner

Hi there!

Originally my plan was to follow this up some time after TLM implemented their skip stop behavior, but later on I forgot about this lol

It has been nearly 1 year (wow), so this is good enough timing to follow this up and implement their stuff on our side; but because I still have real life things to do, I can't immediately work on this.

@Vectorial1024
Copy link
Owner

Update:

I have tried to reverse-engineer the relevant logic from TLM, but the tech is much harder than expected. Currently the new feature is at a stage of "should work but does not trigger". Basically, no effect: even when I add in debug log in every branch, I cannot see any log myself.

So unfortunately this will have to be put back to the end of the queue...

@Vectorial1024
Copy link
Owner

Update:

The reverse-engineering worked, and it is triggering correctly. Therefore this has been released on Steam.

The first issue of this mod, originally thought to be impossible, now implemented thanks to the code by Klyte45.

Closing this.

@thomaschow19
Copy link

Hi, thank you for the work and effort you have put into this mod. However, the bus appears to be still stopping at the bus stop for a split second before carrying on. (bus stop has no passenger and bus has no passenger - its a test line that goes to nowhere).

Could you please advice if this is still the expected behaviour? Thanks

@thomaschow19
Copy link

After investigating further, it appears that since I am updating from an earlier version of the mod, the mod settings button would not appears until deleting and re-subscribing to the mod.

After adjusting the settings it works flawlessly. Thanks from Hong Kong!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants