# Task Assignment — Worker Milestone 3 (TileMapRenderer & Server Pipeline Integration)

Scope:
Implement:
1. `client/webapp/js/engine/biome_texture_manager.js` (NEW file, <= 350 lines):
   - Lazy load active biome textures from `client/webapp/assets/map/styles/<style_id>/`.
   - Create and cache `CanvasPattern` or `HTMLImageElement` for tile types (Floor, Wall, Path, Liquid).
   - Memory management: active biome texture memory < 500 KB.
   - Graceful fallback: returns procedural color palette from `map_style_catalog.js` if texture is loading.
   - Safe in Node.js environment (mock-friendly when Image/document undefined).
2. `client/webapp/js/engine/tile_map_renderer.js` (UPDATE, maintain <= 350 lines):
   - Integrate with `BiomeTextureManager`.
   - In `_bakeChunk()`, use texture pattern for tile drawing with 2.5D extrusion.
   - Deterministic coordinate hash for prop decals on floor tiles.
   - SAT Diamond culling and LRU 8 slots OffscreenCanvas (RAM <= 16.5 MB, 60-120 FPS).
3. `client/webapp/js/engine/tile_grid_loader.js` (UPDATE):
   - Call `TileMapRenderer.init(mapGrid, width, height, biomeCode)` on binary map load.
4. `client/webapp/index.html` (UPDATE):
   - Add `<select id="debug-biome-selector">` in `#simulator-bar`.
   - Read `?biome=` query param on startup.
5. Server pipeline:
   - `server/world/map_biome_catalog.py`: Expand to 30 biomes with `biome_code` (1-30).
   - `server/world/map_binary_serializer.py`: Map codes 1-30 in `BIOME_TO_CODE` and `CODE_TO_BIOME`.
   - `server/world/wilderness_map_generator.py`: Zone-to-biome mapping, support biomes 1-30.
   - `tools/serve_webapp.py`: Accept `?biome=` in `/api/map`.
   - `tests/unit/test_war_fog_and_procedural_map.py`: Update line 50 assertion for 30 biomes.
6. Verify code hygiene: `python tools/lint/check_code_and_doc_hygiene.py --strict`.

Report handoff in `c:\Projects\FreeExile\.agents\teamwork\worker_m3\handoff.md`.
