Record original-alignment implementation and traceability checkpoint

Capture current source, content data, tests, asset licenses, and original-specification traceability. Original implementation remains incomplete. The accepted matching UI generation passed 154 suites and 12,253 checks, with eight rendered staff-contract screens reviewed. Latest native Windows and full-original acceptance remain outstanding.
This commit is contained in:
Takeshi
2026-09-30 23:52:24 +09:00
parent 6077e02ebe
commit 5dde0c5ec2
490 changed files with 54051 additions and 809 deletions
@@ -0,0 +1,65 @@
extends PathService
# Pre-optimization algorithm, retained as an exact route-order oracle.
func _run_a_star(
start: Vector3i,
goal: Vector3i,
allowed_layers: Array[int],
allowed_access_ids: Array[StringName]
) -> Array[Vector3i]:
if start == goal:
return [start]
var open_set: Dictionary = {start: true}
var closed_set: Dictionary = {}
var came_from: Dictionary = {}
var g_score: Dictionary = {start: 0}
while not open_set.is_empty():
var current := _select_best_open_node(open_set, g_score, goal)
if current == goal:
return _reconstruct_path(came_from, current)
open_set.erase(current)
closed_set[current] = true
var edges: Array = _adjacency.get(current, [])
for edge_value: Variant in edges:
var edge: Dictionary = edge_value
var neighbor: Vector3i = edge[&"to"]
if neighbor.z not in allowed_layers \
or _cell_is_temporarily_blocked(neighbor) \
or not _edge_meets_vertical_policy(current, edge) \
or not _edge_is_accessible(edge, allowed_access_ids):
continue
var tentative_cost: int = int(g_score[current]) + _edge_total_cost(edge)
var known_cost: int = int(g_score.get(neighbor, _INFINITE_COST))
var better_parent := false
if tentative_cost == known_cost and came_from.has(neighbor):
better_parent = _coordinate_less(current, came_from[neighbor])
if tentative_cost > known_cost or (tentative_cost == known_cost and not better_parent):
continue
came_from[neighbor] = current
g_score[neighbor] = tentative_cost
if closed_set.has(neighbor):
closed_set.erase(neighbor)
open_set[neighbor] = true
return []
func _select_best_open_node(open_set: Dictionary, g_score: Dictionary, goal: Vector3i) -> Vector3i:
var best := Vector3i.ZERO
var has_best := false
var best_score := _INFINITE_COST
for candidate_value: Variant in open_set:
var candidate: Vector3i = candidate_value
var score: int = int(g_score[candidate]) + _heuristic(candidate, goal)
if not has_best or score < best_score:
best = candidate
best_score = score
has_best = true
elif score == best_score and _coordinate_less(candidate, best):
best = candidate
return best
@@ -0,0 +1 @@
uid://d0fbg8t52lexf
@@ -0,0 +1,56 @@
extends WorldPreview
# Uncached geometry and reflective service lookup oracle.
func get_map_rect() -> Rect2:
var bounds := _world_bounds()
if bounds.is_empty():
return Rect2()
var dimensions := _cell_dimensions()
var map_size := Vector2(
int(bounds[&"max_x"]) - int(bounds[&"min_x"]) + 1,
int(bounds[&"max_y"]) - int(bounds[&"min_y"]) + 1
) * dimensions
return Rect2(((size - map_size) * 0.5 + pan_offset).floor(), map_size)
func _cell_dimensions() -> Vector2:
var bounds := _world_bounds()
if bounds.is_empty():
return Vector2(32, 48)
var columns := maxi(int(bounds[&"max_x"]) - int(bounds[&"min_x"]) + 1, 1)
var rows := maxi(int(bounds[&"max_y"]) - int(bounds[&"min_y"]) + 1, 1)
var available := (size - MAP_PADDING * 2.0).max(Vector2.ONE)
var fit := minf(available.x / (columns * 16.0), available.y / (rows * 24.0))
# Native 16px units use integer magnification. Large worlds can be viewed
# at overview scale, then enlarged with the same invertible camera mapping.
var pixel := maxf(floorf(fit), 1.0) if fit >= 1.0 else maxf(fit, 0.25)
return (Vector2(16, 24) * pixel * zoom_level).round().max(Vector2(4, 6))
func _service(property_name: StringName) -> Variant:
if _runtime == null or not _runtime is Object:
return null
for property: Dictionary in _runtime.get_property_list():
if StringName(property.get(&"name", &"")) == property_name:
return _runtime.get(property_name)
return null
func _world_bounds() -> Dictionary:
var world: Variant = _service(&"world_service")
if world == null or not world.has_method(&"get_bounds"):
return {}
var result: Variant = world.call(&"get_bounds")
if not result is Dictionary:
return {}
for key: StringName in [&"min_x", &"max_x", &"min_y", &"max_y"]:
if not result.has(key) and not result.has(String(key)):
return {}
return {
&"min_x": int(result.get(&"min_x", result.get("min_x", 0))),
&"max_x": int(result.get(&"max_x", result.get("max_x", -1))),
&"min_y": int(result.get(&"min_y", result.get("min_y", 0))),
&"max_y": int(result.get(&"max_y", result.get("max_y", -1))),
}
@@ -0,0 +1 @@
uid://df7jpvnx5bhb