Opened 13 years ago

Last modified 13 years ago

#893 closed defect

Unit spawning should respect passability class — at Initial Version

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

Description

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 (0)

Note: See TracTickets for help on using tickets.