# Alterchase SDK Distribution Guide

This guide explains how to package and distribute the Alterchase Modding SDK to your community.

## What is the SDK?

The SDK enables modders to create custom content for Alterchase, specifically:
- **Custom Levels**: New playable environments and arenas
- **Custom Models**: Props, decorations, and interactive objects  
- **Custom Enemies**: New enemy types with unique behaviors

The SDK provides tools for building, testing, and packaging mods for distribution.

## SDK Components

### Runtime Scripts
- `AlterchaseBarcode.cs` - Unique identifier system
- `ModAsset.cs` - Base class for mod assets
- `LevelModAsset.cs` - Level definitions
- `ModelModAsset.cs` - Model/prop definitions
- `EnemyModAsset.cs` - Enemy definitions
- `ModPackage.cs` - Package container
- `ModLoader.cs` - Runtime mod loading system
- `ModIOIntegration.cs` - mod.io API integration

### Editor Tools
- `ModPackageBuilder.cs` - Build and validation window
- `ModAssetLibrary.cs` - Asset browsing window
- `ModTesterWindow.cs` - Testing window for built mods

### Documentation
- `README.md` - Complete SDK documentation
- `QUICKSTART.md` - 5-minute getting started guide
- `DISTRIBUTION_GUIDE.md` - This file

### Examples
- `ExampleModUsage.cs` - How to load and use mods at runtime
- `ModBrowserExample.cs` - mod.io browsing UI example

## Preparing for Distribution

### Step 1: Package the SDK

1. **Create a new Unity project** (Unity 6000.2+)
2. **Copy SDK files** to `/Assets/AlterchaseSDK/`
3. **Include dependencies**:
   - Newtonsoft.Json (via Package Manager)
   - mod.io Unity Plugin (from Asset Store or GitHub)

4. **Export Unity Package**:
   - Select `/Assets/AlterchaseSDK/` folder
   - Right-click → Export Package...
   - Include all assets
   - Name it: `AlterchaseSDK_v1.0.0.unitypackage`

### Step 2: Choose Distribution Method

You can distribute mods through various platforms:

1. **Manual Distribution**
   - Share built `.mod` files directly
   - Host on your own website or file server
   - Simple and direct control

2. **Third-Party Platforms**
   - **mod.io**: Popular mod hosting platform with API integration
   - **Nexus Mods**: Established modding community
   - **Steam Workshop**: If your game is on Steam
   - **itch.io**: Indie-friendly hosting platform

3. **Community Platforms**
   - Discord file sharing
   - GitHub releases
   - Google Drive or similar services

**Note**: The SDK builds mods into portable `.mod` files that can be uploaded to any platform. Users will need to manually upload their built mods to their chosen platform.

### Step 3: Set Up Your Chosen Platform (Optional)

If using mod.io or similar platforms:

1. **Create account** on your chosen platform
2. **Set up game profile** (if applicable)
3. **Configure settings** and content guidelines
4. **Provide instructions** to modders on how to upload their built mods

Update documentation with platform-specific instructions for manual upload.

### Step 4: Create Distribution Package

Your final distribution should include:

```
AlterchaseSDK_v1.0.0/
├── AlterchaseSDK_v1.0.0.unitypackage
├── README.md
├── QUICKSTART.md
├── LICENSE.txt
├── CHANGELOG.md
└── Examples/
    ├── ExampleMod.unitypackage (optional)
    └── Screenshots/
```

### Step 5: Host the SDK

Recommended hosting options:

1. **GitHub Repository**
   - Public repo for community collaboration
   - Release versions with tags
   - Issue tracking for bug reports
   - Wiki for extended documentation

2. **Your Website**
   - Direct download link
   - Version history
   - News and updates

3. **Unity Asset Store** (Optional)
   - Free SDK listing
   - Wider reach
   - Built-in update system

4. **mod.io Resources**
   - Upload SDK as a resource
   - Direct integration with mod platform

## Documentation Requirements

### For Modders

Provide clear documentation on:
- System requirements (Unity version, packages)
- Installation instructions
- Quick start tutorial
- API reference
- Example projects
- Best practices
- Troubleshooting guide

### For Game Integration

If you plan to have the game auto-load mods:

1. **Include ModLoader in your game**:
```csharp
// In your game's initialization
void Start()
{
    // Initialize mod.io
    ModIOIntegration.Instance.InitializeModIO();
    
    // Load subscribed mods
    LoadPlayerMods();
}

async void LoadPlayerMods()
{
    await Task.Delay(1000); // Wait for mod.io sync
    
    ModProfile[] subscribedMods = ModIOIntegration.Instance.GetSubscribedMods();
    
    foreach (var mod in subscribedMods)
    {
        // Load mod asset bundles
        LoadModFromDisk(mod);
    }
}
```

2. **Add mod management UI** to your game (see `ModBrowserExample.cs`)

3. **Handle mod conflicts** and load order

## Support & Community

### Set Up Support Channels

1. **Discord Server**
   - #sdk-help channel
   - #showcase channel for sharing mods
   - #announcements for SDK updates

2. **Forum/Discussion Board**
   - mod.io community tab
   - Reddit community
   - Steam discussions

3. **Bug Reporting**
   - GitHub Issues
   - In-game bug reporter
   - Email support

### Create Learning Resources

1. **Video Tutorials**
   - SDK installation
   - Creating first mod
   - Building and uploading
   - Advanced techniques

2. **Example Mods**
   - Simple prop pack
   - Custom enemy example
   - Complete level showcase

3. **Community Challenges**
   - Monthly modding contests
   - Featured mod spotlights
   - Collaboration projects

## Version Management

### Semantic Versioning

Use format: `MAJOR.MINOR.PATCH`

- **MAJOR**: Breaking changes, incompatible with old mods
- **MINOR**: New features, backward compatible
- **PATCH**: Bug fixes, fully compatible

Example:
- v1.0.0 - Initial release
- v1.1.0 - Added weapon mod support (new feature)
- v1.1.1 - Fixed validation bug (patch)
- v2.0.0 - Changed asset bundle structure (breaking change)

### Update Strategy

1. **Maintain compatibility** when possible
2. **Communicate breaking changes** clearly and early
3. **Provide migration guides** for major updates
4. **Support previous version** for transition period
5. **Archive old SDK versions** for reference

## Legal Considerations

### Include License Agreement

Specify:
- What modders can/cannot do with the SDK
- Content ownership (modder owns their content)
- Prohibited content types
- Liability disclaimers
- DMCA procedures

### Content Guidelines

Establish rules for:
- No copyrighted content without permission
- No malicious code or exploits
- Age-appropriate content standards
- Respect for intellectual property
- Quality and performance standards

## Marketing Your SDK

### Announcement

1. **Social Media Campaign**
   - Twitter/X announcements
   - Reddit posts in gamedev communities
   - YouTube trailer/showcase

2. **Press Release**
   - Gaming news sites
   - Modding communities
   - Unity forums

3. **Influencer Outreach**
   - Send SDK to content creators
   - Sponsor modding showcase videos
   - Host modding competitions

### Ongoing Promotion

- Feature community mods regularly
- Monthly "Mod of the Month" highlights
- Developer interviews with top modders
- Behind-the-scenes SDK development blogs

## Metrics & Analytics

Track SDK success:
- Download numbers
- Active modders
- Mods published
- Player engagement with mods
- Most popular mod types
- Common support issues

Use this data to:
- Improve documentation
- Prioritize new features
- Identify pain points
- Celebrate community achievements

## Maintenance Plan

### Regular Updates

- **Monthly**: Bug fixes and small improvements
- **Quarterly**: New features and enhancements
- **Annually**: Major version with significant changes

### Community Feedback Loop

1. Collect feedback from modders
2. Prioritize improvements
3. Develop and test updates
4. Beta test with community
5. Release and document changes
6. Repeat

## Success Metrics

Your SDK is successful when:
- ✅ Modders can create content easily
- ✅ High-quality mods are published regularly
- ✅ Players engage with mod content
- ✅ Community is active and supportive
- ✅ Documentation is clear and helpful
- ✅ Bugs are rare and quickly fixed

## Next Steps

1. ✅ Package the SDK
2. ✅ Set up mod.io integration
3. ✅ Create distribution package
4. ✅ Write comprehensive documentation
5. ✅ Set up support channels
6. ✅ Create example content
7. ✅ Launch and promote
8. ✅ Maintain and improve

---

**Questions or Need Help?**

This guide will help you successfully distribute the Alterchase SDK to your modding community. Good luck!
