All skills
jwynia avatar

/godot-asset-generator

@99a8797
by J Wyniajwynia/agent-skills160 stars
20

Generate game assets using AI image generation APIs (DALL-E, Replicate, fal.ai) and prepare them for Godot. Covers the full art pipeline from concept art and style guides to final sprites, sprite sheets, and import configuration. This skill should be used when creating game art, generating sprites, making tilesets, creating UI elements, or preparing assets for Godot import. Keywords: game assets, AI art, DALL-E, Replicate, fal.ai, sprite sheet, tileset, Godot, pixel art, character sprite, game art, texture, animation frames.

Use this Skill: https://skilld.dev/gh/jwynia/agent-skills/godot-asset-generator

This session only. Nothing lands on disk.

referencesgodot-integrationimport-settings.md

≈1.6k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Godot Import Settings Guide

Optimal import settings for different game asset types in Godot 4.x.

Import Settings Overview

When you add an image to a Godot project, it creates a .import file that controls how the image is processed.

Presets Reference

Pixel Art Sprites

For retro/pixel art games with crisp, unfiltered pixels.

Setting Value Reason
Filter Mode Nearest Preserves hard pixel edges
Compress Mode Lossless No quality loss
Mipmaps Off Prevents blur at different scales
Fix Alpha Border On Prevents edge artifacts

Import file settings:

compress/mode=0
mipmaps/generate=false
process/fix_alpha_border=true

Project Settings (also set globally):

rendering/textures/canvas_textures/default_texture_filter = Nearest

HD 2D Sprites

For high-resolution 2D games with smooth scaling.

Setting Value Reason
Filter Mode Linear Smooth scaling
Compress Mode VRAM Compressed GPU-friendly
Mipmaps On Better quality at small sizes
Fix Alpha Border On Prevents edge artifacts

Import file settings:

compress/mode=2
compress/high_quality=true
mipmaps/generate=true
process/fix_alpha_border=true

UI Elements

For interface elements like buttons, panels, icons.

Setting Value Reason
Filter Mode Linear (or Nearest for pixel UI) Depends on style
Compress Mode Lossless Crisp text/edges
Mipmaps Off UI is at fixed scale
Fix Alpha Border On Clean edges

Backgrounds

For large background images.

Setting Value Reason
Filter Mode Linear Smooth appearance
Compress Mode Lossy Smaller file size OK
Mipmaps On Better for parallax
Lossy Quality 0.8 Balance size/quality

Compression Modes

Mode Value Size Quality Best For
Lossless 0 Large Perfect Sprites, UI
Lossy 1 Medium Good Photos, backgrounds
VRAM 2 Small Good Large textures, 3D

Filter Modes

Nearest (Pixel Art)

Preserves hard pixel edges. Essential for:

  • Pixel art sprites
  • Retro-style games
  • Any asset where you want visible pixels

Linear (Smooth)

Interpolates between pixels. Use for:

  • HD sprites
  • Painted/illustrated assets
  • Photographs
  • Backgrounds

Sprite Sheet Configuration

For sprite sheets, configure in the Import dock:

  1. Import as: Texture2D (default)
  2. Detect 3D: Off
  3. Process → Fix Alpha Border: On

Then in your scene:

  • Create AnimatedSprite2D node
  • Create new SpriteFrames resource
  • Add frames by region or auto-slice

Using Sheet Metadata

If using pack-spritesheet.ts with --metadata:

# Load metadata
var meta = JSON.parse_string(FileAccess.open("res://sprites/sheet.json", FileAccess.READ).get_as_text())

# Create frames from metadata
var frames = SpriteFrames.new()
frames.add_animation("walk")

for frame in meta.frames:
    var texture = load("res://sprites/sheet.png")
    var atlas = AtlasTexture.new()
    atlas.atlas = texture
    atlas.region = Rect2(frame.x, frame.y, frame.width, frame.height)
    frames.add_frame("walk", atlas)

AnimatedSprite2D Setup

From Sprite Sheet

  1. Add AnimatedSprite2D node
  2. Create new SpriteFrames in Sprite Frames property
  3. Click SpriteFrames to open animation editor
  4. Add animation (e.g., "walk")
  5. Click folder icon → "Add Frames from Sprite Sheet"
  6. Select your sprite sheet image
  7. Configure grid (columns × rows)
  8. Select frames for animation
  9. Set FPS in animation panel

Recommended FPS

Animation Type FPS
Idle 4-6
Walk 8-12
Run 10-14
Attack 12-16
Effects 15-24

AtlasTexture for Individual Frames

For extracting single sprites from a sheet:

var atlas = AtlasTexture.new()
atlas.atlas = preload("res://sprites/sheet.png")
atlas.region = Rect2(0, 0, 64, 64)  # x, y, width, height

$Sprite2D.texture = atlas

Nine-Patch for UI

For scalable UI elements (panels, buttons):

  1. Import as Texture2D with Lossless
  2. Create NinePatchRect node
  3. Assign texture
  4. Set patch margins (left, top, right, bottom)
  5. Set draw center as needed
var nine_patch = NinePatchRect.new()
nine_patch.texture = preload("res://ui/panel.png")
nine_patch.patch_margin_left = 16
nine_patch.patch_margin_top = 16
nine_patch.patch_margin_right = 16
nine_patch.patch_margin_bottom = 16

Tileset Setup

For tile-based games:

  1. Import tile sheet with Nearest filter (for pixel art)
  2. Create TileSet resource
  3. Add texture as TileSetAtlasSource
  4. Configure tile size (e.g., 16×16, 32×32)
  5. Set up collision, navigation as needed

TileMap configuration:

var tilemap = TileMap.new()
tilemap.tile_set = preload("res://tilesets/world.tres")
tilemap.cell_quadrant_size = 16  # Match tile size

Project-Wide Settings

For Pixel Art Games

In Project Settings → Rendering → Textures:

canvas_textures/default_texture_filter = Nearest

In Project Settings → Display → Window:

stretch/mode = viewport
stretch/aspect = keep

For HD Games

In Project Settings → Rendering → Textures:

canvas_textures/default_texture_filter = Linear

Using generate-import-files.ts

# Pixel art preset
deno run scripts/generate-import-files.ts \
  --input ./sprites/player.png --preset pixel-art

# HD sprites
deno run scripts/generate-import-files.ts \
  --input ./hd-sprites/ --preset hd-sprite

# UI elements
deno run scripts/generate-import-files.ts \
  --input ./ui/ --preset ui

Troubleshooting

Sprites Look Blurry

  • Check Filter Mode is set to Nearest
  • Verify project default texture filter
  • Ensure no scaling applied to Sprite2D node

Edge Artifacts / Bleeding

  • Enable "Fix Alpha Border" in import
  • Add 1-2px transparent padding in sprite sheet
  • Use --padding option in pack-spritesheet.ts

Colors Look Wrong

  • Check color space settings
  • Ensure PNG is saved with correct color profile
  • Try Lossless compression mode

File Size Too Large

  • Use VRAM compression for large textures
  • Lower Lossy quality for backgrounds
  • Consider splitting very large sheets

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides scripts and documentation for creating game assets using well-known AI generation endpoints (OpenAI DALL-E, Replicate, fal.ai) and formatting them for the Godot engine. All operations are standard file handling and HTTP requests, and the environment variables handled are expected given the stated goal.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    7/11 files flagged

  • ZeroLeaks5mo

    1 finding · Score: 86/100

Signed by skilld at 99a8797. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 8 months ago
Other metadata
compatibility
Requires Deno runtime. API keys for chosen provider (OPENAI_API_KEY, REPLICATE_API_TOKEN, or FAL_KEY).
metadata
{
  "author": "agent-skills",
  "version": "1.0",
  "godot_version": "4.x",
  "type": "generator",
  "mode": "generative",
  "domain": "gamedev"
}

README badge

README badge for jwynia/agent-skills/godot-asset-generator