An idle combat game where pachinko physics fuel a race to destroy the opposing core.
Two cores face off in a physics-driven arena. Resources bounce through pins, obstacles, and channels into collection bins, powering weapons, repairs, and combat effects. Cannons fire, lasers cut through defenses, and homing missiles hunt their targets. Start the simulation, follow the momentum, and watch one core bring the other down.
Play in your browser · Run locally · Development · Deployment
- Hands-off combat: resource collection and weapon firing run automatically.
- Pachinko-style physics: bouncing resources and moving obstacles shape the flow of battle.
- Multiple weapons: cannons, lasers, homing missiles, and mortars attack opposing cores.
- Layered survival: armor, shields, repairs, buffs, and debuffs affect each round.
- Match series: rounds build toward a series winner, with automatic restarts, random character matchups, and round-robin tournament mode.
- Character personality: configurable personas and event-driven banter bring the rivalry to life.
- Audio and statistics: sound effects, a synthesized announcer, music controls, and battle statistics support the action.
The game renders on a 1920 × 1080 logical canvas that scales to fit the available space.
- Open Core Mayhem in a modern browser with JavaScript enabled, then select Start on the welcome screen.
- Watch resources feed the two cores' combat systems. Destroying the opposing core wins a round; round wins decide the series.
Normal play requires no aiming or manual weapon control. Use the header controls while watching:
When a match ends, gameplay freezes during the result banner. Health, collected resources, and final statistics stay fixed; low-health alarms stop. A time-limit tie also shows Game Over in the HUD.
Stopping or ending a match cancels pending weapon windups and burst shots. Starting a new match never resumes a previous match's unfinished volleys.
| Control | Purpose |
|---|---|
| Start / Stop | Start or stop the simulation. |
| Stats | Inspect battle statistics. |
| Audio | Adjust sound and music settings. |
| Banter | Configure dialogue and optional generated responses. |
| Characters | Choose character settings and matchup mode. |
| Help or H | Open the developer hotkey reference. |
Developer hotkeys are enabled in development builds and disabled in production by default. Help and developer shortcuts pause while editing settings or using a dialog. Dialog keyboard focus stays inside the open panel and returns to its opener on close.
Built-in banter works without an AI service. For generated dialogue, the Banter panel supports an optional Ollama connection with a configurable server URL and model. LLM requests are disabled by default; the default server address is http://localhost:11434.
Ollama must be running with an available model, and the browser must be allowed to reach it. Neither Ollama nor a model download is required to play or build the game.
The selected model is saved after refresh and used by both Test and gameplay. Clearing every event checkbox disables generated requests for those events; built-in dialogue remains available. Save, Test, and Refresh accept only HTTP(S) server URLs and apply the numeric limits shown by the controls.
Generated replies belong to the match and settings that requested them. Stop, restart, and settings changes cancel pending replies. Each side keeps its first pending request and ignores additional events until that request finishes.
Both characters may deliver one opening line immediately after Start. Later lines follow the configured pacing. Pacing changes apply during play, and emoji/profanity settings apply to both built-in and generated dialogue. Turning banter off clears its visible bubbles immediately.
Requirements: Git, npm, and Node.js 22.12 or newer in the 22.x line, or Node.js 24+, compatible with the installed Vite and Vitest dependencies.
git clone https://github.com/taggedzi/core-mayhem.git
cd core-mayhem/core-mayhem
npm ci
npm run devOpen the local URL printed by Vite. Run npm commands from the inner core-mayhem/ directory, which contains package.json.
The game is written in TypeScript, rendered with the browser's 2D canvas, and simulated with Matter.js. Vite handles development and production bundling; Vitest runs the test suite.
Run these inside the application directory:
| Command | Purpose |
|---|---|
npm run dev |
Start the development server. |
npm run build |
Compile TypeScript and build the production site in dist/. |
npm run preview |
Serve an existing production build locally. |
npm run typecheck |
Check TypeScript without emitting files. |
npm run lint |
Run ESLint; use npm run lint:fix to apply fixes. |
npm run format |
Check formatting; use npm run format:write to apply it. |
npm test |
Run the test suite once. |
npm run test:watch |
Run tests in watch mode. |
npm run test:coverage |
Run tests with coverage reporting. |
npm run check |
Run type checking, linting, and formatting checks. |
npm run ci |
Run type checking, linting, coverage tests, and the production build. |
npm run sim |
Run batch simulations and write reports to stats/. |
npm run ci does not include formatting; run npm run format separately when validating a contribution. Batch simulations also run as part of the full test suite and can generate timestamped reports.
core-mayhem/ # Repository root
├── README.md
└── core-mayhem/ # Application root; run npm commands here
├── index.html # Page shell and header controls
├── styles.css # Game and overlay styles
├── public/ # Static files copied into the build
├── src/
│ ├── main.ts # Application entry point
│ ├── boot.ts # Game bootstrapping
│ ├── app/ # Lifecycle, game systems, and statistics
│ ├── sim/ # Physics, resources, weapons, and damage
│ ├── core/ # Core repair logic
│ ├── render/ # Canvas rendering and HUD
│ ├── configs/ # Gameplay, world, weapon, and visual tuning
│ ├── config/ # LLM configuration
│ ├── ui/ # Settings panels and overlays
│ ├── audio/ # Audio playback and event configuration
│ ├── announcer/ # Announcer behavior
│ ├── banter/ # Personas, dialogue, and Ollama integration
│ ├── tools/ # Batch simulation harness
│ └── __tests__/ # Unit, flow, rendering, and simulation tests
├── docs/ # Release documentation
├── scripts/ # Development utilities
└── batch.config.json # Batch simulation settings
- Edit
src/configs/for gameplay defaults, arena layout, core behavior, weapons, and effects.src/config.tsre-exports these modules. - Edit
src/audio/config.tsto map audio events to files and adjust playback defaults. - Edit
src/config/llm.tsfor default banter-provider settings. - Edit
batch.config.json, then runnpm run simto compare simulation outcomes. Reports are written under the application'sstats/directory. Batch matches step at a fixed 60 Hz. Theseeddrives arena layout and combat rolls. Avatar jitter, announcer picks, and the starfield stay cosmetic and do not consume that stream.mirrorArena,fullLength, andprimeVolleyaccept JSON booleans. The matching environment variablesMIRROR,FULL_LENGTH, andPRIME_VOLLEYaccepttrueorfalse.
During development, press H to see the available hotkeys. For example, c / l / m / o fire the left core's cannon, laser, missiles, or mortar; uppercase versions fire the right core's weapons. [ and ] adjust simulation speed.
Simulation speed scales Matter physics, spawning, paddles, homing, core rotation, and the banter simulation step once per engine update. Presentation effects, audio, match deadlines, and weapon windup/burst timers use wall-clock time.
See the contribution guide for setup, validation, and pull request instructions. Please follow the Code of Conduct when participating in the project.
Keep changes focused and describe the behavior being changed. Add or update tests when changing simulation behavior, then run npm run ci and npm run format before submitting a pull request.
For bug reports, include the browser, reproduction steps, expected behavior, and console errors. For simulation or balance issues, include the relevant configuration and seed when available.
From the application directory:
npm run build
npm run previewCheck the production preview, then deploy the contents of core-mayhem/dist/ relative to the repository root. The build is a static site and requires no application server for normal gameplay.
| Hosting setting | Value |
|---|---|
| Project / working directory | core-mayhem |
| Install command | npm ci |
| Build command | npm run build |
| Output directory, relative to the working directory | dist |
Vite uses base: './' for relative built asset URLs. Check audio and other runtime-loaded assets when hosting under a subpath. Files in public/ are copied unchanged; public/_headers supplies headers for hosts that support that format.
See the release guide for additional deployment details. The command table above reflects the current package scripts.
Original project code and documentation are licensed under MIT.
Music by Matthew Craig is separately copyrighted, with all rights reserved.
All active combat effects and the alarm are original procedural synthesis
covered by MIT. Regenerate combat effects with npm run audio:generate from
the application directory.
See media licenses and exclusions for file mappings,
modification notices, sources, and redistribution requirements, and
third-party software notices for Matter.js.
The announcer uses 49 bundled robotic voice clips synthesized offline with
eSpeak NG. These original recordings and their generation scripts use MIT.
Run npm run audio:announcer to regenerate them with eSpeak NG installed.
Players do not need eSpeak NG or an online speech service.
The in-game Credits link opens the media notice; code and dependency license
texts ship alongside it in licenses/. Asset folders are excluded by the
root .gitignore; the original generated effects are tracked separately
under src/audio/. No Helton Yan recordings remain in the active game or
production build. The music is not licensed for redistribution by downstream users.
Download the music-free site ZIP from Releases,
extract it, add your own tracks and assets/music/playlist.json, then upload
the site to your host. No rebuild is needed.
To publish a release, commit and push your changes, then run npm run release
inside the inner core-mayhem/ directory. GitHub runs checks, builds the site,
assigns a New York date-based version such as 2026.10.23.1, and publishes the
ZIP. The command waits and prints the download link. GitHub CLI must be signed
in; see the release and deployment guide.
Use npm run build:portable for the same music-free output locally. Ordinary
npm run build still includes your ignored local music for personal deployments.