|
| 1 | +# PLAN_PR_VECTOR_ASSET_SYSTEM |
| 2 | + |
| 3 | +## Goal |
| 4 | +Define a first-class vector asset system that integrates with the accepted platform baseline and allows |
| 5 | +SVG-authored/vector-defined content to participate in registry, dependency graph, validation, packaging, |
| 6 | +runtime, debug, profiler, publishing, and template flows without changing engine core APIs. |
| 7 | + |
| 8 | +## Why This PR Exists |
| 9 | +The flagship Asteroids demo is a strong proof of platform, but Asteroids-style content is naturally vector-oriented. |
| 10 | +The current platform baseline proves sprite, tilemap, parallax, packaging, runtime, and publishing flows, but it |
| 11 | +does not yet establish vector assets as a first-class registry-owned type. |
| 12 | + |
| 13 | +This PR defines that missing layer and uses the existing SVG-focused tooling as the authoring bridge. |
| 14 | + |
| 15 | +## Intent |
| 16 | +- Add a real vector asset type |
| 17 | +- Treat SVG authoring as a platform input path |
| 18 | +- Preserve all existing accepted platform boundaries |
| 19 | +- Ignore the original legacy `SpriteEditor` naming and standardize tool naming going forward |
| 20 | + |
| 21 | +## Scope |
| 22 | +- define `vector` as a first-class asset type |
| 23 | +- define vector asset storage and identity contracts |
| 24 | +- define SVG authoring-to-vector normalization rules |
| 25 | +- define registry and dependency graph participation for vector assets |
| 26 | +- define validation rules for vector assets |
| 27 | +- define packaging/runtime contracts for vector assets |
| 28 | +- define debug/profiler visibility expectations for vector assets |
| 29 | +- define naming normalization plan for tool directories and labels |
| 30 | + |
| 31 | +## Non-Goals |
| 32 | +- No engine core API changes |
| 33 | +- No destructive migration of accepted asset types |
| 34 | +- No bypass of validation, packaging, runtime, CI, or publishing boundaries |
| 35 | +- No requirement to preserve legacy tool naming in future-facing UX |
| 36 | +- No forced conversion of all existing sprite assets into vectors |
| 37 | + |
| 38 | +## Proposed Asset Type |
| 39 | +Vector assets become first-class registry-owned entries. |
| 40 | + |
| 41 | +Example logical IDs: |
| 42 | +- `vector.asteroids.ship` |
| 43 | +- `vector.asteroids.asteroid.large` |
| 44 | +- `vector.asteroids.asteroid.medium` |
| 45 | +- `vector.asteroids.asteroid.small` |
| 46 | +- `vector.asteroids.ui.title` |
| 47 | + |
| 48 | +## Proposed File Placement |
| 49 | +```text |
| 50 | +games/Asteroids/platform/assets/vectors/ |
| 51 | +shared/vector/ |
| 52 | +tools/Vector Asset Studio/ |
| 53 | +``` |
| 54 | + |
| 55 | +## Proposed Data Shape |
| 56 | +```json |
| 57 | +{ |
| 58 | + "id": "vector.asteroids.ship", |
| 59 | + "type": "vector", |
| 60 | + "source": { |
| 61 | + "kind": "svg", |
| 62 | + "path": "games/Asteroids/platform/assets/vectors/asteroids-ship.vector.json" |
| 63 | + }, |
| 64 | + "geometry": { |
| 65 | + "paths": [], |
| 66 | + "closed": false |
| 67 | + }, |
| 68 | + "style": { |
| 69 | + "stroke": true, |
| 70 | + "fill": false |
| 71 | + }, |
| 72 | + "assetRefs": {} |
| 73 | +} |
| 74 | +``` |
| 75 | + |
| 76 | +## Core Contracts |
| 77 | +1. Vector assets are registry-owned and ID-driven. |
| 78 | +2. SVG authoring is an input path, not an exception path. |
| 79 | +3. Dependency graph records vector asset relationships exactly like other first-class asset types. |
| 80 | +4. Validation must reject malformed or incomplete vector definitions deterministically. |
| 81 | +5. Packaging must include vector definitions in deterministic order. |
| 82 | +6. Runtime must consume packaged vector assets through a defined runtime handoff contract. |
| 83 | +7. Debug, profiler, export, template, and publishing systems must be able to surface vector asset participation. |
| 84 | +8. No engine core APIs are changed. |
| 85 | + |
| 86 | +## SVG Authoring Bridge |
| 87 | +The SVG-focused editor becomes the preferred authoring surface for vector assets. |
| 88 | +It should output normalized vector asset definitions rather than staying a disconnected tool. |
| 89 | + |
| 90 | +Authoring flow: |
| 91 | +1. Create/edit vector shape in SVG-oriented editor |
| 92 | +2. Normalize shape/path data to platform vector asset form |
| 93 | +3. Save into project-owned vector asset location |
| 94 | +4. Register in asset registry |
| 95 | +5. Validate |
| 96 | +6. Package |
| 97 | +7. Load in runtime |
| 98 | + |
| 99 | +## Runtime Expectations |
| 100 | +Runtime should support vector rendering as packaged content, with deterministic load order and fail-fast behavior |
| 101 | +consistent with the strict runtime model already accepted by the platform. |
| 102 | + |
| 103 | +## Validation Expectations |
| 104 | +Validation should cover: |
| 105 | +- missing vector IDs |
| 106 | +- malformed path data |
| 107 | +- invalid geometry definitions |
| 108 | +- missing required references |
| 109 | +- duplicate vector IDs |
| 110 | +- incompatible packaging/runtime handoff data |
| 111 | + |
| 112 | +## Debug / Profiler Expectations |
| 113 | +Debug views should surface vector nodes and edges alongside other asset types. |
| 114 | +Profiler should be able to report vector load/render timing where supported. |
| 115 | + |
| 116 | +## Tool Naming Normalization Plan |
| 117 | +Going forward, tool names should describe what the tools actually are, using normalized spelling and spacing. |
| 118 | +Ignore the original legacy `SpriteEditor` label and naming pattern. |
| 119 | + |
| 120 | +### Proposed tool rename map |
| 121 | +- `tools/Sprite Editor/` → `tools/Pixel Asset Studio/` |
| 122 | +- `tools/Tile Map Editor/` → `tools/Tilemap Studio/` |
| 123 | +- `tools/Parallax Editor/` → `tools/Parallax Scene Studio/` |
| 124 | +- `tools/SVG Editor/` → `tools/Vector Asset Studio/` |
| 125 | + |
| 126 | +### UI/Docs naming expectations |
| 127 | +- Use human-readable titles with normalized spacing |
| 128 | +- Use stable folder names that match displayed tool identity |
| 129 | +- Avoid mixed naming styles like `SpriteEditor`, `Sprite Editor`, and other legacy variations |
| 130 | +- Treat future docs, PRs, and user-facing references as authoritative on the normalized names |
| 131 | + |
| 132 | +## Rename Constraints |
| 133 | +- Preserve backward compatibility where practical through transitional references |
| 134 | +- Keep existing accepted content paths working during migration windows |
| 135 | +- Avoid broad destructive repo moves unless BUILD explicitly controls them |
| 136 | +- Document legacy-to-new naming clearly in BUILD/APPLY |
| 137 | + |
| 138 | +## Likely Files |
| 139 | +- `docs/pr/BUILD_PR_VECTOR_ASSET_SYSTEM.md` |
| 140 | +- `shared/vector/*` |
| 141 | +- `tools/Vector Asset Studio/*` |
| 142 | +- transitional tool path/reference docs |
| 143 | +- docs/dev reports |
| 144 | +- no engine core API files |
| 145 | + |
| 146 | +## Manual Validation Checklist |
| 147 | +1. Vector asset can be authored from SVG-oriented tooling. |
| 148 | +2. Vector asset is stored as registry-owned project content. |
| 149 | +3. Dependency graph includes vector relationships. |
| 150 | +4. Validation catches malformed vector definitions. |
| 151 | +5. Packaging includes vector assets deterministically. |
| 152 | +6. Runtime can consume packaged vector assets. |
| 153 | +7. Tool names are normalized in docs and planned paths. |
| 154 | +8. Legacy naming is documented without being treated as the target standard. |
| 155 | +9. No engine core APIs are changed. |
| 156 | + |
| 157 | +## Approved Commit Comment |
| 158 | +plan(vector-assets): define first-class vector asset system and normalized tool naming |
| 159 | + |
| 160 | +## Next Command |
| 161 | +BUILD_PR_VECTOR_ASSET_SYSTEM |
0 commit comments