Skip to content

Commit eb7c9e7

Browse files
author
DavidQ
committed
Restore older Asteroids vector geometry for ship, asteroids, and UFOs - PR_26133_117-asteroids-older-vector-geometry-restore
1 parent 830a4b6 commit eb7c9e7

5 files changed

Lines changed: 201 additions & 103 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# PR_26133_117 Asteroids Older Vector Geometry Restore Report
2+
3+
## Summary
4+
- Read `docs/dev/PROJECT_INSTRUCTIONS.md` before implementation.
5+
- Used PR_26133_116 as the prior reference from committed `HEAD` (`830a4b6ef`) and `docs/dev/reports/PR_26133_116-asteroids-vector-map-ssoT-cleanup_report.md`; the local PR116 delta ZIP was not present under `tmp/`.
6+
- Searched farther back before Object Vector V2 work:
7+
- original Asteroids runtime geometry in `055a629ab`, `fe340bde3`, and `31ca1521e`
8+
- pre-Object-Vector manifest vector map geometry in `3fc7bbce7`
9+
- Object Vector V2 migration boundary in `9d81680fd` and `526dbdf9f`
10+
- Restored manifest-owned vector map geometry only:
11+
- `vector.asteroids.ship` now uses the older right-facing runtime ship points.
12+
- `vector.asteroids.asteroid.medium` was restored from the older manifest vector path.
13+
- `vector.asteroids.asteroid.small` was restored from the older manifest vector path.
14+
- `vector.asteroids.ufo.large` and `vector.asteroids.ufo.small` were verified against the older runtime UFO polylines and left unchanged.
15+
- Kept Asteroids runtime loading manifest-only; no runtime fallback/default vector maps or hardcoded map constants were added.
16+
- Preserved the manifest cleanup that was already dirty at the start of PR117: the current ship Object Vector hull point and removal of the duplicate `object.asteroids.medium-asteroid-2`.
17+
18+
## Changed Files
19+
- `games/Asteroids/game.manifest.json`
20+
- `tests/games/AsteroidsAssetReferenceAdoption.test.mjs`
21+
- `tests/games/AsteroidsValidation.test.mjs`
22+
- `tests/games/AsteroidsVectorTransforms.test.mjs`
23+
- `docs/dev/reports/PR_26133_117-asteroids-older-vector-geometry-restore_report.md`
24+
25+
## Validation
26+
- PASS: syntax checks for changed targeted Asteroids test files.
27+
- PASS: Asteroids manifest JSON parse.
28+
- PASS: targeted manifest load and restored vector geometry validation for ship, medium asteroid, small asteroid, large UFO, and small UFO.
29+
- PASS: targeted required vector map resolution and missing required map failure validation.
30+
- PASS: targeted Asteroids tests:
31+
- `AsteroidsValidation`
32+
- `AsteroidsVectorTransforms`
33+
- `AsteroidsAssetReferenceAdoption`
34+
- `AsteroidsPlatformDemo`
35+
- `AsteroidsPresentation`
36+
- `AsteroidsHardening`
37+
- `AsteroidsCollisionTimingStress`
38+
- PASS: targeted scan found no active Asteroids runtime fallback/default vector maps or collision-suffixed manifest vector IDs; remaining matches are test-only simulated duplicate objects and generic non-vector fallback helpers.
39+
- PASS: `git diff --check` (line-ending warnings only).
40+
41+
## Skipped
42+
- Skipped `npm run test:workspace-v2` by request; this PR requested targeted Asteroids validation only.
43+
- Skipped full regression and full samples smoke test by request.
44+
45+
## Manual Validation
46+
1. Open the Asteroids workspace/game manifest and confirm `tools.object-vector-studio-v2.vectorMaps.vectors` contains `vector.asteroids.ship`, `vector.asteroids.asteroid.medium`, `vector.asteroids.asteroid.small`, `vector.asteroids.ufo.large`, and `vector.asteroids.ufo.small`.
47+
2. Confirm the ship map points are `[14,0]`, `[-10,-8]`, `[-6,-3]`, `[-6,3]`, `[-10,8]`, `[14,0]`.
48+
3. Confirm the medium and small asteroid vector map paths/points match the restored older manifest geometry.
49+
4. Confirm removing a required manifest vector map, such as `vector.asteroids.ship`, produces an actionable validation failure naming the missing ID.
50+
51+
## ZIP
52+
- Output path: `tmp/PR_26133_117-asteroids-older-vector-geometry-restore_delta.zip`

games/Asteroids/game.manifest.json

Lines changed: 96 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -273,25 +273,114 @@
273273
],
274274
"viewBox": "-24 -24 48 48",
275275
"paths": [
276-
"M 0 -18 L 14 16 L 0 8 L -14 16 Z",
277-
"M -6 14 L 0 6 L 6 14"
276+
"M 14 0 L -10 -8 L -6 -3 L -6 3 L -10 8 L 14 0"
278277
],
279278
"points": [
280279
{
281-
"x": 0,
282-
"y": -18
280+
"x": 14,
281+
"y": 0
282+
},
283+
{
284+
"x": -10,
285+
"y": -8
286+
},
287+
{
288+
"x": -6,
289+
"y": -3
290+
},
291+
{
292+
"x": -6,
293+
"y": 3
294+
},
295+
{
296+
"x": -10,
297+
"y": 8
283298
},
284299
{
285300
"x": 14,
301+
"y": 0
302+
}
303+
]
304+
},
305+
{
306+
"id": "vector.asteroids.asteroid.medium",
307+
"label": "Medium Asteroid",
308+
"kind": "polygon",
309+
"usage": [
310+
"gameplay",
311+
"collision"
312+
],
313+
"viewBox": "-28 -28 56 56",
314+
"paths": [
315+
"M -16 -10 L -2 -18 L 16 -14 L 20 2 L 8 18 L -10 16 L -20 4 Z"
316+
],
317+
"points": [
318+
{
319+
"x": -16,
320+
"y": -10
321+
},
322+
{
323+
"x": -2,
324+
"y": -18
325+
},
326+
{
327+
"x": 16,
328+
"y": -14
329+
},
330+
{
331+
"x": 20,
332+
"y": 2
333+
},
334+
{
335+
"x": 8,
336+
"y": 18
337+
},
338+
{
339+
"x": -10,
286340
"y": 16
287341
},
342+
{
343+
"x": -20,
344+
"y": 4
345+
}
346+
]
347+
},
348+
{
349+
"id": "vector.asteroids.asteroid.small",
350+
"label": "Small Asteroid",
351+
"kind": "polygon",
352+
"usage": [
353+
"gameplay",
354+
"collision"
355+
],
356+
"viewBox": "-18 -18 36 36",
357+
"paths": [
358+
"M -10 -6 L 0 -12 L 10 -6 L 8 8 L -6 10 L -12 0 Z"
359+
],
360+
"points": [
361+
{
362+
"x": -10,
363+
"y": -6
364+
},
288365
{
289366
"x": 0,
367+
"y": -12
368+
},
369+
{
370+
"x": 10,
371+
"y": -6
372+
},
373+
{
374+
"x": 8,
290375
"y": 8
291376
},
292377
{
293-
"x": -14,
294-
"y": 16
378+
"x": -6,
379+
"y": 10
380+
},
381+
{
382+
"x": -12,
383+
"y": 0
295384
}
296385
]
297386
},
@@ -557,7 +646,7 @@
557646
"points": [
558647
{
559648
"x": 0,
560-
"y": -18
649+
"y": -16
561650
},
562651
{
563652
"x": 14,
@@ -1310,86 +1399,6 @@
13101399
"x": 0,
13111400
"y": 0
13121401
}
1313-
},
1314-
{
1315-
"id": "object.asteroids.medium-asteroid-2",
1316-
"name": "Medium Asteroid 2",
1317-
"shapes": [
1318-
{
1319-
"tool": "polygon",
1320-
"order": 0,
1321-
"visible": true,
1322-
"locked": false,
1323-
"geometry": {
1324-
"points": [
1325-
{
1326-
"x": -16,
1327-
"y": -10
1328-
},
1329-
{
1330-
"x": -2,
1331-
"y": -18
1332-
},
1333-
{
1334-
"x": 16,
1335-
"y": -14
1336-
},
1337-
{
1338-
"x": 20,
1339-
"y": 2
1340-
},
1341-
{
1342-
"x": 8,
1343-
"y": 18
1344-
},
1345-
{
1346-
"x": -10,
1347-
"y": 16
1348-
},
1349-
{
1350-
"x": -20,
1351-
"y": 4
1352-
}
1353-
]
1354-
},
1355-
"style": {
1356-
"fill": "transparent",
1357-
"stroke": "#CBD5E1",
1358-
"strokeWidth": 2,
1359-
"fillOpacity": 1,
1360-
"strokeOpacity": 1
1361-
},
1362-
"transform": {
1363-
"x": 0,
1364-
"y": 0,
1365-
"rotation": 0,
1366-
"scaleX": 1,
1367-
"scaleY": 1
1368-
}
1369-
}
1370-
],
1371-
"states": [
1372-
{
1373-
"id": "active",
1374-
"name": "Active",
1375-
"frames": [
1376-
{
1377-
"id": "frame-1",
1378-
"order": 0,
1379-
"durationFrames": 1,
1380-
"shapeOverrides": []
1381-
}
1382-
]
1383-
}
1384-
],
1385-
"tags": [
1386-
"asteroid",
1387-
"medium"
1388-
],
1389-
"objectOrigin": {
1390-
"x": 0,
1391-
"y": 0
1392-
}
13931402
}
13941403
]
13951404
},

tests/games/AsteroidsAssetReferenceAdoption.test.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ export async function run() {
8282
roleBindings: vectorMaps.objectVectorRoles
8383
});
8484
assert.equal(missingMediumValidation.ok, false);
85-
assert.equal(missingMediumValidation.errors.some((entry) => (
86-
entry.message.includes("requires object object.asteroids.medium-asteroid")
87-
&& entry.details.candidates.some((candidate) => candidate.includes("object.asteroids.medium-asteroid-2"))
88-
)), true);
8985
assert.equal(missingMediumValidation.errors.some((entry) => (
9086
entry.message.includes("manifest binding requires object object.asteroids.medium-asteroid")
9187
)), true);

tests/games/AsteroidsValidation.test.mjs

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ import {
2323
loadAsteroidsVectorMapsFromManifest
2424
} from '../../games/Asteroids/game/asteroidsVectorMaps.js';
2525

26+
const ASTEROIDS_MEDIUM_ASTEROID_VECTOR_MAP_ID = 'vector.asteroids.asteroid.medium';
27+
const ASTEROIDS_SMALL_ASTEROID_VECTOR_MAP_ID = 'vector.asteroids.asteroid.small';
28+
2629
function createCanvas() {
2730
const listeners = new Map();
2831
const canvas = {
@@ -159,6 +162,8 @@ export async function run() {
159162
const manifestVectorIds = objectVectorPayload.vectorMaps.vectors.map((vector) => vector.id);
160163
assert.equal(manifestVectorIds.includes(ASTEROIDS_VECTOR_MAP_IDS.bullet), true);
161164
assert.equal(manifestVectorIds.includes(ASTEROIDS_VECTOR_MAP_IDS.ship), true);
165+
assert.equal(manifestVectorIds.includes(ASTEROIDS_MEDIUM_ASTEROID_VECTOR_MAP_ID), true);
166+
assert.equal(manifestVectorIds.includes(ASTEROIDS_SMALL_ASTEROID_VECTOR_MAP_ID), true);
162167
assert.equal(manifestVectorIds.includes(ASTEROIDS_VECTOR_MAP_IDS.ufoLarge), true);
163168
assert.equal(manifestVectorIds.includes(ASTEROIDS_VECTOR_MAP_IDS.ufoSmall), true);
164169
assert.equal(manifestVectorIds.includes('vector.asteroids.ship.collision'), false);
@@ -195,17 +200,53 @@ export async function run() {
195200
assert.deepEqual(
196201
vectorMaps.vectorsById.get(ASTEROIDS_VECTOR_MAP_IDS.ship).points,
197202
[
198-
{ x: 0, y: -18 },
199-
{ x: 14, y: 16 },
200-
{ x: 0, y: 8 },
201-
{ x: -14, y: 16 },
203+
{ x: 14, y: 0 },
204+
{ x: -10, y: -8 },
205+
{ x: -6, y: -3 },
206+
{ x: -6, y: 3 },
207+
{ x: -10, y: 8 },
208+
{ x: 14, y: 0 },
202209
],
203210
);
204211
assert.deepEqual(
205212
vectorMaps.vectorsById.get(ASTEROIDS_VECTOR_MAP_IDS.ship).paths,
206213
[
207-
'M 0 -18 L 14 16 L 0 8 L -14 16 Z',
208-
'M -6 14 L 0 6 L 6 14',
214+
'M 14 0 L -10 -8 L -6 -3 L -6 3 L -10 8 L 14 0',
215+
],
216+
);
217+
assert.deepEqual(
218+
vectorMaps.vectorsById.get(ASTEROIDS_MEDIUM_ASTEROID_VECTOR_MAP_ID).points,
219+
[
220+
{ x: -16, y: -10 },
221+
{ x: -2, y: -18 },
222+
{ x: 16, y: -14 },
223+
{ x: 20, y: 2 },
224+
{ x: 8, y: 18 },
225+
{ x: -10, y: 16 },
226+
{ x: -20, y: 4 },
227+
],
228+
);
229+
assert.deepEqual(
230+
vectorMaps.vectorsById.get(ASTEROIDS_MEDIUM_ASTEROID_VECTOR_MAP_ID).paths,
231+
[
232+
'M -16 -10 L -2 -18 L 16 -14 L 20 2 L 8 18 L -10 16 L -20 4 Z',
233+
],
234+
);
235+
assert.deepEqual(
236+
vectorMaps.vectorsById.get(ASTEROIDS_SMALL_ASTEROID_VECTOR_MAP_ID).points,
237+
[
238+
{ x: -10, y: -6 },
239+
{ x: 0, y: -12 },
240+
{ x: 10, y: -6 },
241+
{ x: 8, y: 8 },
242+
{ x: -6, y: 10 },
243+
{ x: -12, y: 0 },
244+
],
245+
);
246+
assert.deepEqual(
247+
vectorMaps.vectorsById.get(ASTEROIDS_SMALL_ASTEROID_VECTOR_MAP_ID).paths,
248+
[
249+
'M -10 -6 L 0 -12 L 10 -6 L 8 8 L -6 10 L -12 0 Z',
209250
],
210251
);
211252
assert.deepEqual(
@@ -221,12 +262,12 @@ export async function run() {
221262
const shipObject = loadAsteroidsObjectVectorPayload().objects.find((object) => object.id === 'object.asteroids.ship');
222263
const shipHull = shipObject.shapes.find((shape) => shape.tool === 'polygon');
223264
assert.deepEqual(shipHull.geometry.points, [
224-
{ x: 0, y: -18 },
265+
{ x: 0, y: -16 },
225266
{ x: 14, y: 16 },
226267
{ x: 0, y: 8 },
227268
{ x: -14, y: 16 },
228269
]);
229-
const mediumAsteroidVariant = loadAsteroidsObjectVectorPayload().objects.find((object) => object.id === 'object.asteroids.medium-asteroid-2');
270+
const mediumAsteroidVariant = loadAsteroidsObjectVectorPayload().objects.find((object) => object.id === 'object.asteroids.medium-asteroid');
230271
assert.deepEqual(mediumAsteroidVariant.shapes[0].geometry.points, [
231272
{ x: -16, y: -10 },
232273
{ x: -2, y: -18 },

tests/games/AsteroidsVectorTransforms.test.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ export function run() {
3131
});
3232
ship.angle = Math.PI / 2;
3333
const shipPoints = ship.getPoints();
34-
assert.equal(shipPoints.length, 4);
35-
assertPointClose(shipPoints[0], { x: 118, y: 200 });
36-
assertPointClose(shipPoints[1], { x: 84, y: 214 });
37-
assertPointClose(shipPoints[3], { x: 84, y: 186 });
34+
assert.equal(shipPoints.length, 6);
35+
assertPointClose(shipPoints[0], { x: 100, y: 214 });
36+
assertPointClose(shipPoints[1], { x: 108, y: 190 });
37+
assertPointClose(shipPoints[4], { x: 92, y: 190 });
3838

3939
const asteroid = new Asteroid(320, 240, 3, () => 0.5, asteroidGeometryProfiles);
4040
asteroid.angle = 0;

0 commit comments

Comments
 (0)