MantisBT - VCMI
View Issue Details
0000370VCMIMechanics - Adventure Mappublic2010-02-14 13:022011-11-01 12:25
Boulie 
Tow 
normaltweakalways
closedfixed 
0.75d 
0.82 
0000370: Ship appears on the wrong (right) side of the shipyard. // EDIT: note added describing the rules for placing purchased boats
if the shipyard is on the bottom side of the water.
See sreenshot.
added test map
No tags attached.
related to 0000244closed Tow Cannot buy boat if the shipyard is flagged with l-click (EDIT: added complete behavior for the 3-tile shipyard object) 
related to 0000103closed Tow Bug with sailing - boat can sail through the edge of the land 
jpg boat apears on the wrong side.jpg (209,942) 2010-02-14 13:02
https://bugs.vcmi.eu/file_download.php?file_id=247&type=bug
jpg

? _test_SoD_map_upd.h3m (2,635) 2010-07-04 21:35
https://bugs.vcmi.eu/file_download.php?file_id=445&type=bug
Issue History
2010-02-14 13:02BoulieNew Issue
2010-02-14 13:02BoulieFile Added: boat apears on the wrong side.jpg
2010-02-14 13:03BoulieFile Added: _test_SoD_map.h3m
2010-06-03 08:39WarmongerStatusnew => assigned
2010-06-03 08:39WarmongerAssigned To => Warmonger
2010-06-10 09:25WarmongerCategoryGUI - Adventure Map => Mechanics - Adventure Map
2010-06-26 09:26WarmongerNote Added: 0000981
2010-06-26 09:26WarmongerRelationship addedrelated to 0000103
2010-07-04 20:49ZamolxisFile Deleted: _test_SoD_map.h3m
2010-07-04 20:50ZamolxisFile Added: _test_SoD_map_upd.h3m
2010-07-04 20:51ZamolxisRelationship deletedrelated to 0000103
2010-07-04 20:56ZamolxisRelationship addedrelated to 0000244
2010-07-04 21:35ZamolxisFile Deleted: _test_SoD_map_upd.h3m
2010-07-04 21:35ZamolxisFile Added: _test_SoD_map_upd.h3m
2010-07-04 23:22ZamolxisNote Added: 0001014
2010-07-04 23:31ZamolxisNote Edited: 0001014bug_revision_view_page.php?bugnote_id=1014#r905
2010-07-04 23:35ZamolxisSummaryShip appears on the wrong (right) side of the shipyard => Ship appears on the wrong (right) side of the shipyard. // EDIT: note added describing the rules for placing purchased boats
2010-07-05 04:43WarmongerNote Added: 0001015
2010-07-05 04:44WarmongerNote Edited: 0001015bug_revision_view_page.php?bugnote_id=1015#r909
2010-07-05 04:45WarmongerNote Edited: 0001015bug_revision_view_page.php?bugnote_id=1015#r910
2010-07-05 07:03WarmongerRelationship addedrelated to 0000103
2010-07-09 04:58WarmongerRelationship addedrelated to 0000521
2010-07-10 01:49TowRelationship deletedrelated to 0000521
2010-07-13 05:28TowNote Added: 0001059
2010-07-13 05:28TowStatusassigned => resolved
2010-07-13 05:28TowFixed in Version => 0.89
2010-07-13 05:28TowResolutionopen => fixed
2010-07-13 05:28TowAssigned ToWarmonger => Tow
2011-11-01 11:57ZamolxisNote Edited: 0001014bug_revision_view_page.php?bugnote_id=1014#r1467
2011-11-01 11:58ZamolxisNote Edited: 0001014bug_revision_view_page.php?bugnote_id=1014#r1468
2011-11-01 11:58ZamolxisNote Edited: 0001014bug_revision_view_page.php?bugnote_id=1014#r1469
2011-11-01 12:25ZamolxisNote Added: 0002116
2011-11-01 12:25ZamolxisStatusresolved => closed

Notes
(0000981)
Warmonger   
2010-06-26 09:26   
Looks like a problem with tile recognition. VCMI claims that all the tile apart from target are dirt, even though right shipyard can place a boat in same relative position. Probably related to 0000103.
(0001014)
Zamolxis   
2010-07-04 23:22   
(edited on: 2011-11-01 11:58)
Unless I'm missing something, I believe this has nothing to do with 0000103, so I removed the relationship. I also updated the attached map with an altered version which can be of better help to test/prove the logic of boat placement if bought at shipyard.

Similar to 0000515, it's all about priorities. Assuming it'd be all water around a shipyard, OH3 had a hierarchy of all the tiles around the 3-tile shipyard in regards to the destination of the purchased boat. That is as follows:

H J L K I
A x.S.x B
C E G F D

In other words, that means:
- x.S.x is the 3-tile shipyard
- A to L are all the tiles around it in order of priorities, as detailed below
- first there is a priority of rows: middle > bottom > top
- then there is a priority of columns: extreme left > extreme right > middle left > middle right > middle
- H3 checks the tiles in the specified order, and rules out the following: land tiles + water tiles occupied by permanent objects (e.g. Shipwreck) + water tiles occupied by 'removable' objects (e.g.: Flotsam). If all surrounding tiles are occupied by these, we get the message with "...abandoned shipyard..." and we won't be able to use it, unless some of the objects are not fixed and we manage to remove them
- H3 does not rule out free water tiles or water tiles occupied by another boat*; the 1st tile that satisfies one of these two conditions is considered the designated destination tile (and only that, H3 does NOT look further if a boat is in there > we can choose if we want to keep this limitation, which is not particularly logic)
- If the designated tile is empty, the "Build A New Ship" opens if we enter a Shipyard or click on a Shipyard that we own (see also 0000244) and we can purchase a boat if we have the resources
- If the designated tile is occupied by a boat, we get the message "Cannot build another boat" (even if the boat there was not build at that shipyard, but just brought by a hero)

*H3 buggy behavior (I guess it's something they missed during the coding): When applying the above rules, H3 took into consideration only the situation in the beginning of the turn + boats purchased during the current turn + summoned/scuttled boats (including enemy boats destroyed in fight)
Consequence 1: If the shipyard was blocked by a Flotsam for example, just picking that up won't allow us to buy a boat that turn. H3 was able to update the tile status to "available for sail", but not to "available for placing purchased boat" (and I didn't test to see if it allowed summoned boats). That was updated only after End Turn. This is minor considering the chance of occurring, but annoying should it ever occur, so it would be nice if we don't "copy" this in VCMI.
Consequence 2: If one of our heroes in a boat moves on a "designated tile", H3 still places a purchased boat there, the 2 boats overlapping. Logically H3 should look for the next available tile, but I leave it up to the devs if this should be corrected, because I don't think this can lead to any frustrating situation for the player.

NOTES:
> Theodorus (has Admiral's Hat) & the upper-right shipyard are maybe best to use for tests.
> It'll be easier to run tests in VCMI for this one if you first take care of report 0000244, because currently we can't access owned shipyards just by clicking on them.

(0001015)
Warmonger   
2010-07-05 04:43   
(edited on: 2010-07-05 04:45)
But these tiles are _not_ empty even though they should. I tried debugging and that's exactly what I've got. Bug is somewhere else but map parsing or pathfinding is not quite my pair of shoes.

(0001059)
Tow   
2010-07-13 05:28   
Implemented in r1649
Thank you for the thorough description.

@Warmonger
>Looks like a problem with tile recognition. VCMI claims that all the tile apart from target are dirt

I have not seen anything like that...
(0002116)
Zamolxis   
2011-11-01 12:25   
Tested in 0.86 and confirmed as very nicely fixed/implemented (including fixing/enhancing H3 buggy behavior).

And btw, testing this gave me the chance to properly test the new pathfinder... sweet! :) Very nice job!