# Publishing Your Game

A comprehensive guide to publishing and distributing your AeThex game to players worldwide.

---

## Overview

This guide covers the complete publishing workflow:
- Pre-launch checklist
- Platform-specific setup
- Store submissions
- Marketing materials
- Post-launch monitoring
- Updates and maintenance

---

## Table of Contents

1. [Pre-Launch Checklist](#pre-launch-checklist)
2. [Export Your Game](#export-your-game)
3. [Platform-Specific Publishing](#platform-specific-publishing)
4. [Marketing Materials](#marketing-materials)
5. [Launch Strategy](#launch-strategy)
6. [Post-Launch](#post-launch)
7. [Updates and Patches](#updates-and-patches)

---

## Pre-Launch Checklist

### ✅ Game Completion

- [ ] All levels/content implemented
- [ ] Tutorial completed and tested
- [ ] All major bugs fixed
- [ ] Performance optimized for target platforms
- [ ] Tested on minimum spec hardware
- [ ] Audio balanced and finalized
- [ ] UI polished and consistent
- [ ] Accessibility options implemented

### ✅ Technical Requirements

- [ ] Cloud services configured (if using)
- [ ] Analytics integrated
- [ ] Crash reporting set up
- [ ] Save system tested thoroughly
- [ ] Multiplayer stress-tested (if applicable)
- [ ] All external APIs work in production
- [ ] Privacy policy created
- [ ] Terms of service written

### ✅ Legal & Business

- [ ] Company/entity registered (if required)
- [ ] Tax information prepared
- [ ] Age rating obtained (ESRB, PEGI, etc.)
- [ ] Trademark search completed
- [ ] Copyright notices added
- [ ] License agreements in place
- [ ] Insurance considered (if applicable)

### ✅ Store Assets

- [ ] Game title finalized
- [ ] Description written (all required languages)
- [ ] Screenshots captured (all required platforms)
- [ ] Trailer created and uploaded
- [ ] Icon/logo designed in all required sizes
- [ ] Banner images created
- [ ] Keywords/tags researched
- [ ] Store page previewed

---

## Export Your Game

See [EXPORTING_GAMES.md](EXPORTING_GAMES.md) for detailed export instructions for:
- Windows
- Linux
- macOS
- Web (HTML5)
- Android
- iOS (coming soon)

**Quick Export:**
```gdscript
# Via editor:
Project → Export → Select Platform → Export Project

# Via command line:
aethex --export-release "Windows Desktop" builds/windows/game.exe
```

---

## Platform-Specific Publishing

### Steam

**1. Create Steamworks Account:**
- Go to [partner.steamgames.com](https://partner.steamgames.com)
- Pay app deposit ($100 per game, recoupable)
- Complete company verification

**2. Set Up Your Game:**
```
Steamworks Admin Panel:
├── App Admin → Basic Info
│   ├── Game name
│   ├── Description
│   └── Release date
├── Store Presence → Graphics
│   ├── Header capsule (460x215)
│   ├── Small capsule (231x87)
│   ├── Screenshots (1920x1080)
│   └── Trailer
└── Technical Requirements
    ├── Supported OS
    └── Minimum specs
```

**3. Upload Build:**
```bash
# Install Steamworks SDK
# Use SteamPipe to upload

# steamcmd.exe
login your_username
set_product your_app_id
upload_depot depot_id depot_manifest.vdf
```

**4. Configure Store Page:**
- Description (short & long)
- Tags/categories
- Supported languages
- System requirements
- Pricing

**5. Submit for Review:**
- Complete all required fields
- Submit for Steam review (1-5 days)
- Address any feedback
- Set release date

**6. Launch:**
- Release when ready
- Consider Early Access for ongoing development

---

### itch.io

**1. Create Account:**
- Go to [itch.io](https://itch.io)
- Sign up for creator account (free)

**2. Create New Project:**
```
Dashboard → Create new project:
├── Title & URL
├── Classification (Game)
├── Kind (Downloadable/HTML5)
└── Release status
```

**3. Upload Files:**
```
Upload → Add file:
├── Windows ZIP
├── Linux TAR.GZ
├── macOS ZIP
└── Web folder (if HTML5)

Set file types:
- Windows: Executable
- Linux: Executable
- Web: This file will be played in the browser
```

**4. Configure Page:**
- Cover image (630x500)
- Screenshots
- Description
- Trailer embed
- Tags
- Pricing (free or paid)
- Donation options

**5. Publish:**
- Preview page
- Click "Publish"
- Share link immediately

**Pros:**
- Free to publish
- Indie-friendly community
- Instant publishing
- Flexible pricing (pay what you want)
- Good for prototypes/demos

---

### GOG

**1. Apply for Publishing:**
- Email [games@gog.com](mailto:games@gog.com)
- Provide game description and trailer
- Wait for approval (selective)

**2. Submission Process:**
- If approved, work with GOG partner manager
- Build must be DRM-free
- GOG handles QA testing

**3. Release:**
- GOG manages store page
- Revenue split: 70/30

---

### Epic Games Store

**1. Apply:**
- Go to [Epic Games Publishing](https://www.epicgames.com/unrealengine/en-US/publish)
- Submit application
- Wait for review

**2. Onboarding:**
- Complete developer agreement
- Set up payments
- Work with Epic partner manager

**3. Requirements:**
- High-quality polish expected
- Epic Games Account integration
- Achievement support recommended

---

### Google Play Store

**1. Create Developer Account:**
- Go to [Google Play Console](https://play.google.com/console)
- Pay one-time fee ($25)
- Complete account verification

**2. Create App:**
```
Play Console → Create app:
├── App details
├── Store listing
│   ├── Title
│   ├── Description (short & full)
│   ├── Screenshots (phone & tablet)
│   ├── Feature graphic (1024x500)
│   └── Icon (512x512)
├── Content rating (ESRB, PEGI)
└── Pricing & distribution
```

**3. Upload APK/AAB:**
```
Release Management → App releases:
├── Production → Create release
├── Upload AAB (recommended) or APK
├── Set version code/name
└── Add release notes
```

**4. Fill Requirements:**
- Privacy policy URL
- Content rating questionnaire
- Target audience
- App content
- Data safety section

**5. Submit for Review:**
- Review takes 1-7 days
- Address any policy violations
- Publish when approved

---

### Apple App Store (iOS)

**1. Apple Developer Account:**
- Join [Apple Developer Program](https://developer.apple.com/programs/) ($99/year)
- Complete agreements

**2. App Store Connect:**
```
Create New App:
├── Platform (iOS)
├── Name
├── Primary language
├── Bundle ID
└── SKU
```

**3. Prepare App:**
```
App Information:
├── Name & subtitle
├── Privacy policy URL
├── Category
├── Screenshots (all device sizes)
├── Description
└── Keywords
```

**4. Build Upload:**
```bash
# Archive in Xcode
# Upload via Xcode or Transporter app
# Wait for processing (15-60 minutes)
```

**5. Submit for Review:**
- Select build
- Set release method (manual/automatic)
- Add version information
- Submit (review takes 1-2 days typically)

---

### Web Publishing

**GitHub Pages:**
```bash
# Build for web
aethex --export "Web" builds/web/index.html

# Create gh-pages branch
git checkout -b gh-pages
cp -r builds/web/* .
git add .
git commit -m "Deploy game"
git push origin gh-pages

# Enable in repository settings
# Access at: https://username.github.io/repository
```

**Netlify:**
```bash
# Install Netlify CLI
npm install -g netlify-cli

# Deploy
netlify deploy --dir=builds/web --prod

# Or drag-and-drop in Netlify dashboard
```

**Vercel:**
```bash
# Install Vercel CLI
npm install -g vercel

# Deploy
vercel builds/web --prod
```

**Self-Hosting:**
```nginx
# nginx configuration
server {
    listen 80;
    server_name yourgame.com;
    root /var/www/yourgame;
    
    location / {
        try_files $uri $uri/ /index.html;
    }
    
    # Enable CORS for WebAssembly
    location ~* \.(wasm|pck)$ {
        add_header Access-Control-Allow-Origin *;
    }
    
    # Cache static assets
    location ~* \.(jpg|jpeg|png|gif|ico|css|js|wasm|pck)$ {
        expires 1y;
        add_header Cache-Control "public, immutable";
    }
}
```

---

## Marketing Materials

### Screenshots

**Best Practices:**
- Capture at 1920x1080 or higher
- Show gameplay, not menus
- Highlight key features
- Include UI elements
- Use variety (action, exploration, etc.)
- Add subtle branding watermark

**Tools:**
```gdscript
# In-game screenshot system
func take_screenshot():
    var img = get_viewport().get_texture().get_image()
    img.save_png("user://screenshot_%s.png" % Time.get_unix_time_from_system())
```

### Trailer

**Structure:**
- 0-5s: Hook (best gameplay moment)
- 5-15s: Core gameplay footage
- 15-30s: Features and variety
- 30-45s: Unique selling points
- 45-60s: Call to action + release date

**Tools:**
- Video editing: DaVinci Resolve (free)
- Screen recording: OBS Studio (free)
- Music: [Epidemic Sound](https://epidemicsound.com), [Artlist](https://artlist.io)

### Store Description

**Template:**
```
[One-sentence hook]

[2-3 sentence description of gameplay]

KEY FEATURES:
• Feature 1 (brief description)
• Feature 2 (brief description)
• Feature 3 (brief description)
• Feature 4 (brief description)

[Optional: Story/setting paragraph]

[System requirements or platform info]

[Social media links]
```

---

## Launch Strategy

### Timing

**When to Launch:**
- Avoid major game releases
- Consider seasonal factors (summer slow, Q4 busy)
- Tuesday/Thursday often best for visibility
- Allow time for reviews/coverage

**Soft Launch:**
- Release to smaller region first
- Gather feedback
- Fix critical issues
- Full launch 1-2 weeks later

### Press Kit

Create a press kit at `yourgame.com/press`:
- Fact sheet (release date, platforms, price)
- Description
- Features
- Trailer embed
- Screenshots (zip download)
- Logo (multiple formats)
- Developer info
- Contact email

### Reaching Out

**Media Contacts:**
- Research relevant gaming sites/YouTubers
- Send personalized emails (not mass blasts)
- Provide steam keys/review copies
- Follow up once if no response

**Email Template:**
```
Subject: [Your Game Name] - [Genre] launching [Date]

Hi [Name],

I'm [your name], developer of [game name], a [genre] game 
launching on [platform] on [date].

[One paragraph about what makes your game special]

Key features:
• Feature 1
• Feature 2
• Feature 3

I'd love to send you a review key. Are you interested?

Trailer: [link]
Press kit: [link]

Thanks,
[Your name]
```

---

## Post-Launch

### Monitor Launch

**First 24 Hours:**
- Watch for critical bugs
- Monitor social media mentions
- Respond to player feedback
- Track analytics (sales, downloads, engagement)
- Be ready to deploy hotfix if needed

**First Week:**
- Gather reviews and feedback
- Plan first update
- Engage with community
- Share player content
- Thank supporters

### Community Management

**Platforms to Manage:**
- Steam discussions
- Discord server
- Twitter/X mentions
- Reddit threads
- Email support

**Response Times:**
- Critical bugs: < 4 hours
- General support: < 24 hours
- Feature requests: Acknowledge within 48 hours

### Analytics Review

**Key Metrics:**
- Daily active users (DAU)
- Retention (Day 1, 7, 30)
- Average session length
- Completion rates
- Crash rate
- Purchase conversion (if applicable)

See [ANALYTICS_TUTORIAL.md](tutorials/ANALYTICS_TUTORIAL.md) for implementation.

---

## Updates and Patches

### Hotfix (Critical Bugs)

```bash
# Fix bug
# Test thoroughly
# Export new build
# Upload to platforms

# Version: 1.0.0 → 1.0.1
```

**Update Quickly:**
- Web: Instant (just replace files)
- itch.io: Upload new build (instant)
- Steam: Upload via SteamPipe (< 1 hour)
- Mobile: 1-7 day review

### Content Updates

**Planning:**
- Based on player feedback
- Fix common pain points
- Add requested features
- Balance tweaks
- New content

**Versioning:**
```
Major.Minor.Patch
1.0.0 → 1.1.0 (feature update)
1.1.0 → 1.1.1 (bug fix)
1.1.1 → 2.0.0 (major update)
```

**Changelog:**
```
Version 1.1.0 - November 15, 2024

NEW:
• New boss battle
• 5 new weapons
• Photo mode

IMPROVED:
• Better controller support
• Faster loading times
• Updated UI

FIXED:
• Player getting stuck in walls
• Audio crackling issue
• Save corruption bug
```

### DLC/Expansions

```gdscript
# Check DLC ownership
if AeThexAuth.has_dlc("expansion_pack_1"):
    enable_expansion_content()
```

---

## Monetization Strategies

### Premium (Paid)

**Pricing:**
- Research similar games
- Consider your costs
- Regional pricing
- Sales strategy

**Steam Pricing Tips:**
- $9.99 - $19.99: Indie game sweet spot
- Avoid $14.99 (psychological barrier)
- Plan for sales (20-50% off)

### Free-to-Play

**Best Practices:**
- Game must be fun without paying
- No pay-to-win mechanics
- Cosmetic items work well
- Battle pass model
- Generous with free currency

```gdscript
# In-app purchases
func purchase_item(item_id: String):
    var result = await AeThexAuth.purchase_item(item_id)
    
    if result.success:
        grant_item(item_id)
        AeThexAnalytics.track_event("iap_purchase", {
            "item_id": item_id,
            "price": result.price
        })
```

### Freemium

- Free demo/trial
- Upgrade to full version
- Good for single-player games

---

## Marketing Channels

### Social Media

**Twitter/X:**
- Post development updates
- Share GIFs of gameplay
- Engage with gamedev community
- Use hashtags: #indiegame #gamedev

**TikTok/Instagram:**
- Short gameplay clips
- Behind-the-scenes
- Game development tips
- Quick wins/satisfying moments

**Reddit:**
- r/IndieGaming
- r/gamedev
- Genre-specific subreddits
- Avoid spam, engage authentically

### Discord

Create a community server:
- Announcements channel
- General chat
- Bug reports
- Suggestions
- Development updates

### Email List

**Build Pre-Launch:**
- Capture emails on landing page
- Send updates during development
- Offer beta access
- Announce launch date

**Tools:**
- Mailchimp (free tier)
- ConvertKit
- Substack

---

## Common Pitfalls

### ❌ Avoid These Mistakes:

1. **Launching too early** - Polish matters
2. **No marketing** - "Build it and they'll come" is a myth
3. **Ignoring feedback** - Players know what's not fun
4. **No community** - Build audience before launch
5. **Poor store page** - First impression is everything
6. **Broken multiplayer** - Test with real players
7. **No analytics** - You need data to improve
8. **Giving up quickly** - Games can have long tails

---

## Resources

### Tools

- **Analytics:** [AeThex Analytics](https://studio.aethex.io/analytics)
- **Marketing:** [Presskit()](https://dopresskit.com/)
- **Community:** [Discord](https://discord.com)
- **Email:** [Mailchimp](https://mailchimp.com)

### Learning

- **Podcast:** How to Market a Game Podcast
- **Book:** "The Indie Game Developer Handbook"
- **YouTube:** Game Marketing channels
- **Community:** [r/gamedev](https://reddit.com/r/gamedev)

### Support

- **Email:** [support@aethex.io](mailto:support@aethex.io)
- **Discord:** [AeThex Community](https://discord.gg/aethex)
- **Docs:** [docs.aethex.io](https://docs.aethex.io)

---

## Checklist for Launch Day

**24 Hours Before:**
- [ ] Final build tested on all platforms
- [ ] Store pages reviewed (no typos!)
- [ ] Press emails sent
- [ ] Social media posts scheduled
- [ ] Discord announcement prepared
- [ ] Support email ready to monitor
- [ ] Analytics dashboard configured
- [ ] Backup plan for critical bugs

**Launch Day:**
- [ ] Publish on all platforms
- [ ] Post to social media
- [ ] Send email to mailing list
- [ ] Post in relevant communities
- [ ] Monitor for issues
- [ ] Respond to comments
- [ ] Thank supporters
- [ ] Celebrate! 🎉

**Week After:**
- [ ] Gather feedback
- [ ] Plan first update
- [ ] Thank press/influencers who covered
- [ ] Post-mortem analysis
- [ ] Start work on updates

---

## Summary

You've learned how to:
✅ Prepare your game for launch  
✅ Publish to multiple platforms  
✅ Create marketing materials  
✅ Build and engage community  
✅ Plan your launch strategy  
✅ Support your game post-launch  
✅ Handle updates and patches  

Publishing is just the beginning - support your game and community for long-term success!

**Need More Help?**
- [Export Guide](EXPORTING_GAMES.md) - Technical export details
- [Analytics Tutorial](tutorials/ANALYTICS_TUTORIAL.md) - Track your success
- [API Reference](API_REFERENCE.md) - Cloud features documentation

**Good luck with your launch!** 🚀
