Show HN: Defrag the Game
Gameplay & Rules
- Many find the game fun, intuitive, and visually pleasing once understood.
- Several players report initial confusion: unclear that the first blinking block is “data,” unclear goal, and unclear that gaps should be minimized.
- Clarifications shared in-thread:
- Goal is to minimize gaps between blocks.
- Score formula:
(elapsed seconds / 4) + operations + fragmentation. - Each move counts as one operation; each gap between data blocks counts as one fragmentation point.
- Some nuances: gaps before the first block count; gaps longer than four are capped visually for the fragmentation display but not for scoring.
- Some compare it to Sokoban or an “unblocking” puzzle more than to disk defrag.
Scoring & Strategy
- The inverted scoring (lower is better) confuses many; “high score” wording reinforces this.
- Some find that randomly spamming space can yield scores close to (or sometimes better than) deliberate play, suggesting the scoring balance may be off.
- At least one example suggests a mismatch between the formula and the reported score, which the author acknowledges as a bug to check.
- Discussion about optimal strategy: balancing speed vs. extra moves vs. reducing fragmentation; some report difficulty getting low scores even with perfect defragmentation.
UX, Controls & Platform Issues
- Desktop:
- Spacebar behavior is unintuitive; pressing it after placing a block often locks the next block instead of advancing, causing restarts.
- Players request an undo button, clearer onboarding, and explicit rules.
- Mobile (especially iPhone):
- Drag/swipe behavior feels inconsistent or unresponsive; some interpret the interaction as broken.
- Confusion between “drag-and-drop” vs. sliding a cursor that writes data.
- Some like the minimal-instruction “discover by playing” style; others find it frustrating.
Performance & Implementation
- In “hard” mode, several users report lag, jittery animations, and mid-game slowdowns, even on modern laptops.
- The game is implemented in React with heavy use of CSS animations; some suggest GPU/acceleration quirks may explain performance variability.
Relation to Real Defragmentation
- Multiple comments argue the game doesn’t resemble real disk defragmentation: no sectors, files, or true file fragmentation; artificial constraints like one-time moves, no jumping over blocks, and fixed move order.
- Others defend it as an inspired puzzle, not a simulator, but acknowledge that the name and lack of instructions prime players to expect realism, increasing confusion.
- Suggestions include coloring blocks by file and introducing true fragmented-file mechanics with easy/hard modes.
Web APIs & Browser Capabilities Tangent
- A subthread discusses the File System API and WebUSB, debating whether browsers should expose such low-level capabilities.
- One side sees them as useful for in-browser tools (e.g., IDEs, editors) with permission gating and reduced risk vs. native apps.
- The other side views them as unnecessary attack surface and argues that full programs should remain native.
Miscellaneous Feedback & Ideas
- Requests for:
- Leaderboard or percentile-based scoring.
- Reproducible levels with more challenge beyond the first line.
- HDD-style sound effects and possibly a 3D version.
- Some nostalgia around classic defrag visuals and related games, plus links to defrag simulators and speedrunning content.