Files
Robot-Clash/sprite-generator/variants.py
Michi 7a69651b6d Online-Lobby, Arenen, Lackiererei, ComfyGen-Grafik, Verschleierung
Grosse Erweiterung ueber die erste spielbare Version hinaus:

- Online (Firebase ueber REST, kein SDK): Konto per E-Mail, globale Lobby
  mit Laender-Raeumen, Herausfordern, Live-PvP (Host rechnet, Gast
  interpoliert, KI-Uebernahme bei Lag). Gast kann anonym beitreten.
  net.js / lobby.js / netfight.js, Regeln in docs/firebase.
- 3 Arenen in verschiedenen Groessen (RC.ARENAS, half 8/12/16), Kamera +
  Licht + Boden skalieren; Liga skaliert die Arena mit, Setting + online
  aus Seed. Harte Rams/Wandtreffer schleudern Roboter auf den Rucken.
- Intro (3D-Kamerafahrt), Titel, Einstellungen (Kamera, Schwierigkeit,
  Steuerung, Grafik, Arena), Lackiererei (painter.js, selbst bemalen).
- Shop mit ComfyGen-Sprites (aus den 3D-Teilen erzeugt), Liga-Gegner sehen
  aus wie ihre Portraits (looks.js), kraeftigere Waffen-Modelle.
- Oekonomie: Startgeld 800, Schadensbonus, Schaukaempfe, Online-Preisgeld.
- Verschleierung: build.ps1 -Obfuscate (terser), tablet-taugliche Touch-UI.
- Tests: tests/sim.test.js, balance.js, online.test.js. Dev-Tools in tools/.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-13 15:45:35 +01:00

54 lines
3.4 KiB
Python

"""Robot Clash - shop images made from the real 3D parts (generate_variants.py, Flux.2 Klein + ReferenceLatent).
Reference r3d_<id> = the part exactly as the game builds it (tools/partshots.ps1 renders them into output/).
Flux keeps shape, proportions and viewing angle and paints it in the sprite style, so the shop picture
matches what ends up on the robot.
..\\tools\\partshots.ps1 3D renders -> output/r3d_<id>_raw_00001_.png
gen generate_variants all part images (part_<id>)
gen adopt --size 192 part_<id>
VARIANTS = [(name, ref_name, prompt)]
"""
STYLE = (
"keep exactly the same object, the same shape, proportions, parts and viewing angle as the reference image; "
"render it as a detailed game sprite: scratched painted steel, bolts and rivets, small yellow and black hazard stripe details, "
"soft studio lighting, crisp edges, high detail, centred single subject, plain solid black background, no text"
)
_P = {
'crate': "a plain rectangular steel robot chassis box with a raised accent strip on top",
'doorstop': "a low wedge-shaped steel robot chassis, flat sloped front, hazard stripes on the flat rear deck",
'bulwark': "a large heavy rectangular steel robot chassis box with a raised accent strip on top",
'scarab': "a robot chassis base plate with a smooth round steel dome shell and an accent ring around the dome",
'rubber': "a set of four small rubber robot wheels with steel hubs",
'bigtyre': "a pair of huge chunky rubber tyres with steel hubs",
'tracks': "a pair of long tank crawler tracks with round end wheels",
'steel': "a U-shaped set of three plain grey riveted steel armour plates (two side plates and a rear plate)",
'titan': "a U-shaped set of three light blue-grey titanium armour panels with bolts",
'hardox': "a U-shaped set of three thick yellowish hardened steel wear plates with heavy bolts",
'wedge': "a flat angled steel ramming wedge plate",
'flipper': "a flat steel flipper plate with an accent stripe, hinged at its rear edge",
'hammer': "a robot axe hammer: long steel arm on a pivot block with an axe head pointing down at the end",
'saw': "a large circular saw blade on a short motor arm",
'crusher': "two hydraulic crusher jaw arms side by side with sharp teeth at the tips",
'spinner': "a long horizontal steel spinner bar with hardened teeth blocks at both ends on a central hub",
'flamer': "a small robot turret base with a red fuel tank and a steel flamethrower nozzle",
'minigun': "a small robot turret base with a housing and a rotating multi-barrel minigun",
'rockets': "a small robot turret base carrying a box-shaped rocket pod with four tubes",
}
VARIANTS = [(f"part_{k}", f"r3d_{k}", v) for k, v in _P.items()]
# motor + battery are not visible on the 3D robot: restyle the existing picture (reference = itself)
_INNER = {
'sparky': "a small cheap electric motor with a few wires",
'hornet': "a sleek electric motor with cooling fins",
'bulldog': "a massive high torque gear motor with a big gearbox",
'comet': "a high speed racing electric motor with a glowing blue cooling ring",
'lead': "a heavy old lead acid battery block with two terminals",
'nicd': "a pack of green battery cells strapped together",
'lipo': "a slim modern lithium battery stack with small charge lights",
}
VARIANTS += [(f"part_{k}", f"part_{k}", v) for k, v in _INNER.items()]