5.1 KiB
5.1 KiB
Muzika Gromche — AI Agent Guide
Overview
- Purpose: This repository builds a BepInEx plugin (C#) that adds synchronized party music + light effects to Lethal Company, plus a small frontend playground for track metadata and browsing.
- Two main parts: the core plugin in
MuzikaGromche/(targetsnetstandard2.1) and the frontend inFrontend/(Vite 3 + Vue + Vitest). - Tools and helpers: there are some helpful Python scripts in the
playgrounddirectory.
What to edit / hotspots
MuzikaGromche/Plugin.cs: plugin entry and initial configuration registration.MuzikaGromche/*.cs(e.g.PoweredLights.cs,DiscoBallManager.cs,SpawnRateManager.cs,ScreenFiltersManager.cs): main game integration and effect logic.UnityAssets/andMuzikaGromche/bin/...: Unity assets and compiled outputs used for packaging.- Frontend audio/metadata:
Frontend/src/audio/AudioEngine.tsandFrontend/public/*(track lists and audio bundles). - Sources of audio tracks are edited and mixed outside of this repo, and only final deliveries are checked in here.
Build & run (developer workflow)
-
Primary helper:
Justfile(root) andMuzikaGromche.just.user(root, not checked into the repo, so some commands may be unavailable). Common recipes:just build— runs bothbuild-debugandbuild-release(callsdotnet build).just build-release—dotnet build --configuration Release.just build-debug—dotnet build --configuration Debug.just build-debug run— build & run the game for testing, most commonly used combination.just install-imperium— installsdist/MuzikaGromche-Debug.zipinto an r2modman/Imperium profile path (seeJustfileforplugin_dir). Not needed, as it is a post-build step anyway.just ogg <track_name>andjust ogg1 <track_name>— custom msbuild targets that convert wav→ogg viadotnet msbuild /t:wav2ogg(used when adding tracks from outside of this repo).just loud <track_name>— runs a Python script that measures loudness of an audio track in LUFS, useful to calculate volume adjustments for normalization to a consistent desirable level.just oggloud1 <track_name>andjust oggloud <track_name>— convert and measure loudness in one command invocation (single track, and intro+loop pair of tracks respectively).
-
Frontend: in
Frontend/:- Use
pnpm(lockfilepnpm-lock.yamlpresent). Runpnpm install. - Dev:
pnpm run dev(Vite). Build:pnpm run build. - Test:
pnpm run test:browserorpnpm run coverage. Uses Vitest with unified config invite.config.ts.
- Use
-
Python scripts in
playground:- Use
uvtool to run Python code, or correspondingjusttargets if available.
- Use
Packaging and outputs
- Plugin target:
netstandard2.1— compiled DLLs appear underMuzikaGromche/bin/<Configuration>/netstandard2.1/. - The repo expects a
dist/zip for quick install (seeJustfileinstall-imperiumtarget). Look fordist/MuzikaGromche-Debug.zipwhen installing into a profile.
Conventions & patterns
- BepInEx plugin pattern: follow
Plugin.csfor how features are registered and how configuration entries are declared. - Prefer small localized changes: keep public APIs stable and avoid broad refactors across many
*.csfiles without tests. The game integration is timing-sensitive. - Manual testing is done by running the game (see
Justfileruntarget). - Track assets: audio tracks and timings are curated; if you add tracks, use the
just oggordotnet msbuildtasks to convert. Run the game once, so that it dumps a new JSON metadata under the frontendpublic/directory to ensure that data stays in sync.
Integration points & external dependencies
- Game modding: integrates with Lethal Company via BepInEx. The repo assumes you understand how to drop plugin DLLs into r2modman profiles (see
Justfileplugin_dir). - External tools:
dotnet(SDK for building and custom msbuild targets),just(task runner) — commands are invoked from repository root;pnpm/node(frontend) — commands are invoked fromFrontenddirectory.
Examples to reference
- Change visual effects: edit
MuzikaGromche/PoweredLights.csorMuzikaGromche/ScreenFiltersManager.csand test by runningjust build-debug run. - Add frontend metadata: update
Frontend/public/MuzikaGromcheTracks.jsonand runpnpm run build.
What NOT to assume
- There are no automated unit tests in the C# mod; it is unreasonably hard to run mod's code outside of Unity runtime, so don't bother with it. Validate changes with local builds and by installing into an r2modman profile.
- Packaging and profile paths are user-specific —
Justfilecontains a templateplugin_dirthat uses$HOMEandimperium_profilefields; do not hardcode absolute paths in commits.
Where to look next (quick links)
JustfileandMuzikaGromche.just.user— primary developer recipes and packaging helpers.MuzikaGromche/— all plugin source code.UnityAssets/— art/animator resources, treat them as opaque binary blobs.Frontend/— frontend app,src/audio/AudioEngine.tsfor audio logic.