# 🎮 Sprite & Tileset Implementation Guide (Vertical Slice)

## 1. Scope

This document defines **technical requirements and pipeline rules** for using generated sprites, tilesets, and VFX in the project.

Goal: enable a developer to **import, slice, and assemble a fully playable vertical slice** without ambiguity.

---

## 2. Global Standards

```txt
Camera: Top-down (3/4)
Tile Size: 64x64 px
Internal Grid: 16x16 px
Padding: 2 px
Format: PNG (RGBA)
Filter Mode: Point (no filtering)
Compression: None
Pixels Per Unit: 64
```

---

## 3. Project Structure

```txt
/assets
  /tiles
  /props
  /buildings
  /characters
  /enemies
  /items
  /vfx
  /ui
```

---

## 4. Tileset Implementation

### 4.1 Import Settings

* Sprite Mode: Multiple
* Mesh Type: Full Rect
* Filter: Point
* Compression: None

---

### 4.2 Grid Slicing

```txt
Cell Size: 64x64
Offset: 0,0
Padding: 2px (if present in atlas)
Pivot: Center (0.5, 0.5)
```

---

### 4.3 Tile Categories

#### Ground Layer (collision + navigation)

```txt
road_center
road_variation_01..03
road_edge_N/E/S/W
road_corner_outer
road_corner_inner
```

#### Overlay Layer (no collision)

```txt
overlay_corruption
overlay_cracks
overlay_grass
```

---

### 4.4 Tilemap Layers

```txt
Layer 0: Ground
Layer 1: Overlay
Layer 2: Props (optional tile-based)
```

---

### 4.5 Autotile Requirements

Each terrain type must include:

```txt
1 center
4 edges
4 outer corners
4 inner corners
3+ variations
```

---

## 5. Props Implementation

### 5.1 Import

* Sprite Mode: Single
* Pivot: Bottom-Center (0.5, 0.0)

---

### 5.2 Rules

```txt
Height: 0.5–1.5 tile
Scale: consistent with tile grid
Collider: BoxCollider (manual)
```

---

## 6. Character (Hero)

### 6.1 Import Settings

```txt
Sprite Mode: Multiple
Cell Size: 64x64
Pivot: Bottom-Center (0.5, 0.0)
```

---

### 6.2 Animation Layout

```txt
Row = animation
Column = frame
Direction = left → right
```

---

### 6.3 Required Animations

```txt
idle: 6 frames
walk: 8 frames
attack: 6–8 frames
hit: 4 frames
death: 6 frames
```

---

### 6.4 Runtime Setup

* Animator Controller required
* State machine:

  * Idle ↔ Walk
  * Walk → Attack
  * Any → Hit
  * Any → Death

---

### 6.5 Collision

```txt
Collider: Capsule
Hitbox: smaller than sprite
Weapon hitbox: separate trigger collider
```

---

## 7. Enemies

### 7.1 Parameters

```txt
Size: 96–128 px
Pivot: Bottom-Center
```

---

### 7.2 Animations

```txt
idle
move
attack
hit
death
```

---

### 7.3 Gameplay Rules

* Weak points must be visually highlighted
* Hitbox must NOT match full sprite size

---

## 8. Items (Loot)

### 8.1 Import

```txt
Size: 32x32
Pivot: Center (0.5, 0.5)
```

---

### 8.2 Categories

```txt
consumables
currency
equipment
keys
```

---

### 8.3 Visual Encoding

```txt
common = neutral
rare = blue
epic = purple
```

---

## 9. VFX

### 9.1 Import

```txt
Size: 64–128 px
Pivot: Center
Material: Additive / Alpha Blend
```

---

### 9.2 Types

```txt
slash
impact
portal
particles
electricity
```

---

### 9.3 Rules

* VFX must be separate from characters
* Use flipbook animation where applicable
* Do NOT bake effects into base sprites

---

## 10. UI

### 10.1 Sizes

```txt
Icons: 32x32
Slots: 64x64
Panels: flexible
```

---

### 10.2 Rules

* Icons must be readable without text
* Glow indicates interactivity

---

## 11. Lighting Model

### 11.1 Separation

```txt
Base sprite = no heavy lighting
Emissive = separate (windows, crystals)
Lighting = runtime (engine)
```

---

### 11.2 Restrictions

```txt
DO NOT bake global lighting into tiles
DO NOT mix emissive with base diffuse
```

---

## 12. Naming Convention

```txt
tiles/road_center_01.png
tiles/road_edge_n_01.png

props/lamp_01.png

characters/hero_idle_01.png
characters/hero_attack_03.png

enemies/corrupt_beast_idle_01.png

items/potion_red.png

vfx/slash_01.png

ui/icon_attack.png
```

---

## 13. Engine Setup (Unity / Godot)

### 13.1 Import Settings

```txt
Filter Mode = Point
Compression = None
Pixels Per Unit = 64
```

---

### 13.2 Sprite Mode

```txt
Tilesets → Multiple
Props/Items → Single
Characters → Multiple
```

---

## 14. Collision System

```txt
Tilemap Collider → Ground
Box Collider → Props
Capsule Collider → Characters
Trigger Collider → Attacks / Loot
```

---

## 15. Render Order

```txt
1 Ground
2 Overlay
3 Props
4 Characters
5 VFX
6 UI
```

---

## 16. Gameplay Loop (Vertical Slice)

```txt
1. Player movement (tilemap navigation)
2. Enter corruption zone
3. Enemy aggro
4. Combat (melee + VFX)
5. Loot drop
6. Loot collection
7. Exit via portal
```

---

## 17. Critical Constraints

```txt
All assets must align to 64x64 grid
All sprites must have correct pivot
No mixed pixel density
No baked lighting abuse
Tiles ≠ Props (strict separation)
Minimum 3 variations per tile type
```

---

## 18. Acceptance Criteria

Implementation is valid if:

* Tilemap builds without seams
* Character animations play correctly
* Combat loop is functional
* Loot is collectible and readable
* Portal completes loop
* No visual scale inconsistencies


---

**End of document**
