The International Simutrans Forum

 

Author Topic: Make ships respect the principle of impenetrability of matter  (Read 654 times)

0 Members and 1 Guest are viewing this topic.

Offline garro

  • *
  • Posts: 9
I don't understand why ships can penetrate each other. They should work like the other vehicles and should need more docks to be able to stop at the same moment in a harbor.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1222
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Make ships respect the principle of impenetrability of matter
« Reply #1 on: June 04, 2019, 01:04:26 PM »
There is no such thing as "blocked water". You may have noticed that ships not only pass through other ships, but also through docks and water-based buildings (oil platforms, ship depot,...)

Note that no vehicle in Simutrans changes it's route just because the planned route is blocked, they only do something like that at a station if a signal tells them to. Ships would follow the same logic, so if they had to wait for a free dock, they would all wait in line. A line which potentially could block other ship traffic that goes perpendicular to it. It's not really a better scenario than what we have now.

As for the free docks, I could see ships needing their own tile in a station. They would pass through other ships to get there, of course. Though for ships, each tile within the station coverage is a valid stop. This means just one dock on a straight coastline would enable ten stopping points for the ships. Makes one wonder if forcefully seperating them for the stations would really be worth it.


Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5488
  • Languages: EN, NO
Re: Make ships respect the principle of impenetrability of matter
« Reply #2 on: June 04, 2019, 02:50:59 PM »
Technically, all vehicles can pass through each other, and you can quite easily get them to do so. For trains, signals alone usually prevent this from happening. Road vehicles won't enter a tile with another vehicle going in the same direction or across. Aircraft behave somewhat like trains for runways, like road vehicles for taxiways, and like ships when in the air. None of them will change course due to other vehicles, as this is difficult to make sensible and fast. Why ships completely ignore each other, I do not know, but it might be that it would look equally silly for them to suddenly stop and then start again each time meet. There is no roads to reserve on the open seas, so they won't react to other ships until they are right next to each other. Graphics in Simutrans is also somewhat symbolically, especially at the original 64 scale, so perhaps ships aren't really as big as they look, and therefore conceptually just pass close to each other, not through.

Offline Matthew

  • *
  • Posts: 164
  • Languages: EN, some ZH, DE & SQ
Re: Make ships respect the principle of impenetrability of matter
« Reply #3 on: June 05, 2019, 04:45:20 PM »
As for the free docks, I could see ships needing their own tile in a station. They would pass through other ships to get there, of course. Though for ships, each tile within the station coverage is a valid stop. This means just one dock on a straight coastline would enable ten stopping points for the ships. Makes one wonder if forcefully seperating them for the stations would really be worth it.

This could be strategically as well as cosmetically useful if you have scheduling (as Extended does), depending on the implementation.

At the moment, you can't make ships 'queue', so any ships in harbour will depart once the next scheduling point is reach. That is, you cannot use the scheduling feature to distribute ships (across time) automatically: you must manually send out ships at the intervals you want. If different sea tiles worked like different railway platforms, then perhaps the scheduling algorithm would queue them up.

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3651
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Make ships respect the principle of impenetrability of matter
« Reply #4 on: June 05, 2019, 07:57:14 PM »
In addition to what some have already said… a tile-reservation system for the ocean would probably be very complicated for very little return. I suppose ships could reserve ahead 2-3 tiles, but that would probably mean ships having to recalculate their routes every time two of them met, which would probably be expensive. But around a busy dock, it would probably be a nightmare and utterly unpredictable and undesirable.

But also regarding the scale: I don't think a single pak is intended to have a 1:1 scale for graphics. I think the pak.Britain for Extended is the closest, but even it is like 1:4 or something. Pak64 was intended to represent, on one scale, 1 tile = 1 km², although on a graphics scale IIRC it was 1 tile = 20m². That last figure may not be right.

It would be a nice visual if ships didn't cross each other, but one that's probably not worth the programming cost or game slowdown cost.

Also, you'd have to figure out a choose-dock-tile buoy and make ships pass through it to use different dock tiles. :) Although that's probably the most reasonable part of this to solve since real ports often have pilots that meet ships and guide them in, so that might work. :)

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5488
  • Languages: EN, NO
Re: Make ships respect the principle of impenetrability of matter
« Reply #5 on: June 05, 2019, 08:03:33 PM »
I suppose ships could reserve ahead 2-3 tiles, but that would probably mean ships having to recalculate their routes every time two of them met
I think vehicles will never recalculate their route underway. That is perhaps the most core principle in Simutrans. While ships might reserve, other ships would then have to stop on a dime, and then slowly accelerate back up to speed.

It would be a nice visual if ships didn't cross each other, but one that's probably not worth the programming cost or game slowdown cost.
Artist could simply paint the ships so that they only occupy one side of a tile. That way at least ships meeting would never visually intersect. I believe ships always pass on the same side all over the world, unlike land vehicles.

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3651
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Make ships respect the principle of impenetrability of matter
« Reply #6 on: June 05, 2019, 08:11:30 PM »
the most core principle in Simutrans

Then that simply and definitely makes the issue even easier to say "Will never be", alas.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2647
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Make ships respect the principle of impenetrability of matter
« Reply #7 on: June 05, 2019, 09:39:49 PM »
Scheduling ships in extended works quite well. I have had several ships on the same tile waiting for departure and every ship had different time. But sometimes it happens that two ships depart at once.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2678
  • Languages: EN
Re: Make ships respect the principle of impenetrability of matter
« Reply #8 on: June 06, 2019, 05:11:56 AM »
The problem is that it would mean that ships could very easily become stuck, and with no fault of the player. A busy dock might become stuck purely because too many ships happen to arrive at it at the same time, something the player cannot really control.

The reasons it does not happen in real life...
  • The Ocean is big, very big. More of Earth is covered by water than by land. For gameplay reasons this is usually not the case with Simutrans maps where one wants more land than water to build nice rail networks.
  • Hundreds of thousands of people devote their life to maintaining water ways and planning water journeys or helping ships avoid collisions. Everything from planning shipping lanes to coordinating ships offshore around busy ports. Computers have nowhere near the AI capabilities of a single human let alone hundreds of thousands. Coding fool proof logic for this is not something a hand full of developers can do.
Although one might not be able to stop ships overlapping. One could at least make ports appear more realistic. For example only allowing 1 ship to dock at 1 adjacent to dock tile at a time as well as adding longer loading delay for ships (eg 15-60 seconds). This would force players to build larger ports to accommodate shipping traffic and make busy port operation look more natural.

Water journeys would need to be broken into 3 stages. Undocking, a shipping lane and then docking. Each port would be surrounded by the docking area, which queued ships ordered to space out around it or move to a unique dock similar to how choose signals work. Undocking resolves a path to the shipping lane. The shipping line is a cached/shared long path for performance reasons as water path finding can be expensive. Finally the docking finds a free dock at a port and calculates a path from the end of the shipping lane to it, which should not be too computationally intensive given the finite area to work with. Queued ships are ordered to move to an edge tile of the docking area, again the path finding for this should not be to complicated. There is plenty of potential to cache paths to/from docks as well as queue points to further improve performance.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1222
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Make ships respect the principle of impenetrability of matter
« Reply #9 on: June 06, 2019, 06:34:27 AM »
adding longer loading delay for ships (eg 15-60 seconds).

This can be done already, on a ship-by-ship basis. Just it does not matter much, since the ships would not block the dock anyway. Rather, it would just make it more likely that they move through each other.

Water journeys would need to be broken into 3 stages.
There is potential for a fourth stage, for rivers/channels. Those could have ships act just like cars, with only one per tile/direction. There is hardly a chance that causes them to get stuck (at least no more than cars, and the player should know how to deal with that), and conceptually, rivers are not quite as big as oceans, so the vastness arguement does not apply.
It's also useful to differentiate a sea-harbour from a river-harbour, since on the river, even the station behaviour would better be like cars.

But in general, I like the idea of ships behaving similar to planes. Just instead of circling around the airport waiting for a chance to land, they pick a spot to anchor until further notice. This allows you to see how many ships are waiting at a glance, at least until all free spots at the harbour edge are filled.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9469
  • Languages: De,EN,JP
Re: Make ships respect the principle of impenetrability of matter
« Reply #10 on: June 15, 2019, 02:43:23 AM »
Unlike airplanes, ships have not clear entry point in a harbour. Thus there is no clear route searching point. And route searching for water is most expensive, since there are little limits or a high chance a tile will not be found.

Ships are wrong scale in Simutrans anyway. On a 1km2 of Ocean (or a 1km wide river), quite some ships could pass each other. That is just a question of how the graphics are aligned.

Finally, a typical ferryport has like ferries jetties every 50m, so about 20 ships would fit on one simutrans tile.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1222
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Make ships respect the principle of impenetrability of matter
« Reply #11 on: June 15, 2019, 11:20:02 AM »
Ships are wrong scale in Simutrans anyway. On a 1km2 of Ocean (or a 1km wide river), quite some ships could pass each other. That is just a question of how the graphics are aligned.

No car collision when? :P

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2647
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Make ships respect the principle of impenetrability of matter
« Reply #12 on: June 15, 2019, 05:26:49 PM »
Is that some sort of toll gate?

Offline Matthew

  • *
  • Posts: 164
  • Languages: EN, some ZH, DE & SQ
Re: Make ships respect the principle of impenetrability of matter
« Reply #13 on: June 15, 2019, 06:13:58 PM »
Is that some sort of toll gate?

It looks to me somewhat like the toll gate on the main north-south expressway between Beijing (and all points southward) and Inner Mongolia, which is notorious for horrific traffic jams.

EDIT: The source is here: https://www.youtube.com/watch?v=O3kL6nMap2s and Snopes has a discussion.

It wasn't exactly the spot I was thinking of - it's the expressway going south, not north, out of Beijing. But yes, it's a toll gate.
« Last Edit: June 15, 2019, 06:24:30 PM by Matthew »