MantisBT - VCMI
View Issue Details
0000515VCMIMechanics - Adventure Mappublic2010-07-03 03:322023-06-21 15:30
Zamolxis 
SXX 
normalminoralways
resolvedfixed 
AMD 5600+WindowsXP SP3
0.81 
 
0000515: "There is no place to put the boat" if the water is on the left (west) side of the shore + Correct Rules for boat summoning
Also, the position where the boat appears should be tweaked to match H3.

I've struggled for half an hour to figure out what was the rule in H3 (see attached screenshot) and it turns out the system was actually quite simple.

First, please see here the priority of the water tiles around the hero (clockwise, starting above the hero):

8 1 2
7 x 3
6 5 4

The rules are as follows:
- The game looks for the highest priority water tile available to place the boat (1 being the highest) at 1st cast
- At 2nd cast the game looks for the 2nd highest priority water tile to place the boat
- Further casting will continue to regularly alternate between the 1st & 2nd highest priority tiles (if only 1 available, after 1st cast it will be blocked by the summoned boat already - then see last rule below)
- If there are more than 2 available water tiles, still only the first 2 are considered (a boat is never placed on a 3rd available water tile)
- If an empty boat occupies what could be the 1st or 2nd available tile, then the game considers it as obstacle as well, hence choosing the empty tile and the boat moves there
- If all tiles around the hero are occupied (even if that means occupied by empty boats on water), we get the message "There is no place to put a boat" which we normally get when there is no free water tile around

Take Sir Mullich in the attached map to run your tests. For the bug in the subject, just take him to a vertical shore where the water is to the west (but I guess you don't need to waste time with the bug as long as you implement the above rules correctly)

Note: monster area of control does not impact water tiles. I'm pointing this out just in case, because the above rules should not be impacted by a monster stationed next to a water tile. Boats can be summoned on tiles adjacent to a monster and hero can board it without starting a fight (of course, only if he does not need to go through a terrain tile guarded by that monster before getting to the boat).
No tags attached.
related to 0002791resolved SXX Crash when AI try to buy a boat outside of map 
jpg 2010-07-03_SummonBoatPosition.jpg (440,740) 2010-07-03 03:32
https://bugs.vcmi.eu/file_download.php?file_id=441&type=bug
jpg

?  VCMI_Tests.h3m (12,527) 2010-07-03 03:35
https://bugs.vcmi.eu/file_download.php?file_id=442&type=bug
Issue History
2010-07-03 03:32ZamolxisNew Issue
2010-07-03 03:32ZamolxisFile Added: 2010-07-03_SummonBoatPosition.jpg
2010-07-03 03:35ZamolxisDescription Updatedbug_revision_view_page.php?rev_id=901#r901
2010-07-03 03:35ZamolxisFile Added: VCMI_Tests.h3m
2015-11-13 21:11SXXAssigned To => SXX
2015-11-13 21:11SXXStatusnew => assigned
2015-11-25 16:56SXXNote Added: 0006117
2015-11-25 16:56SXXNote Edited: 0006117bug_revision_view_page.php?bugnote_id=6117#r3039
2015-11-26 07:10SXXNote Added: 0006119
2015-11-26 07:11SXXNote Edited: 0006119bug_revision_view_page.php?bugnote_id=6119#r3041
2015-11-26 07:21SXXNote Added: 0006120
2015-11-26 08:03SXXNote Added: 0006121
2017-09-12 13:27SXXRelationship addedrelated to 0002791
2023-06-21 15:30IvanNote Added: 0008636
2023-06-21 15:30IvanStatusassigned => resolved
2023-06-21 15:30IvanResolutionopen => fixed

Notes
(0006117)
SXX   
2015-11-25 16:56   
"Summon boat" spell still fail to summon boat on position "6" from this task description in current git.

(0006119)
SXX   
2015-11-26 07:10   
(edited on: 2015-11-26 07:11)
Looks like issue related to the fact that IBoatGenerator::bestLocation use "pos" of object and looks like hero position is displaced due "h3m" thingy.

(0006120)
SXX   
2015-11-26 07:21   
BTW we really need to get rid of that "convertPosition"...
(0006121)
SXX   
2015-11-26 08:03   
Applied temporary fix:
https://github.com/vcmi/vcmi/commit/c45cd1f4c284232275a9662e7f519d707d1af555 [^]

Though once I have time on that I'll try to get rid of convertPosition. Can't do that now because it's would require a lot of testing.
(0008636)
Ivan   
2023-06-21 15:30   
Fixed in https://github.com/vcmi/vcmi/pull/2243 [^]