How mrredshark77/incremental-mass-rewritten works
1. Project shape
- This is a browser-based incremental game, delivered as a static front end.
- The app is centered on index.html, style.css, tooltip.css, and a large js/ codebase. There is no server-side layer in the repository.
- The GitHub Actions workflow in .github/workflows/static.yml suggests it is meant to be built/deployed as a static site.
2. Entry point and app shell
- index.html is the main host page that loads the game UI and scripts.
- hidden.html appears to be a secondary/hidden page for secret content or alternate UI states.
- js/main.js is likely the top-level bootstrap and render/update coordinator for the game loop and DOM updates.
3. Core game loop and state model
- js/temp.js is an important architectural file: in incremental games this usually holds derived, cached, or “temporary” values recomputed from persistent state each tick.
- js/resources.js, js/saves.js, js/other.js, and js/debug.js are the central support layer around resource tracking, persistence, miscellaneous helpers, and developer tooling.
- The runtime likely follows a pattern of: load save → reconstruct state → recompute derived values → update UI → persist periodically.
4. Numerical foundation
- js/break_eternity.js is the precision math foundation, used to support extremely large numbers typical of incremental progression.
- js/md.js and js/formats.js are the number formatting layer, translating large values into readable UI text.
- js/scaling.js likely defines how costs and thresholds escalate across systems.
5. Progression and unlock systems
- The game’s advancement layers are spread across js/ranks.js, js/upgrades.js, js/buildings.js, js/elements.js, js/elemental.js, js/atom.js, js/stars.js, and js/ascensions.js.
- These files represent the core gameplay economy: player resources, upgrade purchase logic, unlock thresholds, and prestige-style resets.
- js/confirm.js, js/tooltip.js, js/tooltip_res.js, and js/tabs.js support the UI around those progression systems.
6. Major late-game branches
- The repository is organized into large feature domains under separate folders:
- js/infinity/ for infinity-level progression
- js/quantum/ for quantum mechanics-style progression layers
- js/supernova/ for supernova-related systems
- js/darkness/ for darkness/endgame content
- This structure implies the game has multiple prestige branches or parallel endgame tracks, each with its own mechanics and unlocks.
7. Infinity subsystem
- js/infinity/core.js, js/infinity/inf.js, and js/infinity/corrupted_star.js define the infinity layer and associated mechanics.
- This layer likely acts as a major reset/progression boundary, introducing new currencies or multipliers that feed back into earlier systems.
8. Quantum subsystem
- js/quantum/quantum.js is the main quantum layer, with supporting modules for big_rip.js, chroma.js, entropy.js, primordium.js, and qc.js.
- This looks like a distinct late-game ecosystem with multiple subresources and challenge or configuration systems.
- Quantum content likely consumes outputs from earlier systems and redefines long-term progression.
9. Supernova subsystem
- js/supernova/supernova.js is the parent layer, with bosons.js, fermions.js, radiation.js, and tree.js as its feature modules.
- The file naming suggests this layer introduces a technology/tree-style progression model plus particle/physics-inspired submechanics.
10. Darkness and exotic content
- js/darkness/dark.js, dark_run.js, matter.js, exotic_atoms.js, and c16.js form a separate advanced content branch.
- This looks like a challenge-heavy or alternate-state system with its own resources, run conditions, and possibly “matter” as a competing economy.
- js/secret.js and js/hidden.js indicate easter eggs or intentionally concealed mechanics.
11. Domain-specific content modules
- js/challenges.js, js/atoms.js, js/stars.js, js/buildings.js, js/elements.js, and js/upgrades.js are the game’s main rule modules.
- These are likely where purchase logic, unlock conditions, effects, and balances are encoded.
- The architecture is feature-sliced by mechanic rather than by technical layer, which is common in incremental game codebases.
12. Rendering and interaction
- The UI is DOM-driven rather than canvas-driven: styles are split across style.css, tooltip.css, and hidden_style.css.
- Assets in images/ and fonts/ support iconography and display polish.
- The js/tabs.js and tooltip modules suggest the interface is organized into many panel-like screens, each exposing one layer of progression.
13. Persistence and game lifecycle
- js/saves.js is the save/load boundary and probably serializes the entire player state.
- The architecture likely separates persistent player data from transient calculated state, with temp.js bridging the two.
- This is the key data flow to diagram: persistent save state feeds derived computation, which feeds DOM rendering and user actions, which in turn mutate save state.
14. Overall architecture summary
- The repository is a single-page incremental game with one front-end runtime and many mechanic modules.
- The major architectural boundaries are: core runtime, numeric/formatting foundation, save/state management, UI rendering, and several large progression subsystems (Infinity, Quantum, Supernova, Darkness).
- For an architecture diagram, the most important relationships are the flow from saved player state into derived values and then into layered gameplay systems that reset, amplify, or unlock one another.
Main entry points: main.js Main loop · resources.js Resources · temp.js Temp state · quantum.js Quantum
Components 25
App shell
Static front-end entry pages and styling.
- Index · Main game host page.
index.html - Hidden page · Secondary page for secret or alternate UI states.
hidden.html
Core runtime
Bootstrap, save lifecycle, derived state, and shared helpers.
- Main loop · Top-level coordinator for update and render flow.
js/main.js - Saves · Save/load boundary and player serialization.
js/saves.js - Temp state · Recomputed cached values used during gameplay ticks.
js/temp.js - Resources · Central resource tracking and shared game data.
js/resources.js - Big numbers · Precision arithmetic foundation for huge values.
js/break_eternity.js - Formats · Readable formatting for large numeric values.
js/formats.js - Scaling · Cost and threshold scaling logic.
js/scaling.js
Progression layer
Main early/mid-game mechanics and unlock systems.
- Ranks · Early prestige and rank advancement.
js/ranks.js - Upgrades · Core upgrade purchase and effect logic.
js/upgrades.js - Buildings · Production and structure-based mechanics.
js/buildings.js - Elements · Element collection and unlock layer.
js/elements.js - Atoms · Atomic resource progression and conversions.
js/atom.js - Stars · Star-based progression and multipliers.
js/stars.js - Ascensions · Higher-tier reset and advancement layer.
js/ascensions.js - Challenges · Conditional gameplay modifiers and goals.
js/challenges.js
Late-game branches
Major prestige and endgame content tracks.
- Infinity · Infinity-layer progression and reset mechanics.
js/infinity/inf.js - Quantum · Quantum-layer progression and subresources.
js/quantum/quantum.js - Supernova · Supernova-layer progression and tree systems.
js/supernova/supernova.js - Darkness · Darkness and exotic late-game content.
js/darkness/dark.js
Connections 24
- Index → Main loop: loads · Primary page bootstraps the game runtime.
- Hidden page → Hidden UI: loads · Hidden page connects to secret UI logic.
- Main loop → Saves: save cycle · Main loop reads and writes persistent state.
- Main loop → Temp state: tick update · Main loop refreshes derived values each cycle.
- Main loop → Resources: state flow · Runtime coordinates shared game resources.
- Main loop → Tabs: render · Main UI updates tabbed screens and panels.
- Main loop → Tooltips: ui helpers · Main runtime feeds tooltip-driven interactions.
- Main loop → Confirm: actions · Dangerous actions route through confirmation dialogs.
- Main loop → Big numbers: numbers · Game logic relies on precision arithmetic.
- Temp state → Formats: display values · Derived values are turned into readable text.
- Temp state → Scaling: balance · Derived values use scaling rules for costs and thresholds.
- Saves → Resources: persist · Player saves reconstruct the central resource model.
- Resources → Ranks: drives · Core resource state powers rank progression.
- Resources → Upgrades: drives · Resources are spent on upgrades.
- Resources → Buildings: drives · Resources fuel building mechanics.
- Resources → Elements: unlocks · Resource thresholds gate element progression.
- Resources → Atoms: feeds · Resource state flows into atom systems.
- Resources → Stars: feeds · Resource state flows into star systems.
- Ranks → Ascensions: prestige path · Rank progression leads into higher prestige layers.
- Challenges → Quantum: conditions · Challenge logic shapes quantum content and constraints.
- Infinity → Quantum: bridges · Infinity progression feeds later quantum layers.
- Quantum → Supernova: advances to · Quantum content unlocks deeper supernova systems.
- Supernova → Darkness: late game · Supernova systems feed into darkness content.
- Hidden UI → Darkness: secret content · Hidden mechanics connect to darker endgame paths.