8.7 KiB
Summary of Changes - Steam Integration & Icon System
Date: November 9, 2025
1. Icon System Implementation
Created Icon Directory Structure
images/icons/
├── items/ # Item icons (weapons, armor, consumables)
├── ui/ # UI elements (buttons, menus)
├── status/ # Status indicators (HP, stamina)
└── actions/ # Action icons (attack, defend, flee)
Icon Specifications
- Format: SVG (recommended) or PNG
- Size: 64x64px standard, 128x64px large, 32x32px small
- Naming: kebab-case matching item IDs (e.g.,
iron-sword.svg) - Usage: Icons referenced via
icon_pathfield, emojis kept as fallback
Documentation
- Created
/images/icons/README.mdwith full guidelines
2. Database Migration - Steam Support
Migration Script: migrate_steam_support.py
Added Columns:
ALTER TABLE players ADD COLUMN:
- steam_id VARCHAR(255) UNIQUE -- Steam user ID
- email VARCHAR(255) -- Required for web users
- premium_expires_at TIMESTAMP -- NULL = premium, timestamp = trial end
- account_type VARCHAR(20) -- 'web', 'steam', 'telegram'
Removed:
telegram_idcolumn (deprecated, no longer supporting Telegram)
Indexes Created:
idx_players_steam_id- Fast Steam ID lookupsidx_players_email- Email verification/login
Constraints:
CHECK (account_type IN ('web', 'steam', 'telegram'))- Steam ID must be unique
- Email used for password reset and communications
Migration Results
✅ Added columns successfully
✅ Created indexes
✅ Updated 5 existing users to 'web' account type
✅ Dropped telegram_id column (no legacy users found)
✅ Added account_type constraint
3. Premium System Design
Account Types
Web Users:
- Email/password registration
- Free trial: Level 1-10
- Premium: Full access after payment
Steam Users:
- Auto-authenticated via Steam
- Always premium (owns game on Steam)
- No email/password needed
Premium Logic
Premium Status:
premium_expires_at == NULL # Lifetime premium (purchased or Steam)
premium_expires_at > now() # Active trial/subscription
premium_expires_at < now() # Expired, back to free tier
Restrictions for Non-Premium (Level 10+):
- ❌ No XP gain after level 10
- ✅ Full map access (naturally gated by difficulty)
- ✅ Can party with premium players
- ✅ All items/crafting/combat features
4. UI Fixes - Equipment Slots
Problem
Equipment slots changed size when items equipped due to emoji + button content.
Solution
Fixed dimensions in Game.css:
.equipment-slot {
min-height: 100px;
max-height: 100px;
height: 100px;
overflow: hidden; /* Prevent content overflow */
}
Reduced button sizes:
.equipment-action-btn {
padding: 0.2rem 0.4rem;
font-size: 0.75rem;
white-space: nowrap;
}
.equipment-emoji {
font-size: 1.2rem; /* Reduced from 1.5rem */
}
Result: All equipment slots now same size, whether empty or filled.
5. Comprehensive Planning Document
Created: STEAM_AND_PREMIUM_PLAN.md
Contents:
- Account System - Database schema, account types
- Distribution Channels - Web, Steam, Standalone
- Asset Bundling Strategy - Hybrid approach for desktop
- Steam Integration - Steamworks SDK, authentication flow
- Build Variants - Web vs Steam vs Standalone configs
- Premium Enforcement - XP restrictions, helper functions
- Implementation Roadmap - 5-phase plan
- Tech Stack Recommendations - Tauri for desktop client
- Cost Estimates - $100 Steam fee + payment processing
- Monetization Strategy - Pricing options
Key Decisions:
-
Desktop Framework: Tauri (Rust + WebView)
- Smaller than Electron (~5MB vs 100MB+)
- Better security
- Native performance
-
Asset Strategy: Hybrid bundling
- Bundle core assets (~50MB)
- Lazy load rare content
- Cache everything locally
-
Pricing Model: Steam-paid, web-freemium
- Steam: $14.99 (full game)
- Web: Free trial to level 10, $4.99 upgrade
6. Next Steps (Prioritized)
Immediate (This Week)
- ✅ Database migration complete
- ✅ Icon folders created
- Update
/api/auth/registerto require email - Add premium check functions (
is_player_premium()) - Implement XP restriction for non-premium level 10+
Short Term (Next 2 Weeks)
- Design and create icon set (replace emojis)
- Payment integration (Stripe)
- Email verification system
- Premium upgrade endpoint
- Premium status UI indicators
Medium Term (Next Month)
- Set up Steamworks partner account
- Prototype Tauri desktop app
- Steam authentication flow
- Asset bundling system
Long Term (2-3 Months)
- Complete Steam integration
- Desktop client with auto-updater
- Beta testing
- Official launch
7. Required External Setup
Steamworks Partner
- Sign up at: https://partner.steamgames.com/
- Pay $100 app submission fee (one-time)
- Create app entry
- Get Steam App ID and Web API Key
- Download Steamworks SDK
Payment Processing
-
Stripe Account
- Sign up: https://stripe.com/
- Get API keys
- Set up webhook for payment events
-
PayPal Business (optional)
- Alternative payment method
- Popular in some regions
CDN for Assets
-
CloudFlare (recommended, free tier)
- Fast global delivery
- Free SSL
- DDoS protection
-
AWS CloudFront (alternative)
- More control
- Pay per use (~$0.085/GB)
8. Files Modified
New Files
/images/icons/README.md- Icon system documentation/migrate_steam_support.py- Database migration script/STEAM_AND_PREMIUM_PLAN.md- Complete implementation plan- THIS FILE - Change summary
Modified Files
/pwa/src/components/Game.css- Fixed equipment slot sizing- Database:
playerstable structure updated
New Directories
/images/icons/
├── items/
├── ui/
├── status/
└── actions/
9. Breaking Changes
For Existing Users
- ⚠️
telegram_idremoved (no Telegram users in database) - ✅ Existing users marked as
account_type='web' - ✅ All existing users start with free tier (can be upgraded)
For API Clients
- ⚠️
/api/auth/registerwill soon requireemailfield (not yet enforced) - ✅ All existing endpoints remain compatible
- ✅ New optional fields in player responses
10. Testing Checklist
Database Migration
- Migration runs without errors
- Existing users preserved
- Indexes created successfully
- Constraints applied
UI Changes
- Equipment slots same size empty/filled
- Button text doesn't wrap
- Icons fit within slots
- Mobile responsive
Premium System (To Test)
- XP gain stops at level 10 for non-premium
- Premium status displayed correctly
- Steam users auto-premium
- Payment flow works
11. Security Considerations
Added
- Email field for account recovery
- Steam ID validation (external verification)
- Account type constraints
Todo
- Email verification before account activation
- Steam ticket validation on server
- Rate limiting on premium upgrade attempts
- Secure payment token handling
12. Performance Impact
Database
- Indexes added: +2 (steam_id, email) - Minimal impact
- Column additions: +4 per player - ~100 bytes per row
- Query performance: Improved (indexed lookups)
UI
- Fixed slot heights: Prevents layout shifts (better CLS)
- Smaller buttons: Reduced DOM size
- Icon system: No impact yet (emojis still used)
Questions for Product Decision
-
Free Tier Level Cap:
- Current: Level 10
- Alternative: Level 5? Level 15?
- Recommendation: Level 10 (enough to hook players)
-
Premium Pricing:
- Web upgrade: $4.99? $9.99?
- Steam full game: $14.99? $19.99?
- Recommendation: $4.99 web, $14.99 Steam
-
Email Verification:
- Required immediately on registration?
- Or allow play, verify for premium upgrade?
- Recommendation: Optional initially, required for premium
-
Steam-Exclusive Features:
- Any features only for Steam users?
- Or complete parity with web premium?
- Recommendation: Complete parity (fair for web buyers)
Contact & Support
For questions about this implementation:
- Steam Integration: See
STEAM_AND_PREMIUM_PLAN.mdSection 4 - Database Schema: See
migrate_steam_support.py - Icon System: See
/images/icons/README.md - UI Changes: See
pwa/src/components/Game.csslines 1955-2050
Migration Status: ✅ Complete and Deployed UI Fixes: ✅ Complete (Needs Testing) Planning: ✅ Complete Implementation: 🔄 Ready to Begin