Skip to content

Commit d07d2e5

Browse files
committed
plan(vector-assets): define first-class vector asset system and normalized tool naming
1 parent 542fde9 commit d07d2e5

28 files changed

Lines changed: 874 additions & 75 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,21 @@ MODEL: GPT-5.4
22
REASONING: high
33

44
COMMAND:
5-
Execute this flagship demo package in order.
5+
Create BUILD_PR_VECTOR_ASSET_SYSTEM.
66

7-
Step 1:
8-
Treat docs/pr/PLAN_PR_ASTEROIDS_PLATFORM_DEMO.md as the governing architecture contract.
7+
Requirements:
8+
- Implement a first-class vector asset type integrated with registry, dependency graph, validation, packaging, and runtime
9+
- Use the SVG-focused tool as the authoring bridge for vector asset output
10+
- Normalize tool naming and planned tool paths to match actual responsibilities
11+
- Ignore the original legacy SpriteEditor naming as the target standard
12+
- Preserve accepted platform boundaries and do not modify engine core APIs
13+
- Document any transitional compatibility needed for renamed tool paths
914

10-
Step 2:
11-
Create BUILD_PR_ASTEROIDS_PLATFORM_DEMO.
12-
13-
BUILD requirements:
14-
- Implement a flagship Asteroids-style demo using accepted platform boundaries only
15-
- Include player ship, bullets, asteroid spawning/splitting, score, lives, waves, and title/game-over loop
16-
- Use registry-owned, validation-compatible content paths
17-
- Validate/package/run through strict platform flows
18-
- Expose debug/profiler visibility where already supported by the platform
19-
- Keep the demo reusable as a future template candidate
20-
- Do not modify engine core APIs
21-
22-
Step 3:
23-
Validate BUILD against docs/pr/BUILD_PR_ASTEROIDS_PLATFORM_DEMO.md.
24-
25-
Step 4:
26-
Treat docs/pr/APPLY_PR_ASTEROIDS_PLATFORM_DEMO.md as the acceptance boundary and package results.
15+
Tool naming targets:
16+
- tools/Pixel Asset Studio/
17+
- tools/Tilemap Studio/
18+
- tools/Parallax Scene Studio/
19+
- tools/Vector Asset Studio/
2720

2821
Package:
29-
HTML-JavaScript-Gaming/tmp/GAME_PR_ASTEROIDS_PLATFORM_DEMO_delta.zip
22+
HTML-JavaScript-Gaming/tmp/BUILD_PR_VECTOR_ASSET_SYSTEM_delta.zip

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
build(demo): add flagship asteroids platform demo
1+
plan(vector-assets): define first-class vector asset system and normalized tool naming

docs/dev/change_summary.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
Single atomic flagship demo package containing PLAN, BUILD, and APPLY documentation for an
2-
Asteroids-style platform demo. This bundle is docs-first and Codex-ready, with implementation
3-
ownership delegated to Codex.
1+
Adds a docs-only plan for first-class vector asset support and a normalized naming plan for editor tools.
2+
Establishes SVG authoring as the vector asset bridge and standardizes future-facing tool names/spaces.

docs/dev/file_tree.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
docs/pr/PLAN_PR_ASTEROIDS_PLATFORM_DEMO.md
2-
docs/pr/BUILD_PR_ASTEROIDS_PLATFORM_DEMO.md
3-
docs/pr/APPLY_PR_ASTEROIDS_PLATFORM_DEMO.md
1+
docs/pr/PLAN_PR_VECTOR_ASSET_SYSTEM.md
42
docs/dev/codex_commands.md
53
docs/dev/commit_comment.txt
64
docs/dev/change_summary.txt
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Vector asset vector.asteroids.ship ready with 2 paths.
2+
Validation: 0 blocking findings, 0 warnings
3+
Packaging: Package ready with 2 assets and 1 dependencies.
4+
Runtime: Runtime loader ready with 2 assets.
5+
Debug: Debug view: 4 nodes, 3 edges, 0 findings.
6+
Profiler: Performance profiler captured 4 deterministic samples.
7+
[info] VECTOR_ASSET_SYSTEM_READY: Vector assets integrate with validation, packaging, and runtime without engine core API changes.
8+
[info] VECTOR_AUTHORING_BRIDGE: Vector Asset Studio uses the SVG-focused tool flow as the authoring bridge for normalized vector output.

docs/dev/validation_checklist.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
- PLAN, BUILD, and APPLY docs are all present
2-
- codex_commands.md and commit_comment.txt are under docs/dev
3-
- Demo uses accepted platform boundaries
4-
- Strict validation, packaging, and runtime flow remain authoritative
1+
- PLAN doc exists and is docs-only
2+
- Vector asset type is defined as first-class and registry-owned
3+
- SVG authoring bridge is documented
4+
- Validation, packaging, runtime, debug, and profiler expectations are defined
5+
- Tool rename map is explicit
6+
- docs/dev contains codex_commands.md and commit_comment.txt
57
- No engine core API changes are authorized
6-
- APPLY remains docs-only acceptance boundary
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# BUILD_PR_VECTOR_ASSET_SYSTEM
2+
3+
## Purpose
4+
Implement the first-class vector asset system defined in `PLAN_PR_VECTOR_ASSET_SYSTEM.md` while preserving the accepted platform boundaries and avoiding engine core API changes.
5+
6+
## Build Scope
7+
- add `vector` as a first-class registry-owned asset type
8+
- integrate vector assets into the dependency graph, validation, packaging, and runtime flows
9+
- use the SVG-focused tool as the authoring bridge for normalized vector asset output
10+
- normalize forward-facing tool naming to:
11+
- `tools/Pixel Asset Studio/`
12+
- `tools/Tilemap Studio/`
13+
- `tools/Parallax Scene Studio/`
14+
- `tools/Vector Asset Studio/`
15+
- document transitional compatibility for legacy tool paths
16+
17+
## Implemented Files
18+
- `tools/shared/projectAssetRegistry.js`
19+
- `tools/shared/projectAssetValidation.js`
20+
- `tools/shared/projectPackaging.js`
21+
- `tools/shared/gameplaySystemLayer.js`
22+
- `tools/shared/vector/vectorAssetBridge.js`
23+
- `tools/shared/vectorAssetSystem.js`
24+
- `tests/tools/VectorAssetSystem.test.mjs`
25+
- `tests/run-tests.mjs`
26+
- `games/Asteroids/platform/assets/vectors/asteroids-ship.vector.json`
27+
- `games/Asteroids/platform/assets/vectors/asteroids-asteroid-large.vector.json`
28+
- `games/Asteroids/platform/assets/vectors/asteroids-title.vector.json`
29+
- `tools/index.html`
30+
- `tools/Pixel Asset Studio/*`
31+
- `tools/Tilemap Studio/*`
32+
- `tools/Parallax Scene Studio/*`
33+
- `tools/Vector Asset Studio/*`
34+
35+
## Vector Asset Contracts
36+
- Registry adds a `vectors` section with normalized `source.kind`, `source.path`, geometry, style, and optional `paletteId`.
37+
- Dependency graph adds `vector` nodes and deterministic `usesPalette` edges for palette-backed vector assets.
38+
- Validation adds deterministic vector checks for malformed source definitions, missing geometry paths, invalid style, and missing registry references.
39+
- Packaging accepts `vectorDocument.assetRefs.vectorId` as a strict packaging root and keeps stable ordering.
40+
- Runtime consumes packaged vector assets through the existing strict data-asset path, preserving deterministic load order and fail-fast behavior.
41+
42+
## SVG Authoring Bridge
43+
- Added `tools/shared/vector/vectorAssetBridge.js` to normalize SVG-authored path data into first-class vector asset definitions.
44+
- `tools/Vector Asset Studio/` is now the normalized forward-facing authoring path.
45+
- The current implementation bridge redirects to `tools/SVG Background Editor/` during the transition window.
46+
47+
## Tool Naming Normalization
48+
Forward-facing normalized paths now exist in the repo and should be treated as the target standard:
49+
50+
- `tools/Pixel Asset Studio/`
51+
- `tools/Tilemap Studio/`
52+
- `tools/Parallax Scene Studio/`
53+
- `tools/Vector Asset Studio/`
54+
55+
## Transitional Compatibility
56+
Legacy implementation paths remain intact during transition and are compatibility-only:
57+
58+
- `tools/Sprite Editor/` backs `tools/Pixel Asset Studio/`
59+
- `tools/Tile Map Editor/` backs `tools/Tilemap Studio/`
60+
- `tools/Parallax Editor/` backs `tools/Parallax Scene Studio/`
61+
- `tools/SVG Background Editor/` backs `tools/Vector Asset Studio/`
62+
63+
Legacy naming such as `SpriteEditor` is not treated as the target standard.
64+
65+
## Verification
66+
- `node --check tools/shared/projectAssetRegistry.js`
67+
- `node --check tools/shared/projectAssetValidation.js`
68+
- `node --check tools/shared/projectPackaging.js`
69+
- `node --check tools/shared/vector/vectorAssetBridge.js`
70+
- `node --check tools/shared/vectorAssetSystem.js`
71+
- `node --check tests/tools/VectorAssetSystem.test.mjs`
72+
- `node ./scripts/run-node-tests.mjs`
73+
- Result: `107/107` explicit `run()` tests passed.
74+
75+
## Manual Validation Checklist
76+
1. Vector asset can be normalized from SVG input into a registry-owned vector definition.
77+
2. Dependency graph includes vector nodes and relationships.
78+
3. Validation rejects malformed vector definitions deterministically.
79+
4. Packaging includes vector assets deterministically from vector roots.
80+
5. Runtime consumes packaged vector assets successfully.
81+
6. Forward-facing tool names use the normalized studio names.
82+
7. Transitional compatibility for legacy paths is documented.
83+
8. No engine core APIs are changed.
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
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
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"id": "vector.asteroids.asteroid.large",
3+
"type": "vector",
4+
"source": {
5+
"kind": "svg",
6+
"path": "games/Asteroids/platform/assets/vectors/asteroids-asteroid-large.vector.json"
7+
},
8+
"geometry": {
9+
"viewBox": "-40 -40 80 80",
10+
"paths": [{ "d": "M -28 -12 L -10 -30 L 20 -26 L 32 -8 L 26 18 L 6 32 L -22 24 L -34 2 Z" }]
11+
},
12+
"style": {
13+
"stroke": true,
14+
"fill": false
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"id": "vector.asteroids.ship",
3+
"type": "vector",
4+
"source": {
5+
"kind": "svg",
6+
"path": "games/Asteroids/platform/assets/vectors/asteroids-ship.vector.json"
7+
},
8+
"geometry": {
9+
"viewBox": "-24 -24 48 48",
10+
"paths": [{ "d": "M 0 -18 L 14 16 L 0 8 L -14 16 Z" }, { "d": "M -6 14 L 0 6 L 6 14" }]
11+
},
12+
"style": {
13+
"stroke": true,
14+
"fill": false
15+
}
16+
}

0 commit comments

Comments
 (0)