Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions scripts/smoke-secondary-journeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -3064,8 +3064,7 @@ async function smokeLevel(session, route, sceneName, exceptions, {
if (
route === 'voidPeaks' &&
(
framePacing.peaksRuntime?.emberRedrawsDuringSample < 10 ||
framePacing.peaksRuntime?.emberRedrawsDuringSample > 22 ||
framePacing.peaksRuntime?.emberRedrawsDuringSample > 4 ||
framePacing.peaksRuntime?.emberVisibleCount > 6 ||
framePacing.peaksRuntime?.patrolUpdatesDuringSample < 10 ||
framePacing.peaksRuntime?.patrolUpdatesDuringSample > 28
Expand Down Expand Up @@ -9222,7 +9221,10 @@ async function smokeGuardianPacing(session, exceptions) {
);

let openingFraming = null;
if (['CrystalCavesLevel', 'ReefLevel'].includes(sceneName)) {
if (
['CrystalCavesLevel', 'ReefLevel', 'VoidPeaksLevel']
.includes(sceneName)
) {
openingFraming = await waitFor(
() => evaluate(session, `(() => {
const scene = window.mythicalGame.scene.getScene(${JSON.stringify(sceneName)});
Expand Down
25 changes: 25 additions & 0 deletions src/__tests__/GuardianPacingContract.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,31 @@ describe('guardian encounter pacing contracts', () => {
expect(source).toContain('this.bossAttackPreviewTimer?.remove?.();');
});

test('Void Peaks frames the Titan before enabling controls or attacks', () => {
const source = readLevel('VoidPeaksLevel.js');

expect(source).toContain('const TITAN_ARENA = Object.freeze({');
expect(source).toContain('stageTitanArenaEntry() {');
expect(source).toMatch(
/startBossFight\(\)[\s\S]*this\.hidePlatformerMobileControls\(\);[\s\S]*this\.stageTitanArenaEntry\(\);/
);
expect(source).toContain(
'beginTitanCombat(camera = this.cameras.main)'
);
expect(source).toContain('openingGraceMs: 3000');
expect(source).toContain(
'const COSMIC_TITAN_MOBILE_DISPLAY_HEIGHT = 240;'
);
expect(source).toContain('this.bossCombatReadyAt = this.time.now;');
expect(source).toContain('camera.width * 0.35');
expect(source).toContain('this.clearGuardianGateState();');
expect(source).toMatch(
/beginTitanCombat[\s\S]*this\.physics\.resume\(\);[\s\S]*this\.showPlatformerMobileControls\(\);[\s\S]*this\.startTitanAttackLoop\(\);/
);
expect(source).toContain('!this.bossCombatReady ||');
expect(source).toContain('this.bossAttackPreviewTimer?.remove?.();');
});

test('Reef echo summons use the shared readable combat contract', () => {
const source = readLevel('ReefLevel.js');
const createMinion = source.match(
Expand Down
16 changes: 13 additions & 3 deletions src/__tests__/LevelTraversalQualityContract.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -964,18 +964,28 @@ describe('campaign traversal quality contracts', () => {
expect(source).not.toContain('this.voidRifts.push(rift);');
});

test('Void Peaks batches static stars and animated embers', () => {
test('Void Peaks batches stars and bounds ember redraws by viewport movement', () => {
const source = read('levels/VoidPeaksLevel.js');

expect(source).toContain('this.peakStarField = Array.from({ length: 35 }');
expect(source).toContain('this.peakStarLayer = this.add.graphics()');
expect(source).toContain('this.peakEmbers = Array.from({ length: 18 }');
expect(source).toContain('drawPeakEmbers(time)');
expect(source).toContain('this.drawPeakEmbers(0, true);');
expect(source).toContain('const cadence = this.isMobile ? 100 : 50;');
expect(source).toContain('const redrawDistance = Math.max(180, (right - left) * 0.45);');
expect(source).toContain('const renderTime = compactViewport ? 0 : now;');
expect(source).toContain('ember.x < left - 140 || ember.x > right + 140');
expect(source).toContain('this.peakEmberDrawCount += 1;');
expect(source).toContain('this.peakEmberLayer.fillCircle(');
expect(source).toMatch(
/createStarFragments\(\)[\s\S]*if \(animateRouteDecorations\) \{[\s\S]*targets: fragment,/
);
expect(source).toMatch(
/this\.collectibles\.add\(fragment\);\s*fragment\.body\.setAllowGravity\(false\);\s*fragment\.body\.setVelocity\(0, 0\);/
);
expect(source).toMatch(
/createPeakRouteChoiceMarkers\(\)[\s\S]*if \(this\.shouldAnimatePeakRouteDecorations\(\)\) \{[\s\S]*targets: \[spine, relicRoute\]/
);
expect(source).toContain('updatePeakEnemyPatrols(time)');
expect(source).toContain('this.peakEnemyPatrolNextAt = now + (this.isMobile ? 80 : 40);');
expect(source).toContain('enemy.patrolSpeed');
Expand Down Expand Up @@ -2624,7 +2634,7 @@ describe('campaign traversal quality contracts', () => {
expect(smoke).toContain('state.reefAmbientRendering?.decorativeTweenCount !== 0');
expect(smoke).toContain('state.peaksAmbientRendering?.starCount !== 35');
expect(smoke).toContain('state.peaksAmbientRendering?.emberLayerCount !== 1');
expect(smoke).toContain('framePacing.peaksRuntime?.emberRedrawsDuringSample > 22');
expect(smoke).toContain('framePacing.peaksRuntime?.emberRedrawsDuringSample > 4');
expect(smoke).toContain('framePacing.peaksRuntime?.patrolUpdatesDuringSample > 28');
expect(smoke).toContain('did not keep Peaks runtime work bounded');
expect(smoke).toContain('activeTweenCount: 22');
Expand Down
Loading