/* * Source Code (.pde / .php): MIT License; Documents & Open Data: CC0 1.0 Universal; * Copyright (c) 2026 Jan Bühring & Adaptive Intelligence Synthesis Network (Google AI). * * Project Database: https://xqskys.de * Framework: DTIM-ZEC Modular Physics Framework (DAMTP Academic Standard) * Compatibility: Processing 4.5.7 (Java) & processing.min.js (Web Canvas) */ // ============================================================================ // 1. GLOBAL CONFIGURATION & ACCESSIBILITY STATE // ============================================================================ boolean a11yMode = false; int turnNumber = 1; String statusMessage = "Willkommen im axiomatischen Sektor! Klicke ein Sternensystem an."; // Resources (Norn & Guinea Pig Alliance) int energy = 40; int research = 0; int bioFood = 25; // Species Constants: 0 = Neutral, 1 = Norn & Meerschweinchen, 2 = Cyborg-Pflanzen int OWNER_NEUTRAL = 0; int OWNER_NORN = 1; int OWNER_CYBORG = 2; // ============================================================================ // 2. STAR SYSTEMS (DTIM-ZEC GRAPH NODES) // ============================================================================ int NUM_STARS = 14; String[] starName = { "Norn-Heimat", "Wheek-Garten", "ZEC-Knoten Alpha", "Chlorophyll-IX", "Axion-Pol", "Gurken-Nebel", "Synapse-IV", "Quant-Bremen", "Myzel-Tor", "Vakuum-Kern", "Sporen-Drift", "Metrik-Stern", "Habitat-Omega", "Xeno-Wurzel" }; float[] starX = new float[NUM_STARS]; float[] starY = new float[NUM_STARS]; int[] starOwner = new int[NUM_STARS]; int[] starPop = new int[NUM_STARS]; // Population / Colony size (1..10) int[] starLab = new int[NUM_STARS]; // Research Lab level (0..3) int[] starMine = new int[NUM_STARS]; // Energy Extractor level (0..3) int[] starBio = new int[NUM_STARS]; // Guinea Pig Bio-Dome level (0..3) int[] starShipsNorn = new int[NUM_STARS]; // Norn Scout/Colony ships stationed int[] starShipsCyborg = new int[NUM_STARS]; // Hyperlane Adjacency Matrix boolean[][] hyperlane = new boolean[NUM_STARS][NUM_STARS]; int selectedStar = 0; // ============================================================================ // 3. AXIOMATIC TECH TREE (3 AXIOMS x 3 TIERS) // ============================================================================ // Branch 0: Axiom I - Diskrete Raumzeit-Metrik (Sprungreichweite & Schiffsbau) // Branch 1: Axiom II - Quanten-Resonanz (Energie & Flottenstärke) // Branch 2: Axiom III - Bio-Kybernetische Symbiose (Meerschweinchen-Boost & Diplomatie) int[] techLevel = {0, 0, 0}; // 0..3 per branch int activeResearchBranch = 0; String[][] techNames = { {"I.1 Diskrete Metrik", "I.2 Knoten-Sprung", "I.3 ZEC-Faltung"}, {"II.1 Vakuum-Fluss", "II.2 Resonanz-Schild", "II.3 Nullpunkt-Kern"}, {"III.1 Wheek-Symbiose", "III.2 Bio-Harmonie", "III.3 Xeno-Wurzel-Code"} }; int[] techCosts = {25, 55, 95}; // Background decorative stars int NUM_BG_STARS = 55; float[] bgX = new float[NUM_BG_STARS]; float[] bgY = new float[NUM_BG_STARS]; // ============================================================================ // 4. INITIALIZATION // ============================================================================ void setup() { size(1040, 680); smooth(); textFont(createFont("SansSerif", 13)); for (int i = 0; i < NUM_BG_STARS; i++) { bgX[i] = random(width - 300); bgY[i] = random(50, height - 40); } initGalaxy(); } void initGalaxy() { turnNumber = 1; energy = 40; research = 0; bioFood = 25; techLevel[0] = 0; techLevel[1] = 0; techLevel[2] = 0; activeResearchBranch = 0; // Fixed balanced coordinates on the left map area (0..720) float[] px = {110, 210, 175, 610, 340, 290, 480, 120, 560, 410, 640, 320, 490, 630}; float[] py = {160, 115, 295, 520, 175, 430, 230, 510, 365, 320, 145, 555, 495, 260}; for (int i = 0; i < NUM_STARS; i++) { starX[i] = px[i]; starY[i] = py[i]; starOwner[i] = OWNER_NEUTRAL; starPop[i] = 0; starLab[i] = 0; starMine[i] = 0; starBio[i] = 0; starShipsNorn[i] = 0; starShipsCyborg[i] = 0; for (int j = 0; j < NUM_STARS; j++) { hyperlane[i][j] = false; } } // Connect nearby stars into a DTIM-ZEC graph for (int i = 0; i < NUM_STARS; i++) { for (int j = i + 1; j < NUM_STARS; j++) { float d = dist(starX[i], starY[i], starX[j], starY[j]); if (d < 195) { hyperlane[i][j] = true; hyperlane[j][i] = true; } } } // Setup Norn & Guinea Pig Homeworld (Index 0) starOwner[0] = OWNER_NORN; starPop[0] = 3; starLab[0] = 1; starMine[0] = 1; starBio[0] = 1; starShipsNorn[0] = 2; // Setup Cyborg-Pflanzen Homeworld (Index 3) starOwner[3] = OWNER_CYBORG; starPop[3] = 3; starLab[3] = 1; starMine[3] = 1; starBio[3] = 1; starShipsCyborg[3] = 2; selectedStar = 0; statusMessage = "Runde 1: Die Norn & Meerschweinchen starten auf Norn-Heimat."; } // ============================================================================ // 5. MAIN DRAW LOOP // ============================================================================ void draw() { drawBackground(); drawHyperlanes(); drawStarSystems(); drawTopBar(); drawSidePanel(); drawBottomBar(); } // ============================================================================ // 6. RENDERING: GALAXY MAP // ============================================================================ void drawBackground() { if (a11yMode) { background(0); } else { background(12, 17, 29); } noStroke(); for (int i = 0; i < NUM_BG_STARS; i++) { fill(a11yMode ? 180 : color(160, 185, 220, 95)); ellipse(bgX[i], bgY[i], 2, 2); } } void drawHyperlanes() { for (int i = 0; i < NUM_STARS; i++) { for (int j = i + 1; j < NUM_STARS; j++) { if (hyperlane[i][j]) { boolean isConnectedToSelected = (i == selectedStar || j == selectedStar); if (a11yMode) { stroke(isConnectedToSelected ? color(255, 255, 0) : color(140)); strokeWeight(isConnectedToSelected ? 2.5 : 1.2); } else { stroke(isConnectedToSelected ? color(100, 215, 200, 190) : color(70, 95, 130, 110)); strokeWeight(isConnectedToSelected ? 2.2 : 1.3); } line(starX[i], starY[i], starX[j], starY[j]); } } } } void drawStarSystems() { for (int i = 0; i < NUM_STARS; i++) { float x = starX[i]; float y = starY[i]; float r = 18; // Selection Halo if (i == selectedStar) { noFill(); stroke(a11yMode ? color(255, 255, 0) : color(255, 220, 110)); strokeWeight(2.5); ellipse(x, y, r * 2.5, r * 2.5); } // Star Node Visuals by Species (Color + Distinct Shape Indicator) if (starOwner[i] == OWNER_NORN) { // Norn & Guinea Pigs: Teal/Blue Circle + Inner Ring if (a11yMode) { fill(0, 180, 255); stroke(255); strokeWeight(2.5); } else { fill(65, 165, 225); stroke(180, 235, 255); strokeWeight(2); } ellipse(x, y, r * 1.7, r * 1.7); noFill(); ellipse(x, y, r * 0.9, r * 0.9); } else if (starOwner[i] == OWNER_CYBORG) { // Cyborg-Pflanzen: Magenta/Green Diamond Shape if (a11yMode) { fill(255, 80, 180); stroke(255); strokeWeight(2.5); } else { fill(195, 75, 130); stroke(130, 235, 140); strokeWeight(2); } quad(x, y - r, x + r, y, x, y + r, x - r, y); } else { // Neutral System: Dashed/Simple Gray Hexagon-like Circle if (a11yMode) { fill(30); stroke(220); strokeWeight(2); } else { fill(55, 65, 85); stroke(140, 155, 175); strokeWeight(1.5); } ellipse(x, y, r * 1.35, r * 1.35); } // Fleet Badges (Norn left, Cyborg right) if (starShipsNorn[i] > 0) { fill(a11yMode ? color(0, 255, 255) : color(110, 230, 255)); noStroke(); triangle(x - 24, y - 6, x - 14, y, x - 24, y + 6); textAlign(RIGHT, CENTER); text(starShipsNorn[i], x - 27, y); } if (starShipsCyborg[i] > 0) { fill(a11yMode ? color(255, 120, 220) : color(245, 120, 175)); noStroke(); triangle(x + 24, y - 6, x + 14, y, x + 24, y + 6); textAlign(LEFT, CENTER); text(starShipsCyborg[i], x + 27, y); } // Star Name & Population Label textAlign(CENTER, TOP); fill(a11yMode ? 255 : 225); String label = starName[i]; if (starOwner[i] != OWNER_NEUTRAL) { label += " [" + starPop[i] + "]"; } text(label, x, y + 18); } } // ============================================================================ // 7. RENDERING: HUD & AXIOMATIC TECH SIDEBAR // ============================================================================ void drawTopBar() { rectMode(CORNER); if (a11yMode) { fill(0); stroke(255); strokeWeight(2); } else { fill(18, 25, 42, 235); stroke(70, 105, 140); strokeWeight(1); } rect(10, 10, width - 20, 36, 6); fill(a11yMode ? 255 : 235); noStroke(); textAlign(LEFT, CENTER); int nornCols = countColonies(OWNER_NORN); int cyborgCols = countColonies(OWNER_CYBORG); String modeStr = a11yMode ? "High Contrast [H]" : "Standard [H]"; String topInfo = "DTIM-ZEC: FREE ORION | Runde: " + turnNumber + " | Energie: " + energy + " | Bio-Nahrung: " + bioFood + " | Forschung: " + research + " | Kolonien (Norn/Cyborg): " + nornCols + " : " + cyborgCols + " | " + modeStr; text(topInfo, 22, 28); } void drawSidePanel() { float px = 720; float py = 56; float pw = 310; float ph = height - 104; rectMode(CORNER); if (a11yMode) { fill(10); stroke(255); strokeWeight(2); } else { fill(18, 26, 44, 240); stroke(75, 110, 150); strokeWeight(1.5); } rect(px, py, pw, ph, 8); float cx = px + 16; float cy = py + 24; textAlign(LEFT, CENTER); // --- SECTION A: SELECTED SYSTEM --- fill(a11yMode ? color(255, 255, 0) : color(120, 220, 205)); text("SYSTEM: " + starName[selectedStar], cx, cy); cy += 22; String ownerText = "Neutral (Unbesiedelt)"; if (starOwner[selectedStar] == OWNER_NORN) ownerText = "Norn & Meerschweinchen (Pop " + starPop[selectedStar] + ")"; if (starOwner[selectedStar] == OWNER_CYBORG) ownerText = "Cyborg-Pflanzen (Pop " + starPop[selectedStar] + ")"; fill(a11yMode ? 255 : 215); text("Status: " + ownerText, cx, cy); cy += 20; text("Norn-Flotte: " + starShipsNorn[selectedStar] + " | Cyborg-Flotte: " + starShipsCyborg[selectedStar], cx, cy); cy += 26; if (starOwner[selectedStar] == OWNER_NORN) { text("Ausbau: Mine Lv." + starMine[selectedStar] + " | Labor Lv." + starLab[selectedStar] + " | Bio-Kuppel Lv." + starBio[selectedStar], cx, cy); cy += 26; // Action Buttons for Norn Colony drawButton(cx, cy, 278, 28, "[1] Energie-Mine ausbauen (15 Energie)"); cy += 34; drawButton(cx, cy, 278, 28, "[2] DTIM-Labor ausbauen (15 Energie)"); cy += 34; drawButton(cx, cy, 278, 28, "[3] Meerschweinchen-Kuppel (15 Energie)"); cy += 34; drawButton(cx, cy, 278, 28, "[4] Norn-Forschungsschiff bauen (20 Energie)"); cy += 42; } else { // Neutral or Cyborg System Actions if (starShipsNorn[selectedStar] > 0 && starShipsCyborg[selectedStar] == 0 && starOwner[selectedStar] == OWNER_NEUTRAL) { drawButton(cx, cy, 278, 30, "[K] System kolonisieren (20 Bio-Nahrung)"); cy += 40; } else { fill(a11yMode ? 220 : 160, 180, 205); text("Tipp: Fliege ein Norn-Schiff über eine", cx, cy); cy += 18; text("verbundene Linie hierher (Rechtsklick).", cx, cy); cy += 32; } } // Divider stroke(a11yMode ? 255 : color(70, 100, 135)); line(cx, cy, px + pw - 16, cy); cy += 20; // --- SECTION B: AXIOMATIC TECH TREE --- fill(a11yMode ? color(255, 255, 0) : color(120, 220, 205)); text("AXIOMATISCHER TECHTREE (Klick = Fokus)", cx, cy); cy += 24; for (int b = 0; b < 3; b++) { int lvl = techLevel[b]; String tLabel; if (lvl >= 3) { tLabel = "Axiom " + (b + 1) + ": MAXIMIERT (Stufe 3)"; } else { tLabel = techNames[b][lvl] + " (" + techCosts[lvl] + " FP)"; } boolean isFocus = (activeResearchBranch == b); String prefix = isFocus ? ">> " : " "; drawTechButton(cx, cy, 278, 30, prefix + tLabel, isFocus); cy += 36; } cy += 14; // Next Turn Button drawPrimaryButton(cx, cy, 278, 38, "NÄCHSTE RUNDE [SPACE / ENTER]"); } void drawButton(float x, float y, float w, float h, String label) { if (a11yMode) { fill(0); stroke(255); strokeWeight(2); } else { fill(32, 46, 74); stroke(95, 145, 195); strokeWeight(1); } rect(x, y, w, h, 5); fill(a11yMode ? 255 : 230); noStroke(); textAlign(LEFT, CENTER); text(label, x + 10, y + h * 0.5); } void drawTechButton(float x, float y, float w, float h, String label, boolean active) { if (a11yMode) { fill(active ? 50 : 0); stroke(active ? color(255, 255, 0) : color(200)); strokeWeight(active ? 2.5 : 1.5); } else { fill(active ? color(42, 74, 96) : color(28, 38, 60)); stroke(active ? color(110, 225, 205) : color(80, 110, 145)); strokeWeight(active ? 2 : 1); } rect(x, y, w, h, 5); fill(a11yMode ? 255 : 235); noStroke(); textAlign(LEFT, CENTER); text(label, x + 10, y + h * 0.5); } void drawPrimaryButton(float x, float y, float w, float h, String label) { if (a11yMode) { fill(255, 255, 0); stroke(255); strokeWeight(2); } else { fill(48, 135, 120); stroke(130, 240, 215); strokeWeight(1.5); } rect(x, y, w, h, 6); fill(a11yMode ? 0 : 255); noStroke(); textAlign(CENTER, CENTER); text(label, x + w * 0.5, y + h * 0.5); } void drawBottomBar() { rectMode(CORNER); if (a11yMode) { fill(0); stroke(255); strokeWeight(2); } else { fill(18, 25, 42, 235); stroke(70, 105, 140); strokeWeight(1); } rect(10, height - 38, width - 20, 28, 5); fill(a11yMode ? color(255, 255, 0) : color(195, 225, 245)); noStroke(); textAlign(LEFT, CENTER); text("Log: " + statusMessage + " | [Linksklick] Wählen [Rechtsklick] Schiff bewegen [H] Sehhilfe [R] Neustart", 22, height - 24); } // ============================================================================ // 8. TURN LOGIC, SPACE COMBAT & CYBORG-PLANT AI // ============================================================================ void endTurn() { turnNumber++; int energyIncome = 4; int researchIncome = 3; int foodIncome = 3; // Calculate Norn & Cyborg Economy for (int i = 0; i < NUM_STARS; i++) { if (starOwner[i] == OWNER_NORN) { int axiom2Bonus = (techLevel[1] >= 1) ? 2 : 0; int axiom3Bonus = (techLevel[2] >= 1) ? 2 : 0; energyIncome += 3 + starMine[i] * 4 + axiom2Bonus; researchIncome += 2 + starLab[i] * 5 + (techLevel[2] >= 2 ? 3 : 0); foodIncome += 2 + starBio[i] * 4 + axiom3Bonus; // Population growth via Guinea Pig Bio-Domes if (starPop[i] < 10 && turnNumber % 3 == 0) { starPop[i]++; } } else if (starOwner[i] == OWNER_CYBORG) { if (starPop[i] < 10 && turnNumber % 3 == 0) { starPop[i]++; } // Cyborg-Pflanzen grow ships periodically if (turnNumber % 3 == 0) { starShipsCyborg[i]++; } } } energy += energyIncome; research += researchIncome; bioFood += foodIncome; // Apply Axiomatic Research Progress int b = activeResearchBranch; if (techLevel[b] < 3) { int cost = techCosts[techLevel[b]]; if (research >= cost) { research -= cost; techLevel[b]++; statusMessage = "Forschungsdurchbruch! " + techNames[b][techLevel[b] - 1] + " freigeschaltet!"; } else { statusMessage = "Runde " + turnNumber + ": +" + energyIncome + " Energie, +" + bioFood + " Bio, +" + researchIncome + " Forschung."; } } else { statusMessage = "Runde " + turnNumber + ": +" + energyIncome + " Energie, +" + bioFood + " Bio, +" + researchIncome + " Forschung."; } // Cyborg-Pflanzen AI Turn runCyborgAI(); // Resolve Skirmishes in Contested Systems resolveConflicts(); } void runCyborgAI() { for (int i = 0; i < NUM_STARS; i++) { if (starOwner[i] == OWNER_CYBORG && starShipsCyborg[i] > 1) { // Find connected target for (int j = 0; j < NUM_STARS; j++) { if (hyperlane[i][j] && starOwner[j] != OWNER_CYBORG) { starShipsCyborg[i]--; starShipsCyborg[j]++; if (starOwner[j] == OWNER_NEUTRAL && starShipsNorn[j] == 0) { starOwner[j] = OWNER_CYBORG; starPop[j] = 1; statusMessage = "Warnung: Cyborg-Pflanzen haben " + starName[j] + " überwuchert!"; } break; } } } } } void resolveConflicts() { for (int i = 0; i < NUM_STARS; i++) { if (starShipsNorn[i] > 0 && starShipsCyborg[i] > 0) { // Axiom II Tier 2 gives Norn shield bonus int nornPower = starShipsNorn[i] * (techLevel[1] >= 2 ? 2 : 1); int cyborgPower = starShipsCyborg[i]; if (nornPower >= cyborgPower) { starShipsCyborg[i] = 0; starShipsNorn[i] = max(1, starShipsNorn[i] - 1); if (starOwner[i] == OWNER_CYBORG) { starOwner[i] = OWNER_NORN; starPop[i] = 1; statusMessage = "Sieg! Norn-Flotte befreit " + starName[i] + " von den Cyborg-Pflanzen!"; } } else { starShipsNorn[i] = 0; starShipsCyborg[i] = max(1, starShipsCyborg[i] - 1); if (starOwner[i] == OWNER_NORN) { starOwner[i] = OWNER_CYBORG; statusMessage = "Rückzug! Cyborg-Pflanzen übernehmen " + starName[i] + "."; } } } } } int countColonies(int owner) { int c = 0; for (int i = 0; i < NUM_STARS; i++) { if (starOwner[i] == owner) c++; } return c; } // ============================================================================ // 9. PLAYER ACTIONS & INPUT HANDLING // ============================================================================ void buildStructure(int type) { if (starOwner[selectedStar] != OWNER_NORN) return; if (type == 1 && energy >= 15 && starMine[selectedStar] < 3) { energy -= 15; starMine[selectedStar]++; statusMessage = "Energie-Mine auf " + starName[selectedStar] + " ausgebaut (Lv." + starMine[selectedStar] + ")."; } else if (type == 2 && energy >= 15 && starLab[selectedStar] < 3) { energy -= 15; starLab[selectedStar]++; statusMessage = "DTIM-Labor auf " + starName[selectedStar] + " ausgebaut (Lv." + starLab[selectedStar] + ")."; } else if (type == 3 && energy >= 15 && starBio[selectedStar] < 3) { energy -= 15; starBio[selectedStar]++; statusMessage = "Wheek! Meerschweinchen-Bio-Kuppel auf " + starName[selectedStar] + " erweitert!"; } else if (type == 4 && energy >= 20) { energy -= 20; starShipsNorn[selectedStar]++; statusMessage = "Neues Norn-Forschungsschiff bei " + starName[selectedStar] + " gestartet."; } else { statusMessage = "Nicht genug Energie oder maximale Ausbaustufe erreicht."; } } void colonizeSelected() { if (starOwner[selectedStar] == OWNER_NEUTRAL && starShipsNorn[selectedStar] > 0 && bioFood >= 20) { bioFood -= 20; starOwner[selectedStar] = OWNER_NORN; starPop[selectedStar] = 1; starBio[selectedStar] = 1; statusMessage = "Wheek! Neue Norn-Kolonie auf " + starName[selectedStar] + " gegründet!"; } else { statusMessage = "Kolonisierung benötigt 1 Norn-Schiff im System & 20 Bio-Nahrung."; } } void mousePressed() { // 1. Check Star System Clicks on Map for (int i = 0; i < NUM_STARS; i++) { if (dist(mouseX, mouseY, starX[i], starY[i]) < 24) { if (mouseButton == LEFT) { selectedStar = i; statusMessage = "System " + starName[i] + " ausgewählt."; } else if (mouseButton == RIGHT) { // Move 1 Norn ship from selectedStar to clicked star if connected (or Axiom I Tier 2 allows 2-hop) boolean canReach = hyperlane[selectedStar][i]; if (!canReach && techLevel[0] >= 2) { for (int mid = 0; mid < NUM_STARS; mid++) { if (hyperlane[selectedStar][mid] && hyperlane[mid][i]) canReach = true; } } if (canReach && starShipsNorn[selectedStar] > 0 && selectedStar != i) { starShipsNorn[selectedStar]--; starShipsNorn[i]++; selectedStar = i; statusMessage = "Norn-Schiff springt nach " + starName[i] + "."; } else { statusMessage = "Keine direkte Hyperraum-Verbindung (erforsche Axiom I für größere Sprünge)."; } } return; } } // 2. Check Sidebar Buttons float cx = 736; if (mouseX >= cx && mouseX <= cx + 278) { if (starOwner[selectedStar] == OWNER_NORN) { if (mouseY >= 152 && mouseY <= 180) buildStructure(1); if (mouseY >= 186 && mouseY <= 214) buildStructure(2); if (mouseY >= 220 && mouseY <= 248) buildStructure(3); if (mouseY >= 254 && mouseY <= 282) buildStructure(4); } else { if (mouseY >= 152 && mouseY <= 182) colonizeSelected(); } // Tech Tree Selection float techStartY = (starOwner[selectedStar] == OWNER_NORN) ? 340 : 238; for (int b = 0; b < 3; b++) { float by = techStartY + b * 36; if (mouseY >= by && mouseY <= by + 30) { activeResearchBranch = b; statusMessage = "Forschungsfokus auf Axiom " + (b + 1) + " gesetzt."; } } // Next Turn Button float turnBtnY = techStartY + 3 * 36 + 14; if (mouseY >= turnBtnY && mouseY <= turnBtnY + 38) { endTurn(); } } } void keyPressed() { if (key == '1') buildStructure(1); if (key == '2') buildStructure(2); if (key == '3') buildStructure(3); if (key == '4') buildStructure(4); if (key == 'k' || key == 'K') colonizeSelected(); if (key == ' ' || keyCode == ENTER || keyCode == RETURN) { endTurn(); } if (key == 'h' || key == 'H') { a11yMode = !a11yMode; } if (key == 'r' || key == 'R') { initGalaxy(); } }