Targeting chain

This page is the canonical reference for the Targeting chain in GridPlacement 6.0.

The targeting chain is the coordinated sequence of systems that transforms raw pointer intent (mouse/touch/keyboard-driven cursor movement) into a stable target snapshot (snapped grid coordinate + resolved target node) that downstream chains can consume.

Boundary

  • Godot layer
    • Captures InputEvent and decides routing/priority.
    • Owns viewport/world coordinate sampling.
  • Core boundary (workflow readiness / ports)
    • Exposes narrow, engine-agnostic readiness/contracts (no Godot types).
    • Downstream chains (Placement/Manipulation) consume targeting through workflow ports.

6.0 targeting chain

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
Godot InputEvent / viewport state
GBInputService (routes intent)
GBPositioningInputAdapter / Positioning adapter
Positioner / targeting implementation
  - snaps to grid
  - runs shape cast / hit test
  - resolves logical target node
Targeting state (readiness + current target snapshot)
Consumers
  - Placement chain (validate / indicators / execute)
  - Manipulation chain (hover/active target, move/demolish/info)
  - UI (target informer)

What is “the target”

A target snapshot is treated as:

  • Grid coordinate
    • Snapped Vector2i (or Core equivalent) representing the current cell.
  • Resolved target node
    • A Node2D representing the logical target for manipulation/info.
    • May differ from the raw physics collider.

Target resolution (logical target vs collision object)

Targeting is allowed to detect collision shapes on child nodes while targeting a parent/root logical node.

Resolution priority:

  1. Direct metadata (e.g. a “root_node” meta pointing at the logical target)
  2. Manipulatable discovery (sibling/child lookup for a manipulatable component)
  3. Fallback: treat the collision node as the logical target

Output contract

What the targeting chain guarantees:

  • The latest target snapshot is stable (snapped) and updated when needed.
  • Downstream chains can treat targeting output as authoritative.

What it does NOT guarantee:

  • It does not apply indicators.
  • It does not validate placement rules.
  • It does not mutate grid occupancy.

Existing deep dives