Opened 5 years ago

Closed 5 years ago

#3308 closed defect (fixed)

Naval map management by the AI no more working

Reported by: mimo Owned by: Itms
Priority: Should Have Milestone: Alpha 19
Component: AI Keywords: pathfinding
Cc: Patch:

Description (last modified by mimo)

The AI needs to know what are the passable tiles, either for land or naval units, but it also needs to know which tiles are adequate for loading or unloading units from a ship. With the old pathFinder, this was done by looking at the tiles which were passable both for land and naval units because this information was available without clearance. But in the new pathFinder, we have the land passable tiles without clearance, but the smallest clearance for naval units is 4, so that there is usually no more any overlap and the AI is unable to find a landing place in most islands. The best solution would be to add a new passability class "default-water-only" which would be the analoguous of "default-terrain-only" for water. But as there are already 8 classes, that's may-be not desired. Another possibility would be to change the "ship-small" class, reducing its clearance. As it is only used for fishing ships which have an obstruction of 2, putting 2 instead of 4 as clearance should work for the pathFinder and would allow to recover most of the overlaps for the AIs to be able to find landing places. Or possibly another solution I didn't think of ?

Edit: according to the comments in pathfinder.xml, default-terrain-only is used only by the AI and not the pathFinder. As it is static (no need to update it), it could be removed from the passability grid leaving room for another possible class and be transfered to the AI as a second grid (with the default-water-only) only at initialization.

Change History (3)

comment:1 by mimo, 5 years ago

Description: modified (diff)

comment:2 by Itms, 5 years ago

There is no problem with adding a pass class, especially when it is "terrain-only". That was the point of my "grid update optimization": now these grids are only updated when the terrain is changed (at initialization).

comment:3 by Itms, 5 years ago

Owner: set to Itms
Resolution: fixed
Status: newclosed

In 16806:

Add a terrain passability class for water. Fixes #3308

Note: See TracTickets for help on using tickets.