@@ -53,6 +53,7 @@ const DEFAULT_CONFIG = {
5353// Serialized once at module load — the config is constant, so init() and reset()
5454// reuse it instead of re-stringifying on every (re)construction.
5555const CONFIG_JSON = JSON . stringify ( DEFAULT_CONFIG ) ;
56+ const DEFAULT_SEED = 12345 ;
5657
5758// Ecosystem + motion sliders, each mapping one DOM slider to one SimParam.
5859// Adding a slider is a one-line entry here plus the markup in index.html.
@@ -73,9 +74,6 @@ class EvolutionApp {
7374 this . renderer = null ;
7475 this . canvas = null ;
7576 this . animationId = null ;
76- this . lastTime = 0 ;
77- this . frameCount = 0 ;
78- this . fps = 0 ;
7977 // Render-upload gating: the instance buffer is repacked only when the sim
8078 // step advances (see render()); other frames re-use the cached pointer.
8179 this . lastRenderedStep = - 1 ;
@@ -225,18 +223,16 @@ class EvolutionApp {
225223 document . getElementById ( "cull" ) . addEventListener ( "click" , ( ) => {
226224 this . simulation . cull ( 0.5 ) ;
227225 this . lastRenderedStep = - 1 ; // force a repack so the change shows at once
228- this . updateStats ( ) ;
229226 } ) ;
230227 document . getElementById ( "bloom" ) . addEventListener ( "click" , ( ) => {
231228 this . simulation . bloom ( 500 ) ;
232229 this . lastRenderedStep = - 1 ;
233- this . updateStats ( ) ;
234230 } ) ;
235231
236232 // Parameter sliders (table-driven — see SLIDERS) plus the sim-speed control.
237233 this . setupSliders ( ) ;
238234
239- // Keyboard shortcuts (ignored while typing in the seed box )
235+ // Keyboard shortcuts (ignored while editing controls )
240236 document . addEventListener ( "keydown" , ( e ) => {
241237 if ( e . target . tagName === "INPUT" ) return ;
242238 if ( e . key === "h" || e . key === "H" ) {
@@ -310,45 +306,22 @@ class EvolutionApp {
310306 } ) ;
311307 }
312308
313- // Size the canvas to the window and build a fresh simulation. The seed box, if
314- // set, reproduces a specific run; empty means a wall-clock seed. Shared by
315- // init() and reset() so construction lives in one place.
309+ // Size the canvas to the window and build a fresh deterministic simulation.
310+ // Shared by init() and reset() so construction lives in one place.
316311 createSimulation ( ) {
317312 this . canvas . width = window . innerWidth ;
318313 this . canvas . height = window . innerHeight ;
319314 const worldSize = Math . max ( this . canvas . width , this . canvas . height ) ;
320- const seedText = document . getElementById ( "seed-input" ) ?. value . trim ( ) ;
321- const seed = seedText ? Number ( seedText ) : NaN ;
322- this . simulation = Number . isFinite ( seed )
323- ? WebSimulation . with_seed ( worldSize , CONFIG_JSON , seed )
324- : new WebSimulation ( worldSize , CONFIG_JSON ) ;
325- this . updateSeedDisplay ( ) ;
315+ this . simulation = WebSimulation . with_seed ( worldSize , CONFIG_JSON , DEFAULT_SEED ) ;
326316 this . lastRenderedStep = - 1 ; // fresh sim — force a repack on the next frame
327317 }
328318
329319 reset ( ) {
330320 this . createSimulation ( ) ;
331- this . updateStats ( ) ;
332- }
333-
334- updateSeedDisplay ( ) {
335- const el = document . getElementById ( "seed-display" ) ;
336- if ( el && this . simulation ) {
337- el . textContent = String ( this . simulation . get_seed ( ) ) ;
338- }
339321 }
340322
341323 startRenderLoop ( ) {
342324 const animate = ( currentTime ) => {
343- // Calculate FPS
344- this . frameCount ++ ;
345- if ( currentTime - this . lastTime >= 1000 ) {
346- this . fps = this . frameCount ;
347- this . frameCount = 0 ;
348- this . lastTime = currentTime ;
349- this . updateStats ( ) ;
350- }
351-
352325 // Update simulation at target FPS
353326 const targetInterval = 1000 / this . targetFPS ;
354327 if ( currentTime - this . lastUpdateTime >= targetInterval ) {
@@ -400,11 +373,6 @@ class EvolutionApp {
400373 this . camera . y
401374 ) ;
402375 }
403-
404- updateStats ( ) {
405- this . updateSeedDisplay ( ) ;
406- }
407-
408376 showError ( message ) {
409377 const errorDiv = document . createElement ( "div" ) ;
410378 errorDiv . style . cssText = `
0 commit comments