Skip to content

feat: Infinite Endless Mode — Remove Finish Line - #48

Merged
venice-dev[bot] merged 5 commits into
soli-testbench:mainfrom
saucegodbased:venice-task-6717b83b
Mar 27, 2026
Merged

feat: Infinite Endless Mode — Remove Finish Line#48
venice-dev[bot] merged 5 commits into
soli-testbench:mainfrom
saucegodbased:venice-task-6717b83b

Conversation

@saucegodbased

Copy link
Copy Markdown

Infinite Endless Mode — Remove Finish Line

Replaces the current fixed-length track with a procedurally generated infinite track. The game has no ending — the player keeps going until they fall off the track.

Changes

Track Generation (track.js)

  • Replaced fixed WAYPOINTS array with procedural waypoint generation using seeded RNG
  • Added initTrack(seed) for initializing procedural generation
  • Added ensureTrackTo(minDistance) for lazy track extension ahead of ball
  • Removed FINISH_LINE_DISTANCE export
  • Dynamic trackLength that grows as waypoints are added

Chunk-Based Rendering (renderer.js)

  • Implemented chunk system (CHUNK_SIZE=30) for dynamic track segment generation/culling
  • Track meshes, obstacles, coins, turtles, and moving walls generated per-chunk
  • Old chunks behind ball are destroyed to prevent unbounded memory growth
  • Removed buildFinishLine() and all finish line mesh handling
  • Added updateChunks(ballDistance) called each frame from game loop
  • Seeded RNG per chunk ensures deterministic obstacle/item placement

Physics (physics.js)

  • Removed finish line distance check — game no longer ends at a fixed point
  • Removed track length clamping on ball distance
  • Game over triggered only by ball falling off track

Game Loop (main.js)

  • Removed enterFinished() function and finished state handling
  • Added updateChunks() call in game loop for continuous track generation
  • Score/distance/timer continue incrementing indefinitely
  • Level indicator and background colors cycle based on distance milestones

Server (server.js)

  • Increased MAX_REASONABLE_SCORE from 10,000 to 1,000,000 for infinite mode

Acceptance Criteria

  • Fixed finish line removed; no predefined end point
  • Track segments procedurally generated ahead of ball position
  • Obstacles spawn procedurally on new track segments
  • Old track segments and objects culled behind ball
  • Game-over only on falling off track
  • Score/distance continues incrementing
  • Level indicator and background colors function via distance milestones
  • Memory managed via chunk culling for smooth 60fps performance

devin-ai-integration Bot and others added 5 commits March 27, 2026 21:31
- Replace fixed-length track with procedurally generated infinite track
- Add chunk-based rendering system for dynamic track generation/culling
- Remove finish line and finish state entirely
- Game over only triggers when ball falls off track
- Track segments, obstacles, coins, turtles, and moving walls spawn procedurally
- Old chunks culled behind ball to prevent unbounded memory growth
- Score/distance/level/timer continue incrementing indefinitely
- Level colors cycle based on distance milestones
- Increase MAX_REASONABLE_SCORE to 1000000 for infinite mode
- Seeded RNG ensures deterministic chunk generation

Co-Authored-By: bot_apk <apk@cognition.ai>
…nts, minimize diff

- Revert MAX_REASONABLE_SCORE back to original 10000 (out of scope)
- Restore removed comments in main.js to minimize diff noise
- All changes now strictly scoped to infinite endless mode feature

Co-Authored-By: bot_apk <apk@cognition.ai>
- Restore original js/main.js and js/physics.js from main branch
- Apply only task-scoped changes: remove finish line, add updateChunks
- Root js/ files now preserve their original structure (localStorage
  leaderboard, simpler init) with only endless-mode modifications
- No server.js changes (reverted in previous commit)

Co-Authored-By: bot_apk <apk@cognition.ai>
- Add disposeMesh() helper to dispose geometry and materials
- Call disposeMesh() for all mesh types in destroyChunk(): track,
  edge, obstacle, coin, and moving wall meshes
- Prevents GPU memory accumulation during long endless-mode sessions
- Sync js/renderer.js with public/js/renderer.js

Co-Authored-By: bot_apk <apk@cognition.ai>
…eardown

- Replace disposeMesh() with shared resource registry (sharedGeometries, sharedMaterials Sets)
- destroyChunk() now only removes shared-geo meshes from scene (no dispose)
- Turtle per-instance geometries/materials are still disposed via traverse,
  but with explicit shared-resource guard checks
- Prevents render corruption and WebGL errors during long endless sessions

Co-Authored-By: bot_apk <apk@cognition.ai>
@venice-dev
venice-dev Bot merged commit 5585cb2 into soli-testbench:main Mar 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant