diff --git a/GameState.gd b/GameState.gd index 35c4bbc..c41a18b 100644 --- a/GameState.gd +++ b/GameState.gd @@ -329,13 +329,19 @@ const SKILL_TREE: Array = [ "desc": "Permanent: +1 vessel in the fleet.", }, { + # #70: was x=0.50 - the same lane freight's branch already occupies at + # this same depth (power_systems), so the two nodes were drawn + # directly on top of each other. Kept in line with wing (its own + # prerequisite, also x=0.82) instead, so the whole fleet-size + # doctrine branch now runs straight rather than zigzagging into + # someone else's lane. "id": "squadron", "name": "Squadron Doctrine", "cost": 70, "requires": "wing", - "x": 0.50, "fleet_bonus": 1, "research_points": 2, + "x": 0.82, "fleet_bonus": 1, "research_points": 2, "desc": "Permanent: +1 vessel in the fleet.", }, { "id": "armada", "name": "Armada Doctrine", "cost": 150, "requires": "squadron", - "x": 0.50, "fleet_bonus": 1, "research_points": 3, + "x": 0.82, "fleet_bonus": 1, "research_points": 3, "desc": "Permanent: +1 vessel in the fleet.", }, ] diff --git a/tests/test_skill_tree.gd b/tests/test_skill_tree.gd index e7dc526..0d3d9f6 100644 --- a/tests/test_skill_tree.gd +++ b/tests/test_skill_tree.gd @@ -29,6 +29,24 @@ var elapsed: float = 0.0 func _initialize() -> void: game_state = root.get_node("GameState") + + # --- #70: no two nodes drawn on top of each other ------------------- + # SkillTreeView.node_screen_pos() places a node purely from its own + # (depth, x) - two nodes sharing both values land on the exact same + # pixel with no visual way to tell them apart. depth is derived from + # `requires` chains, not authored directly, so this has to check the + # same way the view does rather than eyeballing the data. + var seen: Dictionary = {} + for node in GameState.SKILL_TREE: + var key: String = "%d:%s" % [game_state.skill_depth(node.id), node.x] + if seen.has(key): + print("TEST_SKILL_TREE: FAIL (%s and %s are both at depth/x %s - drawn on top of each other)" \ + % [seen[key], node.id, key]) + quit(1) + return + seen[key] = node.id + print("no two skill-tree nodes share the same (depth, x)") + game_state.rocks = 500 game_state.buildings.clear() game_state.extractors.clear()