Skip to content

formationPreview beta ​

Function of @v12-engine/engine

ts
export declare function formationPreview(registry: Registry, units: readonly (FormationUnit & {
    readonly flying?: boolean;
})[], target: Vec2, navs: {
    readonly nav: Navigation;
    readonly air: Navigation;
}, id: string, facing?: number): Map<EntityId, Vec2>;

Where a group would stand if sent to a target in a formation (by id, rows when unknown), from what a player's screen knows of the units: what the ghosts of a right-click dragged are drawn from (GameSession.formationPlaces). The same shapes as formationPoints gives, units that walk and units that fly each on their own navigation; the formation hook (the simulation's) and a formation that reads FormationContext.world take no part, and the order itself lays the group out as it will