space-game/public/levels/final-challenge.json
Michael Mainguy 244a25fff5
All checks were successful
Build / build (push) Successful in 1m34s
Implement hybrid level storage system with JSON-based defaults and configurable orbit constraints
Major changes:
- Add LevelRegistry for managing default (JSON) and custom (localStorage) levels
- Default levels now load from /public/levels/*.json files
- Add 6 default level JSON files (rookie-training through final-challenge)
- Implement version-based automatic cache invalidation
- Add LevelVersionManager for tracking level updates
- Add LevelStatsManager for performance tracking (completion rate, best time, etc.)
- Add legacy migration tool for existing localStorage data
- Update level selector UI with stats display and version badges
- Add configurable orbit constraints per level (useOrbitConstraints flag)
- Hide copy button in level selector UI (TODO: re-enable later)
- Add extensive debug logging for velocity troubleshooting
- Add cloud sync infrastructure interfaces (future-ready)

Technical improvements:
- Hybrid storage: immutable defaults from JSON, editable custom levels in localStorage
- Automatic cache refresh when directory.json version changes
- Cache API for offline support
- Fresh start migration approach with export option
- Level loading now initializes before router starts

Physics configuration:
- Add useOrbitConstraints flag to LevelConfig
- Rookietraining.json uses constraints (velocities will create orbital motion)
- Debug logging added to verify velocity application

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 18:40:01 -06:00

1011 lines
22 KiB
JSON

{
"version": "1.0",
"difficulty": "commander",
"timestamp": "2025-11-11T23:44:24.811Z",
"metadata": {
"author": "System",
"description": "The ultimate challenge - survive the most chaotic asteroid field in known space.",
"estimatedTime": "15-20 minutes",
"type": "default"
},
"ship": {
"position": [
0,
1,
0
],
"rotation": [
0,
0,
0
],
"linearVelocity": [
0,
0,
0
],
"angularVelocity": [
0,
0,
0
]
},
"startBase": {
"position": [
0,
0,
0
],
"baseGlbPath": "base.glb"
},
"sun": {
"position": [
0,
0,
400
],
"diameter": 50,
"intensity": 1000000
},
"planets": [],
"asteroids": [
{
"id": "asteroid-0",
"position": [
197.09643531484056,
-89.14825393594855,
11.90585373695789
],
"scale": 4.399137466451847,
"linearVelocity": [
-27.345365975177263,
12.507263218454119,
-1.6518306237450822
],
"angularVelocity": [
-0.390204516191091,
-0.4067233664615002,
0.31701008736288694
]
},
{
"id": "asteroid-1",
"position": [
-22.05086996253851,
100.71375746574074,
-35.986743979220996
],
"scale": 2.7285804676767182,
"linearVelocity": [
5.679764320686774,
-25.683823037262613,
9.269304332124353
],
"angularVelocity": [
-0.042647589257244434,
-0.7204062422706432,
0.12072201649700487
]
},
{
"id": "asteroid-2",
"position": [
123.09367193100991,
207.77898985632189,
-48.587319633658524
],
"scale": 3.6786822845012197,
"linearVelocity": [
-18.89527797242572,
-31.741245759428086,
7.458311187009071
],
"angularVelocity": [
0.9705973464285913,
0.14656317258354257,
0.9992336194001412
]
},
{
"id": "asteroid-3",
"position": [
89.30898974878112,
35.33109524911992,
-145.06733223913844
],
"scale": 6.888469487451312,
"linearVelocity": [
-18.942753943646355,
-7.281747243466502,
30.769296434737694
],
"angularVelocity": [
-0.7629112776527025,
-0.5164361592877427,
-0.6441752778255809
]
},
{
"id": "asteroid-4",
"position": [
-45.122077578065706,
-140.1439494162342,
124.92788820472445
],
"scale": 4.989179719913447,
"linearVelocity": [
8.346728185021815,
26.108952512205615,
-23.10928887903233
],
"angularVelocity": [
-0.7600978095375162,
0.39730655658985103,
-0.37169385327458615
]
},
{
"id": "asteroid-5",
"position": [
87.16194160068348,
49.092397548337736,
-23.21867870490947
],
"scale": 5.356999152235866,
"linearVelocity": [
-28.270340919201853,
-15.598418866596635,
7.530809326028778
],
"angularVelocity": [
0.21358672453298722,
-0.9654860082110677,
-0.23635578293983261
]
},
{
"id": "asteroid-6",
"position": [
-60.18157877867517,
105.61586849032237,
59.2489634834698
],
"scale": 6.992509606849942,
"linearVelocity": [
16.429273031785396,
-28.559614117233657,
-16.17467367381745
],
"angularVelocity": [
0.8004364545225435,
-0.5509051691452647,
-0.23307281998303386
]
},
{
"id": "asteroid-7",
"position": [
36.490759178202616,
-113.748633937046,
66.2611424572859
],
"scale": 2.8629615192038846,
"linearVelocity": [
-6.231308699936364,
19.59493792567753,
-11.315019000987139
],
"angularVelocity": [
-0.5652546515607755,
0.08872760169536509,
-0.3817041033367037
]
},
{
"id": "asteroid-8",
"position": [
151.01209178579262,
-64.05827189612683,
92.46272300524083
],
"scale": 3.865000338605417,
"linearVelocity": [
-24.211832685550245,
10.430820309372425,
-14.8245875716284
],
"angularVelocity": [
-0.752357515326953,
-0.6879306535034426,
0.4624804290426705
]
},
{
"id": "asteroid-9",
"position": [
141.36045416327275,
-91.48148253402032,
-85.116669110041
],
"scale": 6.115244214669208,
"linearVelocity": [
-21.651413501756007,
14.164886717799872,
13.036858219662173
],
"angularVelocity": [
0.6891512982303367,
-0.812045637158409,
0.6109149586806297
]
},
{
"id": "asteroid-10",
"position": [
139.26026649006366,
-122.77943749993788,
143.35992517501452
],
"scale": 7.581077495569217,
"linearVelocity": [
-19.75186450305236,
17.55615395104285,
-20.333336195551883
],
"angularVelocity": [
0.17865152400950324,
-0.7250158783763934,
0.35870649668097077
]
},
{
"id": "asteroid-11",
"position": [
-133.22175412558724,
33.51358825038045,
49.482594310773
],
"scale": 7.010783583602642,
"linearVelocity": [
29.559837238905327,
-7.214260036150041,
-10.979418816287
],
"angularVelocity": [
0.006970641689681756,
0.8085035823297635,
0.261296695954941
]
},
{
"id": "asteroid-12",
"position": [
52.88615939894847,
-40.55511139942254,
-126.39639295872398
],
"scale": 2.547979860881804,
"linearVelocity": [
-14.07056955914136,
11.055899920293106,
33.628254714704276
],
"angularVelocity": [
-0.25997501815568524,
0.20162897126321955,
-0.6193621234887217
]
},
{
"id": "asteroid-13",
"position": [
33.71316860172135,
26.19223115813049,
-219.82948777649838
],
"scale": 3.5905563547959125,
"linearVelocity": [
-3.0578229277195907,
-2.2849641618026393,
19.93878581550797
],
"angularVelocity": [
0.8208004537206359,
0.943626667623497,
0.636331499279438
]
},
{
"id": "asteroid-14",
"position": [
70.99037607148803,
65.01706917911979,
141.7156035818434
],
"scale": 7.900929561366385,
"linearVelocity": [
-11.738878460803742,
-10.585781286097086,
-23.433912292159985
],
"angularVelocity": [
0.5542302859386417,
0.7347191385249978,
-0.7600598276619333
]
},
{
"id": "asteroid-15",
"position": [
-63.24684515880312,
-121.32993266780319,
-236.30572977273826
],
"scale": 6.031745164618868,
"linearVelocity": [
5.4348582536848165,
10.511921069944156,
20.30596376188773
],
"angularVelocity": [
-0.7997802484968162,
0.42836919054372613,
-0.314396626586837
]
},
{
"id": "asteroid-16",
"position": [
-176.72603145601283,
13.819761297012825,
-77.33003398577715
],
"scale": 3.6280218432879696,
"linearVelocity": [
23.539665910780506,
-1.7075746877886944,
10.300254862835958
],
"angularVelocity": [
-0.34409993460756905,
-0.20940818931646854,
-0.11173980734000555
]
},
{
"id": "asteroid-17",
"position": [
-15.581622764575508,
97.68495726755624,
-131.15566381186713
],
"scale": 5.302935812905752,
"linearVelocity": [
2.0973576383778574,
-13.01423713724918,
17.654151783068915
],
"angularVelocity": [
0.9043715876220539,
-0.48302780015394475,
0.3182089564692956
]
},
{
"id": "asteroid-18",
"position": [
-127.31657799128861,
-163.71590384627933,
-8.658802013966405
],
"scale": 2.0655323763955127,
"linearVelocity": [
12.561981065792901,
16.25207100283125,
0.8543404847037116
],
"angularVelocity": [
-0.4242424307159647,
-0.30548784444591126,
-0.1417785915052585
]
},
{
"id": "asteroid-19",
"position": [
266.21201720238054,
67.13263299906843,
-47.61795653071815
],
"scale": 4.148416375051257,
"linearVelocity": [
-22.747929144440555,
-5.651061381103751,
4.068974468347706
],
"angularVelocity": [
0.24657630590088297,
-0.2876210241185655,
0.036951840019366244
]
},
{
"id": "asteroid-20",
"position": [
-130.4487444673596,
-133.54730547477757,
122.08916981149021
],
"scale": 2.6766966053282504,
"linearVelocity": [
20.809900912759115,
21.46372589817787,
-19.476335603474116
],
"angularVelocity": [
-0.09448320109110542,
0.5627809609464198,
0.03899317893652299
]
},
{
"id": "asteroid-21",
"position": [
-167.01997402006253,
-81.60408402264582,
-131.50830148148964
],
"scale": 7.735792020015795,
"linearVelocity": [
23.728388441797488,
11.735493338855232,
18.683274735146135
],
"angularVelocity": [
0.39684294087209393,
0.8913492946951482,
-0.7066277514054979
]
},
{
"id": "asteroid-22",
"position": [
67.20559549760922,
-85.04449403639762,
-3.4657156416780683
],
"scale": 2.8083607565734185,
"linearVelocity": [
-19.622893810106003,
25.123532600504888,
1.0119301749969825
],
"angularVelocity": [
-0.21704223291194769,
-0.054572642271028204,
-0.8574342587539809
]
},
{
"id": "asteroid-23",
"position": [
-178.83660268420658,
-135.11846468332007,
-81.20130277734171
],
"scale": 5.617601889463837,
"linearVelocity": [
18.73095906653341,
14.256753661803959,
8.504848871219885
],
"angularVelocity": [
0.05846198435432193,
0.7847536016343937,
-0.20024060705388136
]
},
{
"id": "asteroid-24",
"position": [
133.298646185844,
6.263088866828296,
45.54416728413243
],
"scale": 3.8834755951862325,
"linearVelocity": [
-31.549662103249243,
-1.2456891357793825,
-10.779577510374088
],
"angularVelocity": [
0.9406991286269459,
-0.7530273627887878,
-0.5146367905397993
]
},
{
"id": "asteroid-25",
"position": [
-52.870700373715756,
-30.457334160674296,
66.80240799141129
],
"scale": 3.084903437984574,
"linearVelocity": [
14.57918241565675,
8.674411532228188,
-18.420873660226565
],
"angularVelocity": [
-0.1475500952638753,
0.5420012182952676,
-0.9280062603862036
]
},
{
"id": "asteroid-26",
"position": [
53.921586498644615,
25.614880519848644,
-239.3792792049877
],
"scale": 4.129362492162142,
"linearVelocity": [
-7.549536119561917,
-3.446317915144604,
33.515380981569926
],
"angularVelocity": [
0.32899241666939494,
-0.5581685678578219,
-0.8299997976742683
]
},
{
"id": "asteroid-27",
"position": [
-84.0007854765908,
39.40037065419949,
-184.5194755685237
],
"scale": 7.857691580383484,
"linearVelocity": [
9.223555040971405,
-4.216483575875807,
20.260828864650872
],
"angularVelocity": [
0.5671327337952365,
0.4966047689819506,
-0.12838194464568087
]
},
{
"id": "asteroid-28",
"position": [
-6.723062963768454,
229.19109350652636,
-44.96094920552127
],
"scale": 4.146481028556643,
"linearVelocity": [
0.5815223495389018,
-19.737762617261815,
3.8889709884315193
],
"angularVelocity": [
-0.2819905204070907,
-0.666056758318089,
-0.7329241452147119
]
},
{
"id": "asteroid-29",
"position": [
-5.420085800167328,
137.5929570067395,
62.88367105901004
],
"scale": 3.957056081473905,
"linearVelocity": [
1.1742702147772721,
-29.593081525833952,
-13.623847415509067
],
"angularVelocity": [
-0.75675132185515,
0.39791799169962827,
-0.8993476320237579
]
},
{
"id": "asteroid-30",
"position": [
-96.53732432627598,
4.005667372278689,
218.0224902983474
],
"scale": 3.9772797190583407,
"linearVelocity": [
13.62751711903197,
-0.42428960876736294,
-30.776751268069084
],
"angularVelocity": [
0.47062905276332545,
0.7359299323477955,
-0.013621065478302885
]
},
{
"id": "asteroid-31",
"position": [
17.977161874173163,
219.01565887599202,
-90.09466451286532
],
"scale": 6.461731818630775,
"linearVelocity": [
-2.405499833479485,
-29.172381869440102,
12.055445792833495
],
"angularVelocity": [
-0.14778153893752277,
0.8797235508363888,
-0.7617384158633715
]
},
{
"id": "asteroid-32",
"position": [
212.37762042656277,
32.08082234373045,
98.96990689063155
],
"scale": 7.046638242818798,
"linearVelocity": [
-32.019339098900744,
-4.6859334241421084,
-14.921303868801674
],
"angularVelocity": [
0.9711089067193552,
-0.6817796163798913,
0.08772358279687165
]
},
{
"id": "asteroid-33",
"position": [
202.45421857255099,
17.766114210441344,
52.999854458966894
],
"scale": 5.485004604300619,
"linearVelocity": [
-21.495610030845626,
-1.780144940131811,
-5.62726828403066
],
"angularVelocity": [
-0.3892121331474394,
-0.9607600126799083,
0.40336226722458335
]
},
{
"id": "asteroid-34",
"position": [
133.82532739865124,
-22.28674761837511,
-19.47715065985845
],
"scale": 4.805533514672975,
"linearVelocity": [
-32.7422308754581,
5.697427248491427,
4.7653562752097836
],
"angularVelocity": [
0.9404459512722712,
-0.7973796489697049,
0.28790265818839433
]
},
{
"id": "asteroid-35",
"position": [
-5.606809251802911,
-254.66675749226488,
-10.635198414965616
],
"scale": 4.868158964660745,
"linearVelocity": [
0.456334291128285,
20.808538922165738,
0.8655913750126973
],
"angularVelocity": [
0.3906433220412131,
0.26410603775720576,
-0.364521441421076
]
},
{
"id": "asteroid-36",
"position": [
-126.70392892461646,
-112.98432594456347,
41.83710351722766
],
"scale": 2.1597079657543365,
"linearVelocity": [
17.694142399324,
15.917855994457849,
-5.842531273434433
],
"angularVelocity": [
-0.9195088621706802,
0.45467971429947207,
-0.5804904645288449
]
},
{
"id": "asteroid-37",
"position": [
98.09603569379702,
176.04097735099725,
-184.53396602588938
],
"scale": 7.6848963588573564,
"linearVelocity": [
-7.910543808918427,
-14.11544625527125,
14.880968554507746
],
"angularVelocity": [
0.17838675227087597,
-0.7807486854848582,
0.18557145914210338
]
},
{
"id": "asteroid-38",
"position": [
-96.78393551125991,
163.15357034985922,
86.38366562881744
],
"scale": 6.461251439335374,
"linearVelocity": [
12.28975291189166,
-20.59047612451102,
-10.969112803623526
],
"angularVelocity": [
-0.7009499648616151,
0.31191584050991095,
0.9135097165353177
]
},
{
"id": "asteroid-39",
"position": [
-113.75646033563181,
94.04064946819827,
228.25927168787246
],
"scale": 3.212742691765523,
"linearVelocity": [
15.627088724695533,
-12.781291541183881,
-31.356706075210653
],
"angularVelocity": [
-0.3893464616882625,
0.6858221147860539,
0.6701153033899852
]
},
{
"id": "asteroid-40",
"position": [
-103.67465463239579,
70.90053787393109,
55.242289075228385
],
"scale": 5.840877663423122,
"linearVelocity": [
24.96798090210368,
-16.83415585874284,
-13.304007845595459
],
"angularVelocity": [
-0.9648573178051563,
-0.25784351426379004,
-0.7350801272196414
]
},
{
"id": "asteroid-41",
"position": [
-38.28172667257399,
74.60845401559355,
64.00896537255215
],
"scale": 4.507908854908897,
"linearVelocity": [
10.127371481088943,
-19.473002467744898,
-16.933472619781597
],
"angularVelocity": [
-0.2741982079231837,
-0.8091480289784934,
0.27597687379539204
]
},
{
"id": "asteroid-42",
"position": [
41.26891323067563,
169.3466702949089,
45.830622243471495
],
"scale": 6.312092614518194,
"linearVelocity": [
-7.595773776137795,
-30.98514410541094,
-8.435381775992047
],
"angularVelocity": [
0.42162983420692557,
-0.2753023281598619,
0.5429463799014655
]
},
{
"id": "asteroid-43",
"position": [
103.08410072400935,
27.070699067602238,
-50.2373689392114
],
"scale": 4.692463721627536,
"linearVelocity": [
-18.766756455062037,
-4.746245605079522,
9.145857229229264
],
"angularVelocity": [
-0.21887611594005874,
-0.9457095897804053,
-0.8349682240847964
]
},
{
"id": "asteroid-44",
"position": [
-211.704823336666,
28.633868714092078,
54.36879913294464
],
"scale": 7.361304400691506,
"linearVelocity": [
23.109356849973484,
-3.0164685111766647,
-5.9348103688204485
],
"angularVelocity": [
-0.4102834272306395,
-0.0005085326930096556,
0.27144136108856687
]
},
{
"id": "asteroid-45",
"position": [
40.59067938395703,
-112.63595913252314,
-231.26039013718872
],
"scale": 3.5759363198998693,
"linearVelocity": [
-5.297570050449684,
14.83085434614602,
30.182252064750937
],
"angularVelocity": [
-0.6950879443133422,
0.4441824268524672,
-0.07409360133911669
]
},
{
"id": "asteroid-46",
"position": [
50.72754186291391,
80.55142505916288,
-61.67160515601282
],
"scale": 2.385886346276281,
"linearVelocity": [
-10.42476777557777,
-16.348222326624164,
12.673828427089251
],
"angularVelocity": [
-0.7133111908426297,
-0.5586764394873507,
0.46198693656014367
]
},
{
"id": "asteroid-47",
"position": [
-135.89028513460119,
-128.16310832550596,
-43.60556463891677
],
"scale": 7.533076777196445,
"linearVelocity": [
18.02879362210448,
17.136287713897335,
5.7852239022949234
],
"angularVelocity": [
-0.6758791113463056,
-0.5832680879062346,
-0.9813816265316921
]
},
{
"id": "asteroid-48",
"position": [
-124.41539897273083,
78.21449226859862,
-166.25175407703486
],
"scale": 7.706723236551336,
"linearVelocity": [
15.617651835165512,
-9.692602899938148,
20.869297800747134
],
"angularVelocity": [
-0.39628629090540235,
-0.059621252061398344,
0.4553357505365425
]
},
{
"id": "asteroid-49",
"position": [
-66.79829949459466,
74.5913805566566,
48.555623126422674
],
"scale": 2.63422135535551,
"linearVelocity": [
16.76157960260831,
-18.466155465021334,
-12.18397696267165
],
"angularVelocity": [
0.796215193833989,
0.31056861419965776,
0.19715448756571075
]
}
],
"difficultyConfig": {
"rockCount": 50,
"forceMultiplier": 1.3,
"rockSizeMin": 2,
"rockSizeMax": 8,
"distanceMin": 90,
"distanceMax": 280
}
}