News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

Solid objects at sea

Started by Spacethingy, January 27, 2015, 07:54:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Spacethingy

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?
Life is like a Simutrans transformer:

You only get one of them, and you can't have it on a slope.

IgorEliezer

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.

Ters

Quote from: IgorEliezer 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.
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.

Quote from: IgorEliezer on January 27, 2015, 08:25:08 PM
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.

IgorEliezer

#3
Quote from: Ters on January 27, 2015, 08:37:40 PM
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.

Quote from: Ters on January 27, 2015, 08:37:40 PMI 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!

isidoro

In fact, that doesn't look as strange as it would because ships also consider other ships as ghosts...


IgorEliezer

Quote from: isidoro 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...
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.

TurfIt

Quote from: IgorEliezer on January 28, 2015, 12:39:20 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.

Ters

Quote from: IgorEliezer on January 28, 2015, 12:26:05 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.)

Quote from: IgorEliezer on January 28, 2015, 12:26:05 AM
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.
Quote from: TurfIt on January 28, 2015, 12:46:23 AM
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.

Dwachs

Quote from: TurfIt on January 28, 2015, 12:46:23 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.
Parsley, sage, rosemary, and maggikraut.

TurfIt

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.

Fabio

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

IgorEliezer

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.

prissi

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 ...

Isaac Eiland-Hall

Quote from: prissi 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 ...

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)

Ters

Quote from: Isaac.Eiland-Hall on January 31, 2015, 07:40:48 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.

Quote from: Isaac.Eiland-Hall on January 31, 2015, 07:40:48 PM
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.

Leartin

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.

IgorEliezer

#16
Quote from: Leartin on February 01, 2015, 09:08:57 AMWaypoints 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.

The Hood

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...

Sarlock

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!).
Current projects: Pak128 Trees, blender graphics

prissi

r7519 had preliminary support for "dock" which is identical to "harbour" as building type but starts on even ground shores.

Isaac Eiland-Hall

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.