Baltor Get started

Gallery / Godot components

Formation slots with short-travel assignment

In your harnessGodot componentMIT

Lay out slots for line, column, wedge, circle and grid formations, rotate them to a leader's position and facing, and assign members to slots so that paths are short and do not cross.

Files, names only

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • baltor_test.gd
  • component.json
  • formation_slots.gd
  • inspect_gdscript.py
  • run_tests.gd
  • test_package.py
  • tests/test_formation_slots.gd
  • verification/native.json

Full files in your harness.

What it takes and gives

Class
BaltorFormation, extends RefCounted
Methods
slot_offsets(shape: Shape, count: int, spacing: float) -> PackedVector2Array; world_slots(offsets: PackedVector2Array, anchor: Vector2, facing_angle: float) -> PackedVector2Array; assign(members: PackedVector2Array, slots: PackedVector2Array) -> PackedInt32Array; total_distance(members: PackedVector2Array, slots: PackedVector2Array, assignment: PackedInt32Array) -> float
Placement
res://baltor/godot_components/formation_slots/

Limits. 2D layouts facing +x. The assignment is greedy plus pairwise swaps, not an optimal Hungarian assignment; it is quadratic to cubic in the member count and meant for squads, not crowds. Verified with Godot 4.7.2 headless; written against the Godot 4.3 API.

Details

Kind
Godot component
Engine
Godot 4.3 or later
Files
11 files, 75.8 KB
Licence
MIT
Declared effects
reads files, runs commands
Checked with
Godot 4.7.2, headless
Checks
godot parse check only, godot gdscript tests, godot tests reject gutted component, godot editor import, godot contract reflection, godot readme usage compiles
Techniques
formation slot offsets, greedy assignment with 2-opt style pair swaps
Tags
formation, squad, rts, group movement, assignment, ai
Identity
library.supply.creative_originals.1105e6fc2bfa9cad70faa7d7.6aa509cd59fa01d0
Version
6aa509cd59fa01d07b0b5634693835e29301a7fe96226f80d5aefdfcc2d81c72

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.