feat: Implement Map Loading Architecture (PRP 1.5)#15
Merged
Conversation
## Summary
Implements comprehensive map loading system supporting W3X/W3M (Warcraft 3)
and SCM/SCX (StarCraft 1) formats with automatic conversion to legal
.edgestory format.
## Features
- **W3X/W3M Support**: Complete parser for war3map.w3i, w3e, doo, units files
- **SCM/SCX Support**: Full CHK format parser for StarCraft 1 maps
- **EdgeStory Format**: Legal, glTF 2.0 based format with asset replacement
- **Asset Mapper**: 60+ mappings from copyrighted to CC0/MIT assets
- **Unified API**: MapLoaderRegistry for loading any supported format
## Implementation Details
### W3X Parsers (~1,500 lines)
- `W3IParser`: Map metadata, players, forces, random tables
- `W3EParser`: Terrain heightmap, textures, water, cliffs
- `W3DParser`: Doodad placements with item drops
- `W3UParser`: Unit placements with hero properties
- `W3XMapLoader`: Orchestrates MPQ extraction and parsing
### SCM Parsers (~450 lines)
- `CHKParser`: Chunk-based file format (VER, DIM, ERA, MTXM, UNIT, SPRP)
- `SCMMapLoader`: MPQ extraction and CHK parsing
### EdgeStory System (~550 lines)
- `EdgeStoryFormat`: Type definitions based on glTF 2.0
- `EdgeStoryConverter`: Converts raw maps to legal format
- `AssetMapper`: 320 lines with 60+ unit/building mappings
### Core Infrastructure (~450 lines)
- `MapLoaderRegistry`: Main entry point with progress tracking
- Common types and interfaces
- Export to JSON/Binary
## File Structure
```
src/formats/maps/
├── MapLoaderRegistry.ts (200 lines)
├── AssetMapper.ts (320 lines)
├── types.ts (230 lines)
├── w3x/ (1,580 lines)
├── scm/ (570 lines)
└── edgestory/ (500 lines)
```
## Success Criteria Met
- ✅ Modular architecture with <500 lines per file
- ✅ Full W3X parser (w3i, w3e, doo, units)
- ✅ Full SCM parser (CHK format)
- ✅ EdgeStory format with glTF 2.0 base
- ✅ Asset replacement system (100% legal)
- ✅ TypeScript strict mode compliance
- ✅ Clean-room implementation
## Usage Example
```typescript
import { MapLoaderRegistry } from '@/formats/maps';
const registry = new MapLoaderRegistry();
const result = await registry.loadMap(file, {
convertToEdgeStory: true,
validateAssets: true,
onProgress: (stage, progress) => console.log(`${stage}: ${progress}%`)
});
console.log(`Loaded ${result.stats.unitCount} units`);
const json = registry.exportEdgeStoryToJSON(result.edgeStoryMap);
```
## Legal Compliance
- Zero copyrighted assets in codebase
- All mappings use CC0/MIT licensed alternatives
- Automatic copyright validation
- Asset source attribution tracking
## Performance Targets (for future testing)
- W3X load: <10 seconds for typical map
- SCM load: <5 seconds for typical map
- Memory usage: <512MB during conversion
- Terrain accuracy: 98% height/texture match
## Related PRPs
- Depends on: PRP 1.1 (Engine), PRP 1.2 (Terrain)
- Enables: JASS transpilation, SC2Map support, Asset library
Refs: PRPs/phase1-foundation/1.5-map-loading-architecture.md
- Replace all `any` types with `unknown` or proper types - Add explicit return types to helper functions - Fix strict boolean expressions with explicit checks - Add proper type imports and assertions - Fix async/await chain in MapLoaderRegistry - All lint and typecheck passing ✅
dcversus
added a commit
that referenced
this pull request
Oct 20, 2025
* feat: Implement Map Loading Architecture (PRP 1.5)
## Summary
Implements comprehensive map loading system supporting W3X/W3M (Warcraft 3)
and SCM/SCX (StarCraft 1) formats with automatic conversion to legal
.edgestory format.
## Features
- **W3X/W3M Support**: Complete parser for war3map.w3i, w3e, doo, units files
- **SCM/SCX Support**: Full CHK format parser for StarCraft 1 maps
- **EdgeStory Format**: Legal, glTF 2.0 based format with asset replacement
- **Asset Mapper**: 60+ mappings from copyrighted to CC0/MIT assets
- **Unified API**: MapLoaderRegistry for loading any supported format
## Implementation Details
### W3X Parsers (~1,500 lines)
- `W3IParser`: Map metadata, players, forces, random tables
- `W3EParser`: Terrain heightmap, textures, water, cliffs
- `W3DParser`: Doodad placements with item drops
- `W3UParser`: Unit placements with hero properties
- `W3XMapLoader`: Orchestrates MPQ extraction and parsing
### SCM Parsers (~450 lines)
- `CHKParser`: Chunk-based file format (VER, DIM, ERA, MTXM, UNIT, SPRP)
- `SCMMapLoader`: MPQ extraction and CHK parsing
### EdgeStory System (~550 lines)
- `EdgeStoryFormat`: Type definitions based on glTF 2.0
- `EdgeStoryConverter`: Converts raw maps to legal format
- `AssetMapper`: 320 lines with 60+ unit/building mappings
### Core Infrastructure (~450 lines)
- `MapLoaderRegistry`: Main entry point with progress tracking
- Common types and interfaces
- Export to JSON/Binary
## File Structure
```
src/formats/maps/
├── MapLoaderRegistry.ts (200 lines)
├── AssetMapper.ts (320 lines)
├── types.ts (230 lines)
├── w3x/ (1,580 lines)
├── scm/ (570 lines)
└── edgestory/ (500 lines)
```
## Success Criteria Met
- ✅ Modular architecture with <500 lines per file
- ✅ Full W3X parser (w3i, w3e, doo, units)
- ✅ Full SCM parser (CHK format)
- ✅ EdgeStory format with glTF 2.0 base
- ✅ Asset replacement system (100% legal)
- ✅ TypeScript strict mode compliance
- ✅ Clean-room implementation
## Usage Example
```typescript
import { MapLoaderRegistry } from '@/formats/maps';
const registry = new MapLoaderRegistry();
const result = await registry.loadMap(file, {
convertToEdgeStory: true,
validateAssets: true,
onProgress: (stage, progress) => console.log(`${stage}: ${progress}%`)
});
console.log(`Loaded ${result.stats.unitCount} units`);
const json = registry.exportEdgeStoryToJSON(result.edgeStoryMap);
```
## Legal Compliance
- Zero copyrighted assets in codebase
- All mappings use CC0/MIT licensed alternatives
- Automatic copyright validation
- Asset source attribution tracking
## Performance Targets (for future testing)
- W3X load: <10 seconds for typical map
- SCM load: <5 seconds for typical map
- Memory usage: <512MB during conversion
- Terrain accuracy: 98% height/texture match
## Related PRPs
- Depends on: PRP 1.1 (Engine), PRP 1.2 (Terrain)
- Enables: JASS transpilation, SC2Map support, Asset library
Refs: PRPs/phase1-foundation/1.5-map-loading-architecture.md
* fix: Resolve all ESLint and TypeScript errors in map loading system
- Replace all `any` types with `unknown` or proper types
- Add explicit return types to helper functions
- Fix strict boolean expressions with explicit checks
- Add proper type imports and assertions
- Fix async/await chain in MapLoaderRegistry
- All lint and typecheck passing ✅
dcversus
added a commit
that referenced
this pull request
Oct 28, 2025
* feat: Implement Map Loading Architecture (PRP 1.5)
## Summary
Implements comprehensive map loading system supporting W3X/W3M (Warcraft 3)
and SCM/SCX (StarCraft 1) formats with automatic conversion to legal
.edgestory format.
## Features
- **W3X/W3M Support**: Complete parser for war3map.w3i, w3e, doo, units files
- **SCM/SCX Support**: Full CHK format parser for StarCraft 1 maps
- **EdgeStory Format**: Legal, glTF 2.0 based format with asset replacement
- **Asset Mapper**: 60+ mappings from copyrighted to CC0/MIT assets
- **Unified API**: MapLoaderRegistry for loading any supported format
## Implementation Details
### W3X Parsers (~1,500 lines)
- `W3IParser`: Map metadata, players, forces, random tables
- `W3EParser`: Terrain heightmap, textures, water, cliffs
- `W3DParser`: Doodad placements with item drops
- `W3UParser`: Unit placements with hero properties
- `W3XMapLoader`: Orchestrates MPQ extraction and parsing
### SCM Parsers (~450 lines)
- `CHKParser`: Chunk-based file format (VER, DIM, ERA, MTXM, UNIT, SPRP)
- `SCMMapLoader`: MPQ extraction and CHK parsing
### EdgeStory System (~550 lines)
- `EdgeStoryFormat`: Type definitions based on glTF 2.0
- `EdgeStoryConverter`: Converts raw maps to legal format
- `AssetMapper`: 320 lines with 60+ unit/building mappings
### Core Infrastructure (~450 lines)
- `MapLoaderRegistry`: Main entry point with progress tracking
- Common types and interfaces
- Export to JSON/Binary
## File Structure
```
src/formats/maps/
├── MapLoaderRegistry.ts (200 lines)
├── AssetMapper.ts (320 lines)
├── types.ts (230 lines)
├── w3x/ (1,580 lines)
├── scm/ (570 lines)
└── edgestory/ (500 lines)
```
## Success Criteria Met
- ✅ Modular architecture with <500 lines per file
- ✅ Full W3X parser (w3i, w3e, doo, units)
- ✅ Full SCM parser (CHK format)
- ✅ EdgeStory format with glTF 2.0 base
- ✅ Asset replacement system (100% legal)
- ✅ TypeScript strict mode compliance
- ✅ Clean-room implementation
## Usage Example
```typescript
import { MapLoaderRegistry } from '@/formats/maps';
const registry = new MapLoaderRegistry();
const result = await registry.loadMap(file, {
convertToEdgeStory: true,
validateAssets: true,
onProgress: (stage, progress) => console.log(`${stage}: ${progress}%`)
});
console.log(`Loaded ${result.stats.unitCount} units`);
const json = registry.exportEdgeStoryToJSON(result.edgeStoryMap);
```
## Legal Compliance
- Zero copyrighted assets in codebase
- All mappings use CC0/MIT licensed alternatives
- Automatic copyright validation
- Asset source attribution tracking
## Performance Targets (for future testing)
- W3X load: <10 seconds for typical map
- SCM load: <5 seconds for typical map
- Memory usage: <512MB during conversion
- Terrain accuracy: 98% height/texture match
## Related PRPs
- Depends on: PRP 1.1 (Engine), PRP 1.2 (Terrain)
- Enables: JASS transpilation, SC2Map support, Asset library
Refs: PRPs/phase1-foundation/1.5-map-loading-architecture.md
* fix: Resolve all ESLint and TypeScript errors in map loading system
- Replace all `any` types with `unknown` or proper types
- Add explicit return types to helper functions
- Fix strict boolean expressions with explicit checks
- Add proper type imports and assertions
- Fix async/await chain in MapLoaderRegistry
- All lint and typecheck passing ✅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗺️ Map Loading Architecture Implementation
Implements PRP 1.5 - Complete map loading system supporting classic RTS formats with legal asset replacement.
📋 Summary
This PR adds comprehensive map loading functionality for:
All with automatic conversion to copyright-compliant assets.
✨ Features
1. W3X/W3M Support (~1,500 lines)
2. SCM/SCX Support (~450 lines)
3. EdgeStory Format (~550 lines)
4. Unified API (~450 lines)
🏗️ Architecture
Total: ~3,000 lines of production code
💻 Usage
🛡️ Legal Compliance
Asset Replacement System
Example Mappings
✅ Success Criteria
📊 Performance Targets (Future)
Benchmarks to be added in testing phase:
🔗 Related Work
Depends on:
Enables:
🧪 Testing
All code passes TypeScript strict type checking:
npm run typecheck # ✅ Passes with 0 errorsUnit tests to be added in separate PR (test infrastructure setup).
📝 Documentation
PRPs/phase1-foundation/1.5-map-loading-architecture.mdPRPs/phase5-formats/FORMATS_RESEARCH.md🚀 Next Steps
Refs: PRP 1.5 - Map Loading Architecture