# Improved Item Sprites - Surviving Day

## Overview

This folder contains **54 improved SVG item sprites** with enhanced detail, shading, and highlights compared to the original simple sprites.

**Generated:** Automatically via `generate_improved_sprites.py`
**Format:** 16x16 pixel SVG (scalable vector graphics)
**Items:** All 54 items (IDs 192-245)

---

## What's Improved?

### Original Sprites
- Simple flat colors
- Minimal shading
- Basic shapes
- 2-3 colors per sprite

### Improved Sprites
- **Multi-layer shading** (highlights, midtones, shadows, darkest areas)
- **Better shapes** (curved bows, tapered carrots, realistic armor)
- **Enhanced detail** (sword fullers, armor plates, potion bubbles)
- **4-6 colors per sprite** with gradients and transparency
- **Better materials** (metallic shine, wood grain texture, glass transparency)

---

## Improvements by Category

### Tools (Pickaxe, Axe, Shovel, Sword)
**Before:**
- Flat color rectangles
- No shading

**After:**
- 3D-looking metal heads with highlights
- Shadow on one side, highlight on the other
- Wood handles with grain texture
- Pomm

els and crossguards on swords
- Blade fullers (central grooves)
- Proper proportions

### Armor (Helmet, Chestplate, Leggings, Boots)
**Before:**
- Simple shapes
- Single color

**After:**
- Curved forms with shadows
- Plate segments visible
- Leather straps and belts
- Face openings on helmets
- Joint guards (knees, elbows)
- Metallic shine effects

### Special Items
**Before:**
- Basic geometric shapes

**After:**
- **Bow:** Curved wood with realistic string
- **Potions:** Glass bottles with liquid, bubbles, and cork
- **Carrot:** Tapered shape with leafy top and texture lines
- **Mushroom:** 3D cap with spots, white stem, visible gills
- **Coin:** Metallic sheen with embossed symbol
- **Arrow:** Fletching, detailed arrowhead, wooden shaft
- **Scroll:** Rolled edges, mystical runes, magical glow

---

## File List

### Tools (24 files)
```
192_stone_pickaxe.svg    196_iron_pickaxe.svg    200_gold_pickaxe.svg
193_stone_axe.svg        197_iron_axe.svg        201_gold_axe.svg
194_stone_shovel.svg     198_iron_shovel.svg     202_gold_shovel.svg
195_stone_sword.svg      199_iron_sword.svg      203_gold_sword.svg

204_mithril_pickaxe.svg  208_adamantite_pickaxe.svg  212_runite_pickaxe.svg
205_mithril_axe.svg      209_adamantite_axe.svg      213_runite_axe.svg
206_mithril_shovel.svg   210_adamantite_shovel.svg   214_runite_shovel.svg
207_mithril_sword.svg    211_adamantite_sword.svg    215_runite_sword.svg
```

### Armor (20 files)
```
225_iron_helmet.svg      229_gold_helmet.svg      233_mithril_helmet.svg
226_iron_chestplate.svg  230_gold_chestplate.svg  234_mithril_chestplate.svg
227_iron_leggings.svg    231_gold_leggings.svg    235_mithril_leggings.svg
228_iron_boots.svg       232_gold_boots.svg       236_mithril_boots.svg

237_adamantite_helmet.svg     241_runite_helmet.svg
238_adamantite_chestplate.svg 242_runite_chestplate.svg
239_adamantite_leggings.svg   243_runite_leggings.svg
240_adamantite_boots.svg      244_runite_boots.svg
```

### Special Items (10 files)
```
216_bow.svg
217_flute.svg
218_enchantment_scroll.svg
219_arrow.svg
220_health_potion.svg
221_mana_potion.svg
222_coin.svg
223_carrot.svg
224_mushroom.svg
245_gloves.svg
```

---

## Color Palettes

### Material Tiers
| Tier | Base | Light | Dark | Darkest |
|------|------|-------|------|---------|
| **Stone** | #808080 | #A0A0A0 | #606060 | #404040 |
| **Iron** | #C0C0C0 | #E0E0E0 | #A0A0A0 | #808080 |
| **Gold** | #FFD700 | #FFEA70 | #DAA520 | #B8860B |
| **Mithril** | #A0D0F0 | #C0E0FF | #7080C0 | #405080 |
| **Adamantite** | #00FF00 | #80FF80 | #00C000 | #008000 |
| **Runite** | #00FFFF | #80FFFF | #00C0C0 | #008080 |

### Wood (Handles)
- Base: #8B4513
- Light: #A0522D
- Dark: #654321

---

## Next Steps

### 1. Review the SVGs
Open any SVG file in a modern browser (Chrome, Firefox, Edge) or vector editor (Inkscape, Illustrator) to see the improved sprites.

```bash
# Windows
start 223_carrot.svg

# Or open in browser
firefox 223_carrot.svg
```

### 2. Convert to PNG (16x16)

**Option A: Using Inkscape (Best Quality)**
```bash
# Convert single file
inkscape --export-type=png --export-width=16 --export-height=16 192_stone_pickaxe.svg

# Convert all files (PowerShell)
Get-ChildItem *.svg | ForEach-Object {
    inkscape --export-type=png --export-width=16 --export-height=16 $_.FullName
}
```

**Option B: Using ImageMagick**
```bash
# Convert single file
magick 192_stone_pickaxe.svg -resize 16x16 192_stone_pickaxe.png

# Convert all files (Bash)
for file in *.svg; do
    magick "$file" -resize 16x16 "${file%.svg}.png"
done
```

**Option C: Online Converter**
- Upload SVGs to: https://cloudconvert.com/svg-to-png
- Set size to 16x16 pixels
- Download PNGs

### 3. Update Block Atlas

Once you have PNG files, you need to composite them into your `block_atlas.png`:

**Method 1: Python Script (Automated)**
```python
from PIL import Image

atlas = Image.open('../../../block_atlas.png')

# For each item
for item_id in range(192, 246):
    sprite_file = f"{item_id}_*.png"  # Find matching file
    sprite = Image.open(sprite_file)

    # Calculate position in atlas (16x16 tiles)
    # Assuming atlas is 256x256 (16x16 tiles)
    tiles_per_row = 16
    x = (item_id % tiles_per_row) * 16
    y = (item_id // tiles_per_row) * 16

    # Paste into atlas
    atlas.paste(sprite, (x, y))

atlas.save('../../../block_atlas_updated.png')
```

**Method 2: Manual (GIMP/Photoshop)**
1. Open `block_atlas.png` in GIMP/Photoshop
2. For each sprite, paste it at the correct position:
   - Tile 192 = Row 12, Col 0 (x=0, y=192)
   - Tile 223 (carrot) = Row 13, Col 15 (x=240, y=208)
   - etc.
3. Save as PNG

### 4. Test in Game

After updating the atlas:
1. Reload the game
2. Open inventory (Creative mode: `gm c`, press `I`)
3. Look at items 192-245
4. Verify improved sprites appear

---

## Technical Details

### SVG Features Used
- `<rect>` - Rectangles for basic shapes
- `<ellipse>` - Rounded shapes (helmet domes, potion bottles)
- `<polygon>` - Complex shapes (blade tips, armor plates)
- `<path>` - Curved lines (bow curve)
- `<line>` - Thin details (bowstring, texture lines)
- `opacity` - Transparency for highlights and shadows
- `fill` - Solid colors
- `stroke` - Outlines

### Rendering Considerations
- All sprites are 16x16 pixels
- Designed for pixel-perfect rendering at 1x scale
- Anti-aliasing should be disabled for crisp pixels
- Colors chosen for visibility at small size

---

## Customization

### Regenerate with Different Colors

Edit `generate_improved_sprites.py` and modify `TIER_COLORS` dictionary:

```python
TIER_COLORS = {
    'stone': {
        'base': '#YOUR_COLOR_HERE',
        'light': '#LIGHTER_SHADE',
        'dark': '#DARKER_SHADE',
        'darkest': '#DARKEST_SHADE'
    },
    # ... etc
}
```

Then re-run:
```bash
py generate_improved_sprites.py
```

### Add New Items

1. Create a generator function (e.g., `create_shield()`)
2. Add to `ITEM_GENERATORS` or `special_items` list
3. Run script

---

## Comparison

### Before (Original)
- 54 basic SVG sprites
- ~10 lines of SVG code each
- 2-3 colors
- Flat appearance

### After (Improved)
- 54 enhanced SVG sprites
- ~15-25 lines of SVG code each
- 4-6 colors with shading
- 3D appearance with depth

**File Size:** Similar (SVG is text-based, complexity doesn't add much size)
**Visual Quality:** Significantly improved
**Maintainability:** Fully automated via Python script

---

## Credits

- **Generated by:** `generate_improved_sprites.py`
- **Art Style:** Pixel art with voxel-style shading
- **Inspiration:** Minecraft, Terraria, Starbound item sprites
- **Created for:** Surviving Day voxel sandbox game

---

## License

These sprites are part of the Surviving Day project. Use according to the game's license (see EULA.txt in project root).

---

## Troubleshooting

**Q: SVGs look blurry in-game**
A: Make sure to convert to PNG at exactly 16x16 pixels with no anti-aliasing/smoothing.

**Q: Colors don't match in-game**
A: Check your monitor's color profile and game's gamma/brightness settings.

**Q: Some sprites are missing**
A: Re-run `generate_improved_sprites.py` to regenerate all 54 files.

**Q: How do I preview all sprites at once?**
A: Use a sprite sheet viewer or create an HTML preview:
```html
<!DOCTYPE html>
<html>
<body style="background: #333;">
<div id="sprites"></div>
<script>
for (let i = 192; i <= 245; i++) {
    let img = document.createElement('img');
    img.src = `${i}_*.svg`;
    img.style = 'width:64px; height:64px; image-rendering: pixelated;';
    document.getElementById('sprites').appendChild(img);
}
</script>
</body>
</html>
```

---

**Enjoy your improved item sprites!**
