Vectorial1024 / ExpressBusServices

Buses skip stops whenever possible.
https://steamcommunity.com/sharedfiles/filedetails/?id=2262054175
MIT License
9 stars 0 forks source link

New feature: Redeployment by Teleportation #33

Closed Vectorial1024 closed 1 year ago

Vectorial1024 commented 2 years ago

I have thought about this but keep forgetting about this...

Not actually real teleportation, but hear me out.

Sometimes, when we want to redeploy buses, the distances that the bus has to travel is too long to be of any effective use. Assuming that bus depots are set up appropriately, there should be a depot much closer to the redeployment target than whatever termini that the bus may happen to be at.

Then, instead of sending the bus from the termini to the target, we can send that bus back to the depot, and then call the other depot to deploy a bus. Total number of vehicles is unchanged, but suddenly, it is as if the bus has teleported from one side of the map to the other. Efficiency is therefore greatly improved.

The way that I see this implementation, is to store a flag/value, and after we mark a bus for RTB, when the replacement bus comes out, we can cancel the flag/value and tell that bus to move to the specified target to start their shift.

Vectorial1024 commented 1 year ago

Useful knowlegdge:

10u on the map (road length) equals 40 in-game coordinate units. So by using the road tool as some sort of a "straight line ruler" to draw new roads and see what the road length is, I can easily estimate the corresponding in-game coordinates to determine if a certain distance is too far away.

Vectorial1024 commented 1 year ago

As far as I can see, 1 city tile should have a dimension of 240u x 240u, so this translates to a size of 960 x 960

Vectorial1024 commented 1 year ago

This should work fine now...

Vectorial1024 commented 1 year ago

Deployed on Steam; closing.

yackimoff commented 1 year ago

Would that work with IPT2, which assigns a depot to a line?

Vectorial1024 commented 1 year ago

It "should" work with IPT2.

This mod does not really manually order any depot to spawn a new vehicle; the game already handles that. (You can test this by using e.g. TMPE to delete 1 bus in a bus line, and if you pay attention to the line info panel, soon afterwards a new bus will be spawned by a depot.)

This mod simply tells the bus in question to go back to depot; and then the game's mechanism activates and spawns a replacement bus. Then, this mod activates again and tell the new bus to go somewhere else (which is the redeployment target).