The International Simutrans Forum

 

Author Topic: Solid objects at sea  (Read 9253 times)

0 Members and 1 Guest are viewing this topic.

Offline Spacethingy

  • *
  • Posts: 177
Solid objects at sea
« on: January 27, 2015, 07:54:33 PM »
One little thing that seriously irks me in Simutrans is the fact that docks/piers/oil rigs aren't obstacles to ships' route finding - they'll quite happily sail straight through the middle of them. Is there any way that a tile occupied by a oil rig or a dock could be made impassable, just like a tile of dry land?

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4083
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Solid objects at sea
« Reply #1 on: January 27, 2015, 08:25:08 PM »
I think oil rigs shouldn't be an obstacle at all, they are suspended above the water surface by pillars so that boats can "park" (berth) beneath them.

Docks and piers could be taken as tracks with "no" direction.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5472
  • Languages: EN, NO
Re: Solid objects at sea
« Reply #2 on: January 27, 2015, 08:37:40 PM »
I think oil rigs shouldn't be an obstacle at all, they are suspended above the water surface by pillars so that boats can "park" (berth) beneath them.
I've yet to see ships sail under oil rigs. Even the relatively minor ships that service the oil rigs take great care to keep their distance. Should a motor fail and the wind blow them into a pillar or a pipe, it's a major disaster. Only small boats can safely move around there, and such boats aren't really part of Simutrans.

Docks and piers could be taken as tracks with "no" direction.
I don't think ships look for ways when on the sea in Simutrans. They just consider what's land and what's not. Only when encountering land do they look for ways. So it might be easier to consider docks, piers and oil rigs as some form of land.

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4083
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Solid objects at sea
« Reply #3 on: January 28, 2015, 12:26:05 AM »
I've yet to see ships sail under oil rigs. Even the relatively minor ships that service the oil rigs take great care to keep their distance. Should a motor fail and the wind blow them into a pillar or a pipe, it's a major disaster. Only small boats can safely move around there, and such boats aren't really part of Simutrans.
Yes, in real life terms ships would never get so close to oil rigs for the reasons you mentioned, they stay away from them and connect a pipe to collect products (e.g. oil). But in simutrans oil ships have always been able to dock beneath the oil rigs (and probably "inside" the piers/docks too) since the ancient times. Surely it would be more sensible if ships always docked at the tiles bordering the stop, not at the very stop tiles. Simutrans allows you to set a waypoint at the bordering tiles, but doesn't disallow you from setting a waypoint at the tiles occupied by the stop, which may lead the situation Spacethingy is talking about.

I don't think ships look for ways when on the sea in Simutrans. They just consider what's land and what's not. Only when encountering land do they look for ways. So it might be easier to consider docks, piers and oil rigs as some form of land.
And rivers? Ships can distinguish between a navigable river and a non-navigable river. This could be applied to the sea tiles as well: a sea tile with a stop (dock, pier, oil rig) would be non-navigable, sea tiles will no stop would be navigable.

But this poses a problem: the player would still think he can set a waypoint at the stop, as of today. Which one of the bordering tiles will be the actual waypoin? Simutrans could warn the player "You cannot set a stop/waypoint inside a dock. Choose a tile next to it!"

EDIT:
Spelling. I keep confusing "It" with "I". HALP!
« Last Edit: January 28, 2015, 12:45:18 AM by IgorEliezer »

Offline isidoro

  • Devotee
  • *
  • Posts: 1129
Re: Solid objects at sea
« Reply #4 on: January 28, 2015, 12:31:45 AM »
In fact, that doesn't look as strange as it would because ships also consider other ships as ghosts...


Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4083
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Solid objects at sea
« Reply #5 on: January 28, 2015, 12:39:20 AM »
In fact, that doesn't look as strange as it would because ships also consider other ships as ghosts...
I think it is less strange in my opinion, ships are moving entities like trains, citycars and pedestrians. On the other hand, a pier is part of the infrastructure and becomes part of the landscape, I would rather expect it to be solid.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1323
Re: Solid objects at sea
« Reply #6 on: January 28, 2015, 12:46:23 AM »
I think it is less strange in my opinion, ships are moving entities like trains, citycars and pedestrians. On the other hand, a pier is part of the infrastructure, I would rather expect it to be solid.
pak128 'piers' are now simply a watertile with pylons at the four corners. How would you distinguish between solid, and navigable stations buildings?

I suspect ship pathfinding performance would be excessively affected by having to search for objects on the water.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5472
  • Languages: EN, NO
Re: Solid objects at sea
« Reply #7 on: January 28, 2015, 06:27:55 AM »
And rivers? Ships can distinguish between a navigable river and a non-navigable river.
There aren't rivers at sea. That was my specific point. At sea, ships switch to a different path finding algorithm since the one used in rivers would be too slow. (That's at least how I've understood a discussion about it.)

This could be applied to the sea tiles as well: a sea tile with a stop (dock, pier, oil rig) would be non-navigable, sea tiles will no stop would be navigable.
I suspect ship pathfinding performance would be excessively affected by having to search for objects on the water.
That's why I suggest making objects build at sea turn the tile into land somehow. It would then be no different from an island or a peninsula.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4564
  • Languages: EN, DE, AT
Re: Solid objects at sea
« Reply #8 on: January 28, 2015, 11:25:52 AM »
I suspect ship pathfinding performance would be excessively affected by having to search for objects on the water.
Such tiles can be excluded from pathing. The water tiles store there pathing information themselves (wasser_t::ribi), which is only computed in calc_bild. There is no need to worry about pathfinding performance here.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1323
Re: Solid objects at sea
« Reply #9 on: January 28, 2015, 04:46:33 PM »
Shoulda known that... recalculating those ribis was one of the things hurting season/snowline change performance.

Buildings would need a flag to permit pathfinding through them to handle pak128 docks.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Solid objects at sea
« Reply #10 on: January 28, 2015, 05:59:11 PM »
Afaik this pak128 layout was chosen as a workaround for the problem described in this topic. If it were solved, I'd strongly support to revert pak128 docks to longer piers.


Sent from my iPhone using Tapatalk

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4083
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Solid objects at sea
« Reply #11 on: January 28, 2015, 09:17:29 PM »
What I would suggest is that when you place a water stop, it replaces the navigable water tiles with different kind of tile, which may have the water graphics but still it wouldn't act like water way, so that these "tiles can be excluded from pathing", as Dwachs said. If you remove the stop, the normal navigable water tiles are brought back.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9460
  • Languages: De,EN,JP
Re: Solid objects at sea
« Reply #12 on: January 28, 2015, 10:15:51 PM »
The only problem would be saved games with lots of ships stuck on under the piers. If this is only one field, then it may work but otherwise all these ships (and their waypoints) will be stuck. Furthermore, fishing ground are ment to be stopped on them ...

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3649
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Solid objects at sea
« Reply #13 on: January 31, 2015, 07:40:48 PM »
The only problem would be saved games with lots of ships stuck on under the piers. If this is only one field, then it may work but otherwise all these ships (and their waypoints) will be stuck. Furthermore, fishing ground are ment to be stopped on them ...

Dunno about fishing, but perhaps it might be worth handling this like Minecraft. If a tree grows where you're standing, you are suddenly inside the tree blocks. You're able to move through the blocks back into air blocks. Once you've moved into air blocks, you are again restricted from moving into tree/leaf blocks.

Maybe some sort of code that if a ship finds itself in "land" or however it would be done, it moves (maybe even for free?) to a nearby open water block. This might not be perfect if it goes to the "wrong" open water - but maybe it would be good enough. Maybe even a convoi move tool - which might also be handy when convois get stuck anyway. Click source convoi, click detination block, and it tries to position itself (i.e. thinking of ways - or ocean). If it can do so, it does, otherwise, it won't move the convoi (so if you moved a train, it would try and place the locomotive, and then the cars going whatever random direction; try all directions; if all directions fail, the move fails. If it works, the first randomly chosen direction is what the player gets)

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5472
  • Languages: EN, NO
Re: Solid objects at sea
« Reply #14 on: January 31, 2015, 09:36:03 PM »
Dunno about fishing, but perhaps it might be worth handling this like Minecraft. If a tree grows where you're standing, you are suddenly inside the tree blocks. You're able to move through the blocks back into air blocks. Once you've moved into air blocks, you are again restricted from moving into tree/leaf blocks.

Sheep from pak64 could really need this when they spawn on a tile surrounded by trees. For everything else, it might add some complications to the path finding that slows it down, and that is just useful in very special circumstances.

Maybe some sort of code that if a ship finds itself in "land" or however it would be done, it moves (maybe even for free?) to a nearby open water block. This might not be perfect if it goes to the "wrong" open water - but maybe it would be good enough. Maybe even a convoi move tool - which might also be handy when convois get stuck anyway. Click source convoi, click detination block, and it tries to position itself (i.e. thinking of ways - or ocean). If it can do so, it does, otherwise, it won't move the convoi (so if you moved a train, it would try and place the locomotive, and then the cars going whatever random direction; try all directions; if all directions fail, the move fails. If it works, the first randomly chosen direction is what the player gets)

Instance repositioning is probably the best. It could perhaps look up a route from the previous stop in the schedule to the current destination, and then jump to the nearest tile on that path. If the destination waypoint is now blocked, a no route warning will tell the player to move the waypoint.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1197
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Solid objects at sea
« Reply #15 on: February 01, 2015, 09:08:57 AM »
Just add a "solid"-parameter, which is off by default. That way, unless the pakset updates and includes the parameter, nothing changes. The pakset, however, could keep the old docks without a build-button and create new ones which look the same, but are solid. With this, the game engine is perfectly backwards compatible, and the paksets may decide on there own how to deal with it - accept stuck ships or have additional docks for some versions.

Waypoints are a bit different. I'd expect to need to click on the dock to get a waypoint, not somewhere in vicinity. I think if you set a waypoint on the dock, the ship should land anywhere in the harbour, as if there was a choose signal.

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4083
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Solid objects at sea
« Reply #16 on: February 01, 2015, 10:25:01 AM »
Waypoints are a bit different. I'd expect to need to click on the dock to get a waypoint, not somewhere in vicinity. I think if you set a waypoint on the dock, the ship should land anywhere in the harbour, as if there was a choose signal.
It is indeed a potential problem, I'd assume most players are used to clicking "inside" the docks to set the waypoints because they do the same for land stops (train stations, bus stops etc). But also this happens because the game always allowed players to do so to assign water waypoints.

However I believe that it wouldn't be hard to learn this rule (*): that land waypoints must be assigned at the stops -- because I'd expect that trains, buses and airplanes to stop/park/arrive at the tile where stop is built --, and that water waypoints must be assigned next to the pier -- because I wouldn't expect that ships to dock inside the pier, but next to it. The game already allows players to set waypoints next to docks and oil rigs.

If the dock is solid (the idea of a DAT parameter for it is sensible), the game would disallow players to set waypoints inside the docks to avoid ships getting stuck in it. A pop-up like "Ships can't dock in this kind of stop. Choose a tile next to it!" may help. If the game doesn't prevent that, if you click inside a solid dock, which one of the 4 tiles next to it would be the valid waypoint? I'd prefer to choose the exact tile where the ship must dock at.

EDIT:

* -- To be technically precise: stops built at paths (road, track, canal, taxiway), the waypoint must be assigned inside the stop; stops built in open waters (sea, lakes), the waypoint must be assigned next to the stop.
« Last Edit: February 01, 2015, 10:48:12 AM by IgorEliezer »

Offline The Hood

  • Devotee
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Solid objects at sea
« Reply #17 on: February 01, 2015, 08:53:05 PM »
You can already do some nice eyecandy like this by building out into a lake using the new landscaping tools:



Being land, ships can't sail through it. Sea tiles adjacent to the "pier" are valid docking squares for boats as long as the stop is water-enabled - but I had to do this by placing a separate "dock" station elsewhere connected to the stop. If only we were allowed to build docks on the flat now we have flat shores...

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Solid objects at sea
« Reply #18 on: February 02, 2015, 06:42:57 AM »
Beautiful.  I've done similar things with docks, they look really nice.  I started working on a dock graphics set a couple of months ago that are raised up like piers but can be placed on flat ground like the above... I should get around to finishing them (so many half done projects!).

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9460
  • Languages: De,EN,JP
Re: Solid objects at sea
« Reply #19 on: February 03, 2015, 11:22:19 PM »
r7519 had preliminary support for "dock" which is identical to "harbour" as building type but starts on even ground shores.

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3649
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Solid objects at sea
« Reply #20 on: February 04, 2015, 03:13:03 AM »
Awesome - so we'll probably have a built-in solution to the issue shortly anyway. :D

Flat land next to water is such an awesome thing to have anyway. I love it.