diff --git a/guides/deployment.mdx b/guides/deployment.mdx index d157861d..0a29fcb5 100644 --- a/guides/deployment.mdx +++ b/guides/deployment.mdx @@ -436,6 +436,18 @@ assets/ └── web/ # PhysX WASM runtime ``` +### CORS Configuration for Assets + +The assets CDN is configured with CORS headers to allow cross-origin loading from game clients: + +``` +Access-Control-Allow-Origin: * +Access-Control-Allow-Methods: GET, HEAD, OPTIONS +Access-Control-Max-Age: 86400 +``` + +This enables the game client to load 3D models, textures, and manifests from the CDN regardless of the client's origin. The CORS configuration is automatically applied to all assets served from Cloudflare R2. + ### Development CDN Fallback In development, if local CDN is incomplete, the server automatically falls back to production CDN: diff --git a/wiki/data/overview.mdx b/wiki/data/overview.mdx index 6d8ae1db..ae401319 100644 --- a/wiki/data/overview.mdx +++ b/wiki/data/overview.mdx @@ -683,6 +683,53 @@ interface VegetationAsset { - `fallen_tree` - Fallen logs - `mushroom` - Giant mushrooms (added in recent update) +### Model Bounds System + +The `model-bounds.json` manifest provides pre-calculated bounding boxes and footprints for 3D models: + +```typescript +interface ModelBounds { + id: string; // Model identifier + assetPath: string; // Path to GLB model + bounds: { + min: { x: number; y: number; z: number; }; + max: { x: number; y: number; z: number; }; + }; + dimensions: { + x: number; // Width in meters + y: number; // Height in meters + z: number; // Depth in meters + }; + footprint: { + width: number; // Grid footprint width + depth: number; // Grid footprint depth + }; +} +``` + +**Purpose:** +- Pre-calculated bounds avoid runtime model loading for collision detection +- Footprint data used for station placement and terrain flattening +- Enables efficient spatial queries without loading full 3D models +- Generated automatically from model files with 1-meter tile size + +The model bounds system is used by the terrain flattening system to calculate station footprints and by the collision system for efficient spatial queries. + +### Biomes + +The `biomes.json` manifest defines terrain biomes with vegetation, mobs, and environmental properties: + +**Available Biomes:** +- **Plains** - Open grasslands with gentle rolling hills (difficulty 0) +- **Forest** - Dense woodland with abundant trees (difficulty 1) +- **Valley** - Low-lying areas between hills (difficulty 0) +- **Mountains** - High elevation rocky peaks (difficulty 2) +- **Tundra** - Frozen wasteland with ice and snow (difficulty 3) +- **Desert** - Arid wasteland with sand dunes (difficulty 2) +- **Lakes** - Water bodies and fishing spots (difficulty 0) +- **Swamp** - Murky wetlands with twisted vegetation (difficulty 1) +- **Canyon** - Red-rock canyon lands with terraced mesas (difficulty 2, NEW) + ### Biome Vegetation Layers Biomes in `biomes.json` define procedural vegetation layers that reference vegetation assets: @@ -704,6 +751,10 @@ interface VegetationLayer { ``` **Recent Updates**: +- **Canyon biome added** - Red-rock terrain with terraced mesas and sparse vegetation +- **Tree model improvements** - Normalized fir and maple root depths to prevent floating +- **Tree recoloring** - Maple leaves now vermillion red-orange (#D04838), knotwood leaves warm amber (#C4832A) +- **Tree scale adjustments** - Better visual proportions across all tree variants - Mushroom vegetation added to all biomes with varying densities (2-30) - Tree density reduced in plains biome (8 → 5) - Mushroom clustering varies by biome (cluster size 3-8)