算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
gamedev-2d-art-vfx-2d【设计与创意】Visual effects in 2D: frame patterns for smoke / fire / water / electricity, hitstop and hit pause, screen shake intensity curves, particle frames vs procedural particles, juice principles (Vlambeer "Art of Screenshake"), trail effects, color flash, debris, decals. USE WHEN: authoring effect sprites, deciding pre-baked vs procedural particles, desig…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: gamedev-2d-art-vfx-2d description: | Visual effects in 2D: frame patterns for smoke / fire / water / electricity, hitstop and hit pause, screen shake intensity curves, particle frames vs procedural particles, juice principles (Vlambeer "Art of Screenshake"), trail effects, color flash, debris, decals.
VFX = the small effects that make actions feel impactful: hit flashes, explosion frames, smoke puffs, screen shake. The "juice" of game feel.
Reference: Vlambeer's "The Art of Screenshake" (talk by Jan Willem Nijman, 2013) — the canonical breakdown of game-feel techniques. Every indie should watch.
Effect Frames FPS Total Notes
Smoke puff 6-8 8-12 600-700ms Expand → drift → fade
Fire (loop) 4-6 8-10 400-500ms Turbulent loop, no hard end
Water splash 5-7 ad-hoc 200-400ms Impact + arc + settle
Electricity 2-3 24-30 60-100ms Fast jitter, looping
Sparks 3-5 30-60 50-150ms Quick, small
Sword swing trail 3-4 24+ 100-150ms One-shot, fades quick
Damage flash 2-3 ad-hoc 60-120ms Stuck on hit moment
Explosion 8-12 8-15 500-1000ms Bright peak, smoke residual
Heal / buff burst 6-8 8-12 500-700ms Soft expand
Power-up pickup 8-10 12-15 500-700ms Sparkle + shimmer
Canonical 6-frame smoke puff:
F1: small dark cloud (initial)
F2: expanded, lighter
F3: maximum size, mid-tone
F4: drifting up, fading
F5: thin, mostly dispersed
F6: barely visible, last wisp
Color: starts dark (impact dust), goes lighter (warm air), ends near sky color. Use 3-color palette ramp.
For LOOPING smoke (chimney): 4-6 frame loop, drift up offset by 1-2 px per frame, opacity stays roughly constant.
Looping fire is noisy and turbulent. Hard to make periodic without visible repetition. Tricks:
Color ramp for fire:
Cooler for magical fire: cyan core + purple outer.
Splash on impact:
F1: vertical jet (water displaced upward)
F2: peak height, droplets separating
F3: droplets in arc, base ring forming
F4: droplets falling back, ring expanding
F5: most water settled, ripple ring
F6: ripple fading
Water palette: blue ramp + white highlights at impact peak.
Looping water (puddle ripple, river): 3-4 frame loop with shifted highlight pattern. Subtle.
Electric/lightning bolts: 2-3 frames, played FAST (24-30 fps), jitter between similar shapes. The eye sees "alive electricity" rather than discrete frames.
Tricks:
Continuous beam: same approach but bolt path is a steady curve, jitter is in branches.
Brief game-time freeze on hit. Critical for game feel.
Light hit: 1-2 frames freeze (~16-33ms)
Medium hit: 3-5 frames (~50-80ms)
Heavy hit: 6-10 frames (~100-167ms)
Crit / parry: 8-15 frames (~133-250ms) + visual flourish
During freeze:
Implementation: Time.timeScale = 0.05 for X frames in Unity, or
manual game-state pause flag. Don't actually Time.timeScale = 0 —
breaks animation timing on resume.
Random offset to camera position over short duration.
intensity * (1 - t / duration). OK but mechanical.intensity * (1 - t / duration)^2. Snappier.Cinemachine 2D in Unity has built-in Impulse system. Cinemachine Impulse Source on the trigger, listener on the camera, takes care of decay
Sprite turns full white (or another color) for 1-3 frames on hit. Communicates "I got hit" without animation work.
Implementation: shader uniform _FlashColor with alpha 0..1. Lerp from
white (1) to no-flash (0) over the flash duration.
For sword swings, projectiles, dashing:
1-frame curved line drawn through the swing arc. Cheap, looks consistent.
Stack semi-transparent copies of the sprite at offset positions over the last N frames. Engine-side. Looks dynamic, pixel-perfect difficult.
Procedural geometry along the swing path. More common in higher-res 2D.
When pre-baked frames don't suffice (large numbers, varied behavior):
Procedural is right for:
Pre-baked is right for:
Persistent marks: scorch marks, blood splatters, footprints, cracks.
For every meaningful action, layer:
Subtle layering of all = "juicy" feel. Single technique applied = falls flat. Test by toggling each layer off and feeling the loss.
unity-2d-gameplay (juice patterns), unity-2d-cameras (Cinemachine Impulse)