tvanhens GitHub avatar

cyninja-prompt-demo

tvanhens

CyNinja 是一个 Godot 实验项目,用 GDScript 代码程序化生成像素风半机器人忍者角色及其全部动画帧,而不是手绘或扩散模型生成。

Stars

22

7 天增长

暂无数据

Fork 数

1

开放 Issue

0

开源协议

暂无数据

最近更新

2026-07-31

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它把美术生成重新定义为程序合成:精灵由函数构建,动画是骨骼蒙皮加程序化绘制的木偶系统,并通过无头审计保证风格一致性,而非依赖采样或人工修图。

适合谁使用

  • 探索程序化或代码驱动美术管线的游戏开发者
  • 对技术动画和像素画工作流感兴趣的 Godot 用户
  • 技术美术与工具开发者
  • 研究提示驱动或程序化生成机制的开发者

典型使用场景

  • 生成角色精灵表和动画剪辑,保持脸部、配色与比例一致
  • 通过修改一个调色板文件即可重绘整个角色或全部角色
  • 用自动化无头检查强制像素画风格规则
  • 从代码确定性重新生成演示 GIF 和视频

项目优势

  • 所有资源都是脚本,编辑是可审查的 diff,而不是重新生成图像
  • 一致性是结构性的:每一帧都由相同函数绘制,避免风格漂移
  • 风格规则由无头审计自动检查,质量可测试
  • README 中的媒体都可从代码重新生成

使用前须知

  • 需要 Godot 4.6+,依赖特定引擎版本
  • 项目仍是实验性质,目前处于动画原型阶段,只围绕一个主角
  • 采用此管线意味着接受以代码为中心的美术流程,并需要学习 Ink & Bones 系统

README 快速开始

CyNinja

An experiment in prompt-driven graphics: a pixel-art character — a half-robot cyborg ninja — whose every sprite and animation frame is constructed by code, not drawn by hand and not generated by a diffusion model. The prompts produce programs that produce the art.

640×360, integer scaling, nearest-neighbour — a 2D side-scroller viewport.

Why programs instead of diffusion

Image generators are good at one-off pictures and bad at the same character, again. A sprite sheet needs the identical face, palette, and proportions across dozens of frames, two facings, and two lighting themes — exactly where sampling noise, style drift, and anatomy glitches show up. This repo takes the other road:

  • Every asset is a script. art//*.gd files extend PixelAsset and draw into an Image pixel by pixel in build(). There are no authored image files in the repo at all.
  • Consistency is structural, not statistical. The character's face is the same in frame 30 as in frame 1 because it is the same function. Colors can never drift because every pixel comes from art/palette.gd — retheming the entire cast means editing that one file and rerunning the same code.
  • Edits are diffs, not regenerations. "Make the scarf longer" is a one-line change that alters nothing else, reviewable in version control like any other code.
  • Quality is testable. Because art is code, style rules (outline law, color-ramp discipline, no single-pixel noise) are enforced by headless audits rather than by eye alone.

The current phase is animation prototyping: the deliverables are the protagonist's motion clips and a recorded showcase.

How the animation works — "Ink & Bones"

Hand-keying pixel sprites frame by frame has the same drift problem as diffusion, just slower. Instead, a character is a puppet compiled to sprite frames (docs/ANIMATION.md is the full reference):

The five clips — idle, run, dash, jump, slash — baked from one rig and one paint pass. None of these frames exists as an authored image.

  1. Skeleton (art/skeleton.gd) — a bone hierarchy with float angles, two-bone IK for the legs (author where the foot goes, the knee falls out), and verlet chains for cloth (scarf, headband tails).
  2. Paint (art/paint.gd) — each body part is painted once, procedurally, in its bone's local

项目描述

Demo code for prompting a generative cybernetic ninja using Claude code.

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

VitSoonYoung
VitSoonYoung GitHub avatar

SpriteStack2D

SpriteStack2D is a Godot 4 addon that renders pseudo-3D sprite stacks from a single 2x2 sheet of orthographic pixel-art views.

GDScript
212
callmemhz
callmemhz GitHub avatar

godot-map-builder

A brush-based level editor plugin for Godot 4 that lets you create and edit 3D maps directly in the editor viewport, inspired by TrenchBroom.

GDScript
33