# 8. Discord Display, Visual Identity, and Animated Cards [< Back to Index](README.md) | [Next: Integrations >](09-integrations.md) --- ## 8.1 Tier Visual Indicators Evolved cards display visual indicators in Discord embeds that signal evolution status without requiring image regeneration (which is expensive and slow): | Evolution State | Embed Change | |---|---| | Not evolved (T0) | Standard embed, no change | | T1 complete | Small badge emoji appended to card name field: `Mike Trout [T1]` | | T2 complete | Badge updates: `Mike Trout [T2]` + embed accent color changes to gold | | T3 complete | Badge: `Mike Trout [T3]` + embed color changes to purple | | T4 full evolved | Name changes to `[Team]'s Evolved Mike Trout` + embed color changes to teal | > **TBD:** Tier badge icons are placeholders and likely to change. Current candidates: > T1 = `:seedling:`, T2 = `:star:`, T3 = `:gem:`, T4 = `:crown:`. Final icons will be > chosen during implementation based on Discord rendering quality and visual distinctiveness. ## 8.2 Evolution Status Embed A dedicated `!evo status` command (or equivalent slash command) displays evolution status for all cards on the roster (or a specific card): ``` [Team Name]'s Evolution Progress ================================ Mike Trout (All-Star) — T2 in progress Standard Batter Track Tier 2 milestones: [x] Win 8 games with card in lineup (8/8) [x] Hit 5 HR (5/5) [ ] Reach base 30 times (22/30) <-- in progress Tier 2 unlocks: +1.0 budget (contact profile) Boost profile: auto-contact Babe Ruth (HoF) — T1 complete, T2 in progress Legend Batter Track ... Type !evo card for detailed milestone breakdown. Type !evo cosmetics to browse premium visual upgrades. ``` ## 8.3 Milestone Completion Notification When a milestone is completed, the bot sends a notification in the team's designated channel: ``` [Seedling] Evolution milestone completed! Mike Trout — T1, Milestone 2: "Record 15 Hits" COMPLETE Tier 1 is now fully complete! Rating boost applied: +1.0 budget (contact profile) [Mike Trout's card is now Tier 1 Evolved] ``` When a full tier is completed and the rarity upgrade fires: ``` [Crown] FULL EVOLUTION COMPLETE! "[TeamName]'s Evolved Mike Trout" — Starter -> All-Star Upgrade Applied! Rating boost: +1.0 budget capstone applied (4.0 total across all tiers). This card is now permanently upgraded on your roster. ``` ## 8.4 Premium Cosmetics Display Premium cosmetics purchased via the currency store apply visual upgrades to the card's Discord embed beyond the standard tier badge system: For the full cosmetics catalog with pricing, see [10-economy.md § 10.3](10-economy.md#103-cosmetics-pricing). | Cosmetic | Effect | Image Format | |---|---|---| | Gold Frame | Card embed styled with gold border accent | Static PNG | | Diamond Frame | Diamond shimmer gradient border | Static PNG | | Team Color Frame | Solid team-color border | Static PNG | | Holographic Frame | Animated rainbow gradient border shimmer | **Animated APNG** | | Dark Mode Theme | Charcoal header + dark column backgrounds | Static PNG | | Midnight Theme | Deep navy/black column backgrounds | Static PNG | | Prestige Badge | T4 badge upgraded from `:crown:` to `:crown::sparkles:` with custom label | Static PNG | | Rarity Glow (Subtle) | Subtle pulsing glow matching rarity color | **Animated APNG** | | Rarity Glow (Strong) | Intense pulsing glow matching rarity color | **Animated APNG** | | Full Art Reveal | Custom card art background | Static PNG | Cosmetics are purchased per `player_id` for a specific team. Since `player_id` maps 1:many with `card_id`, purchasing a cosmetic for a player applies to all duplicate cards of that player on the team — the variant hash is recomputed for all of them. Cosmetics are attached to the `evolution_card_state` record (keyed by `player_id + team_id`), so duplicates always share the same visual treatment. When a card is traded, the new owner does **not** inherit purchased cosmetics — those remain with the selling team's evolution state. The traded card's cosmetic display reverts to the standard tier badge for the new owner. This creates a flex incentive: players invest in cosmetics for cards they intend to keep and show off. It also means a card with premium cosmetics is visually distinctive in gauntlet brackets and trading discussions, providing social proof of investment. ## 8.5 Card Image Generation for Variants (Static) When a new variant is created (tier completion or cosmetic purchase), the system: 1. Computes the variant hash from `(player_id, evolution_tier, cosmetics)` 2. Checks if a `battingcard` row with that hash already exists — if so, reuses it 3. If not, creates the variant's rating rows (base + evolution boosts applied) 4. Determines whether the variant requires animation (see § 8.6) or is static PNG 5. For **static variants**: renders the card via the existing Playwright pipeline, with cosmetic CSS injected into the HTML template (frame overlays, background gradients, evolution badge, etc.) 6. Uploads the PNG to S3 at `cards/cardset-{id}/player-{player_id}/v{variant}/battingcard.png` 7. Stores the S3 URL in `battingcard.image_url` 8. Updates `card.variant` on all card instances that should use this variant The image format (PNG vs APNG) is determined by the file extension in the S3 URL stored in `battingcard.image_url` — no separate format column is needed. The bot and Discord both handle `.png` and `.apng` URLs identically. The ~5 second render + upload cost is paid **once per variant creation**, not on every display. Subsequent displays are instant — the bot reads `battingcard.image_url` and puts it in the embed just like it reads `player.image` today. **Cosmetic CSS injection** is handled by passing cosmetic parameters to the card rendering endpoint. The HTML template conditionally applies CSS classes based on cosmetic flags: - Frame overlays → CSS border/outline/box-shadow on the card container - Background themes → replace hardcoded `#ACE6FF`/`#EAA49C` with themed colors - Evolution badge → additional `` element alongside the rarity badge - Header gradient → custom gradient colors replacing the standard blue/red See [14-risks.md § Open Question 9](14-risks.md) for CSS implementation approach discussion. --- ## 8.6 Animated Card Pipeline ### 8.6.1 Why APNG Several cosmetic effects benefit from animation: holographic frame shimmer, rarity glow pulses, evolution badge sparkle effects. The format choice matters: | Format | Discord Embed | Browser `` | Color Depth | File Size | |---|---|---|---|---| | **APNG** | Auto-plays, full support | Native, all browsers | Full 24-bit + alpha | ~1-4 MB for 8-12 frames | | GIF | Auto-plays | Native | **256 colors** — visible banding on gradients | ~0.5-2 MB | | Animated WebP | Works in most clients | Native, modern browsers | Full color | ~0.8-3 MB | | MP4/WebM | **Not supported** in `set_image` | Requires `