Opened 10 years ago

Last modified 5 years ago

#2563 new defect

Infinite attempts to return resources in UnitAI

Reported by: mimo Owned by:
Priority: Should Have Milestone: Backlog
Component: Simulation Keywords: pathfinding
Cc: Itms Patch:

Description

When returning resources, the nearest dropsite is chosen in UnitAI without testing if it is accessible. If it is not, once the unit is blocked (for exemple by water), a new dropsite is chosen. But this will usually give the same one as only the distance is used and this will result in an infinite set of trials. This happens quite often on naval maps with islands and the nearest dropsite on another island. A minimal solution would be to exclude the current dropsite from the search of FindNearestDropsite. But a better solution would be that FindNearestDropsite also check the accessibility of the dropsite. A simple map of connected tiles would allow such easy checks.

Change History (9)

comment:1 by mimo, 10 years ago

In 15325:

Petra: prevent gatherers to stay blocked when UnitAI make them return resource in an inaccessible dropsite, see #2563

comment:2 by maveric, 9 years ago

Owner: set to maveric
Status: newassigned

comment:3 by mimo, 9 years ago

Cc: Itms added

Hi maveric, what kind of fix do you have in mind ? because in the new pathFinder being worked on, Itms added an accessibility grid which should be usable by the simulation. This would allow a clean fix of this ticket, as well as some others (like when spawning entities in inaccessible areas). But for that, you need to wait for the new pathFinder to be in svn (not sure if this will happen before A19) or work on the git branch of this new pathFinder.

comment:4 by maveric, 9 years ago

Actually I was thinking about fixing using pathfinder.

comment:5 by mimo, 9 years ago

Yes, but as it will be changed in the near future, do not invest time on the current pathFinder (except if your solution will work for both).

comment:6 by Itms, 9 years ago

Keywords: pathfinding added

comment:7 by maveric, 9 years ago

Owner: maveric removed
Status: assignednew

comment:8 by Itms, 9 years ago

In 16751:

New long-range pathfinder.

Based on Philip's work located at http://git.wildfiregames.com/gitweb/?p=0ad.git;a=shortlog;h=refs/heads/projects/philip/pathfinder
Includes code by wraitii, sanderd17 and kanetaka.

An updated version of docs/pathfinder.pdf describing the changes in detail will be committed ASAP.

Running update-workspaces is needed after this change.

Fixes #1756.
Fixes #930, #1259, #2908, #2960, #3097
Refs #1200, #1914, #1942, #2568, #2132, #2563

comment:9 by Imarok, 5 years ago

Component: UI & SimulationSimulation

Move tickets to Simulation as UI & Simulation got some sub components.

Note: See TracTickets for help on using tickets.