Opened 13 years ago

Last modified 13 years ago

#893 closed defect

Unit spawning should respect passability class — at Version 2

Reported by: historic_bruno Owned by: historic_bruno
Priority: Should Have Milestone: Alpha 7
Component: UI & Simulation Keywords:
Cc: Patch:

Description (last modified by historic_bruno)

Unit spawning is broken because it only considers unit obstructions, meaning both trained and ungarrisoned units can be spawned on terrain that violates their passability class. This is one of the causes of "land ships", #771 and #818. I'm working on a fix for #804 which should also fix this (using the PassabilityClass defined in pathfinder.xml).

A few considerations:

  • The current behavior is bad, when spawning fails it just places the unit in the middle of the building which in the case of docks can expose a subtlety of the pathfinder: units on impassable border tiles (as between land and water) can move to other impassable tiles but not actually cross the boundary - meaning they get stuck as land ships if they move onto land.
  • Expand the search outward when spawning units, boats are large and docks have limited space to spawn units.
  • If a unit fails to spawn after training, it could be left blocking the training queue until it finds space or is cancelled. This will require some changes to the queue design and notification of the user.
  • If a unit fails to ungarrison, it could be left garrisoned unless the ejection is forced (e.g. a unit changes ownership while garrisoned)

Change History (2)

comment:1 by ben, 13 years ago

(In [9970]) Implements building restrictions (by terrain, territory, category, and distance). See #41. Fixes #804, #287. Implements build limits. See #687. Implements autorotation for dock placement. Fixes unit spawning to consider terrain passability. See #893. Adds new passability criteria based on distance from shore. Updates build restrictions on some templates. Changes unit spawning search to 4 tiles away from foundation. Changes garrison/training spawn failure to nicer UI notification.

comment:2 by historic_bruno, 13 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.