mcpField
G
game-asset-generation

game-asset-generation

github.com/eachlabs创意与媒体44568 次安装今天更新
代码仓库

关于 game-asset-generation

game-asset-generation 是面向独立开发者、游戏工作室和 Game Jam 团队的 each::sense 技能,用于制作游戏美术资源,涵盖精灵图、纹理、UI 和图标,并支持迭代生成一组风格一致的资源。

主要功能

  1. 012D 精灵图与精灵表
  2. 02无缝游戏纹理
  3. 03UI 元素与图标
  4. 04图块集与加载画面
  5. 05迭代生成资源

适用场景

  1. 01制作角色精灵图
  2. 02构建 RPG 界面元素
  3. 03生成重复铺设的环境纹理
  4. 04制作游戏概念美术

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/eachlabs/skills --skill game-asset-generation

安装后在 Claude Code 中输入/game-asset-generation确认已加载。

附带文件references/SSE-EVENTS.md

详细介绍

游戏素材生成

使用 each::sense 生成专业的游戏美术素材。这项技能可创建适用于游戏开发工作流的 2D 精灵、纹理、UI 元素、图标、环境等内容。

节省成本

与传统游戏美术制作相比,成本可降低 60-80%。AI 驱动的素材生成可大幅减少独立开发者、工作室和游戏创作活动所需的时间与预算。

功能

  • 2D 精灵:像素风角色、物件和道具
  • 精灵图集:包含多个姿势、可用于动画的角色图集
  • 游戏纹理:适用于环境的无缝平铺纹理
  • UI 元素:按钮、边框、生命值条、物品栏槽位
  • 游戏图标:物品图标、技能图标、成就徽章
  • 图块集:适用于平台游戏、RPG、策略游戏的环境图块
  • 加载画面:富有氛围感的加载画面和启动画面
  • 游戏 Logo:标题 Logo 和品牌素材
  • 概念美术:视觉开发素材和情绪板

快速开始

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a 32x32 pixel art sword icon for an RPG game, golden blade with ornate hilt, transparent background"}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'

常见游戏美术尺寸

素材类型常见尺寸用途
像素风图标16x16, 32x32, 64x64物品栏物品、技能
角色精灵32x32, 64x64, 128x128玩家/NPC 角色
精灵图集512x512, 1024x1024动画帧
纹理256x256, 512x512, 1024x1024环境表面
UI 元素多种尺寸按钮、边框、条形元素
加载画面1920x1080, 2560x1440全屏显示

使用场景示例

1. 2D 精灵生成(像素风)
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a 64x64 pixel art character sprite of a medieval knight with blue armor and silver sword. Retro 16-bit style, side view facing right, transparent background. Clean pixel edges, no anti-aliasing."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
2. 角色精灵图集
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a character sprite sheet for a pixel art wizard character. Include 8 frames: 2 idle poses, 2 walking frames, 2 attack frames, 1 jump, 1 hurt pose. 32x32 per frame, arranged in a 4x2 grid (256x64 total). Purple robe, white beard, wooden staff."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
3. 游戏纹理生成(无缝)
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a seamless tileable 512x512 stone dungeon floor texture. Dark gray cobblestones with moss growing between cracks, worn and weathered look. Must tile perfectly with no visible seams when repeated."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
4. 游戏图标集
# First icon
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a 64x64 pixel art health potion icon for an RPG. Red liquid in a glass flask with cork stopper, glowing effect, transparent background. Fantasy game style."}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "rpg-icons-set"
  }'

# Second icon (same session for style consistency)
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a mana potion icon in the same style. Blue liquid instead of red, same flask design, matching art style."}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "rpg-icons-set"
  }'

# Third icon
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a stamina potion icon. Green liquid, same consistent style as the health and mana potions."}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "rpg-icons-set"
  }'
5. UI 元素(按钮、边框、条形元素)
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a fantasy RPG UI kit containing: 1 rectangular button (200x50) with stone texture and gold border, 1 health bar frame (300x30) with ornate metal design, 1 inventory slot frame (64x64) with wooden texture and metal corners. Arrange on transparent background. Medieval fantasy style matching games like Diablo or Baldur'\''s Gate."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
6. 环境/图块集生成
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a 2D platformer tileset for a forest level. Include 16x16 pixel tiles: grass top, dirt fill, grass corner pieces (4 corners), tree trunk, leaves, flowers, rocks, wooden platform. Arrange in a tileset grid. Colorful cartoon style similar to classic platformers. 256x256 total sheet."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
7. 物品/武器图标
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a set of 6 weapon icons for a fantasy game, each 48x48 pixels: iron sword, wooden bow, fire staff, battle axe, throwing daggers, war hammer. Arrange in a 3x2 grid. Consistent hand-painted style with slight glow effects, transparent backgrounds. Top-down perspective for inventory display."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
8. 加载画面美术
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a 1920x1080 loading screen for a dark fantasy action RPG. Epic scene showing a lone warrior silhouette standing before a massive gothic castle on a cliff, stormy sky with lightning, dark moody atmosphere. Leave space at bottom center for a loading bar. Painterly digital art style."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
9. 游戏 Logo 设计
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a game logo for a space shooter called \"NOVA STRIKE\". Bold metallic chrome letters with neon blue glow effects, slight 3D perspective, stars and energy particles around it. Sci-fi futuristic style. Transparent background, 1024x512 resolution. Suitable for title screen and marketing."}],

    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'
10. 游戏概念美术
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create concept art for a post-apocalyptic survival game. Show an abandoned city overgrown with vegetation, rusted vehicles, crumbling skyscrapers with trees growing through them, dramatic sunset lighting breaking through clouds. Painterly concept art style like The Last of Us or Horizon. 16:9 aspect ratio for presentation."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max"
  }'

最佳实践

精灵美术
  • 指定精确尺寸:务必注明像素尺寸(32x32、64x64)
  • 注明透明度:要求使用透明背景,以便集成到游戏中
  • 定义视角:侧视、俯视、等距视角、正面视角
  • 明确美术风格:像素风、手绘、矢量、复古 8 位/16 位
纹理
  • 要求无缝:对于重复使用的纹理,务必注明“无缝平铺”
  • 使用 2 的幂次尺寸:使用 256、512、1024,以获得最佳 GPU 性能
  • 说明材质细节:描述磨损、风化、年代和状况
图标集
  • 使用 session_id:在多个图标间保持风格一致
  • 采用网格排列:要求为精灵图集提供整齐的布局
  • 保持光照一致:指定光照方向,使整组图标协调统一
UI 元素
  • 留出安全区域:为文本和动态内容预留空间
  • 考虑缩放:考虑素材在不同分辨率下的缩放表现
  • 提供状态变体:要求按钮提供普通、悬停、按下状态

模式选择

生成前询问用户:

“您想要快速且便宜的方案,还是高质量方案?”

模式适用场景速度质量
max最终成品素材、主视觉、关键美术图较慢最高
eco快速迭代、概念探索、原型制作较快良好

多轮素材迭代

使用 session_id 迭代并创建风格一致的素材集:

# Initial character design
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a pixel art hero character for a platformer game, 64x64, knight with red cape"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "hero-character-project"
  }'

# Request variations
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create the same character but with a blue cape for player 2, matching style exactly"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "hero-character-project"
  }'

# Create matching enemy
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create an enemy character in the same pixel art style - a skeleton warrior, same size and art direction"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "hero-character-project"
  }'

批量素材生成

高效生成多个变体:

# Style A - Pixel Art
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a treasure chest icon, 32x32, pixel art, closed position"}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "eco"
  }'

# Style B - Hand-painted
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a treasure chest icon, 64x64, hand-painted fantasy style, closed position"}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "eco"
  }'

# Style C - Modern Vector
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Create a treasure chest icon, 128x128, clean vector style with gradients, modern mobile game look"}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "eco"
  }'

错误处理

错误原因解决方案
Failed to create prediction: HTTP 422余额不足在 eachlabs.ai 充值
内容政策违规内容不允许调整提示词,避免暴力/露骨内容
超时生成内容复杂将客户端超时设为至少 10 分钟

游戏素材的提示词技巧

创建游戏美术素材时,请在提示词中包含以下详细信息:

  1. 尺寸:精确的像素大小(32x32、512x512)
  2. 美术风格:像素风、手绘、矢量、复古、现代
  3. 视角:侧视、俯视、等距、3/4 视角
  4. 背景:透明、纯色或场景背景
  5. 调色板:有限的调色板、鲜艳、柔和、指定颜色
  6. 游戏类型:RPG、平台游戏、射击游戏、益智游戏——会影响风格预期
  7. 参考风格:“类似《星露谷物语》”、“受《塞尔达传说》启发”等
提示词结构示例
"Create a [dimensions] [art style] [asset type] for a [game genre].
[Visual description with colors, materials, details].
[Perspective/view angle]. [Background requirement].
[Additional technical requirements]."

相关技能

  • each-sense - 核心 API 文档
  • product-visuals - 产品可视化
  • image-generation - 通用图像生成

参考资料

评论

支持 Markdown