Ships can be at the same spot

Bug #990655 reported by fuchur
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
widelands
Won't Fix
Low
Unassigned

Bug Description

I noticed the following:
If you have two ports and at least two ships which transport wares between these ports they will meet each other somewhere. As the travel path seems to be always the same (I assume the shortest distance) there is a moment when the ships are on the same spot. This looks a bit strange, even more as ships are quite large. I think its the same with carriers and donkeys, but as they are much smaller, so you can imagine they pass each other side by side.

For the ships I'd like to suggest to implement some kind of evasion maneuver. On or both ships could change its course a bit so they can pass without a "collision". Unfortunately this doesn't work if the water path is too narrow. Is there a minimum width of a water passage for a ship to travel? If yes this could be increased a bit.

Tags: seafaring
Changed in widelands:
importance: Undecided → Low
tags: added: seafaring
Revision history for this message
wl-zocker (wl-zocker) wrote :

When the ships do not move, every ship has its own spot where it is waiting. But it looks stringe when every ship moves a bit. Maybe the algorithm should be improved.

An evasion maneuver sounds quite sensible. I am wondering why ships need no place when they move. AFAIK, they are bobs like soldiers. Two soldiers are sometimes at the same spot, but normally, an army needs a lot of space.

There is a minimum width of water passages for ships: The node the ship is on has to be completely surrounded by water (all six tiles). This means that travelling by foot is not possible over that passage.

I do not know if increasing the minimum width is sensible: If you have only one ship, it still can drive through. Problems will appear only if two (or even more) ships want to drive through the passage.

Please note that IF the evasion maneuver is implemented, there might appear "Stuck ships" problems similar to soldiers, e.g. in bug 923129

Revision history for this message
_aD (ad-simplypeachy) wrote :

One could say that through a narrow area, only one ship should be able to pass. Maybe this could promote a challenging feature of a map.

Revision history for this message
fuchur (fuchur77) wrote :

I don't know how difficult it is to implement the feature without the rist of "stuck ships". But I'd say it's more important to have ships travelling without problems than an evasion maneuver. A stuck soldier might be annoying, a stuck ship, maybe your only one on expedition, is quite painfull.

For the narrow area I would say that there are two options:

1. Before a ship enters a narrow passage the path must be checked for other ships. If one is already in the critical area the ship has to way until the passage is free.

2. Both ships can enter a narrow passage from both ends. When they meet one has to turn around and go back until the other can pass. As criterion for the decission which ship the turning one is, I'd suggest the length of the already travelled path in the narrow passage.

Of course I'd prefer map designers to avoid these narrow passages. As you can't control the course of a ship or the time when it will be at a certain position there is no tactical use. On the contrary, your own ships could interfere with themselves.

Revision history for this message
wl-zocker (wl-zocker) wrote :

I agree with fuchur that it is more important that ships move at all than a good-looking evasion maneuver.

Of course, the official map designers should try to avoid narrow areas, but nevertheless, the problem has to be faced (if they do not watch out or for inofficial, self-designed maps).

Both ideas fuchur posted can work, although I prefer number 1 because a ship that turns around seems a bit silly and will not look for graphic reasons.

Here are the problems I see:

In general: How can a narrow passage be recognized by the ships (in reference to programming)?

1. - You have to look if the ship that is inside drives in the same direction as the second ship (then it can enter) or in the opposite direction (then it has to wait).
- What happens if the ship in the passage (that drives in the same direction as the second one does, so it has entered) suddenly turns around (because the destination port is destroyed, related to bug 975091, maybe depending on how that will be dealt with), so that both ships meet in the narrow area?
- The quite unprobable case that a narrow area has three exits:

                                        (top)
                                           /
                                       S1
                                       /
(left) S2 - - - - - - - - -
                                       \
                                         \
                                   (bottom)

Ship 1 drives from top to bottom, ship 2 from left to top. Depending on how a narrow area will defined, ship 2 will maybe not enter because ship 1 drives in opposite direction. But it waits uselessly because if it entered immediatly, ship 2 would have passed the junction before ship 1 arrives. (Do you understand what I mean?) I do not think that that is a big problem, but while we are discussing about it, I just wanted to mention it. I think it is only a bit annoying if the ship waits although there is no need.

2. - The way the ships have travelled through the narrow area would have to be saved or the shortest way out has always to be calculated when two ships meet. What happens if both ships have the same distance?

Although I have found lots of problems: I am not against the fact that ships need a certain space when they move (that is the reason why we have this discussion aabout evasion maneuvers and narrow areas), on the contrary, I think it will make the game look better. I just want to mention the points above to avoid that ships get stuck.

Revision history for this message
wl-zocker (wl-zocker) wrote :

Sorry that the drawing looks a bit strange. The left line should go until it meets the others to create a junction.

Revision history for this message
fuchur (fuchur77) wrote :

@#4 1.
If my firtst proposal would be implemented, which will act like a traffic light, ships must not be allowed to turn around while in a narrow area with another ship following it. Otherwise it will lead to the situation described in the second proposal.

To the problem with the junction: I think it's ok for the ship to wait some time even if it is unnecessary.

@#4 2.
If the distance is the same a random decission could be made.

Nasenbaer (nasenbaer)
Changed in widelands:
status: New → Confirmed
Nasenbaer (nasenbaer)
Changed in widelands:
milestone: none → build19-rc1
Revision history for this message
_aD (ad-simplypeachy) wrote :

Another symptom of this bug is when stationery ships are so close that selection is impossible. I had started an expedition, gathered all of the necessary wares in a ship but could not select it to begin exploring - an idle ship was so close to it that I could only select the idle ship. I had to sink the idle ship before I could begin my seafaring.

Revision history for this message
SirVer (sirver) wrote :

Setting to incomplete for bug sweeping.

Changed in widelands:
status: Confirmed → Incomplete
Revision history for this message
kaputtnik (franku) wrote :

What about implementing a solution that ships for expedition should move one field/node and wait there until the player gives commands?

Doing so the problem described in #7 is solved.

But the visual "collision" on the open sea is not solved, we could reschedule this for build 20 then.

GunChleoc (gunchleoc)
Changed in widelands:
milestone: build19-rc1 → build20-rc1
Revision history for this message
Teppo Mäenpää (kxq) wrote :

Is it important that the ships never ever share a same location, or that they just make evasive attempts, and accept that overlaps still happen now and then? The latter would be a lot easier, and still please the eye.

If the ships would never overlap, then one could use ships on expedition to block enemy transportation routes. I do not think we want to go that direction: naval battle option would be needed to allow one to reclaim his waterways.

Revision history for this message
GunChleoc (gunchleoc) wrote :

We have some form of simple pulling apart when ships are moving, but they still stack up on the portdocks. I think the important thing is that any ship that has is in expedition mode should always be on top of the other ships, so it can be selected. Alternatively, only allow 1 ship per portdock, with the others idling next to them.

GunChleoc (gunchleoc)
Changed in widelands:
milestone: build20-rc1 → build21-rc1
Revision history for this message
GunChleoc (gunchleoc) wrote :
Changed in widelands:
status: Incomplete → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.