3.1 KiB
3.1 KiB
AGENTS.md — SlaveMatrixDecomp
Project
Decompilation + modding re-architecture of "Slave Matrix" (Auto Eden). Three .NET 8 projects:
- SlaveMatrix (
WinExe) — game entrypointSlaveMatrix.Program.MainatSlaveMatrix/SlaveMatrix/GameClasses/Program.cs - 2DGAMELIB (class library) — legacy GDI+ rendering engine + core data types (BodyTemplate, ShapePart, etc.)
- SlaveMatrix.Extract (
Exe) — asset pipeline CLI; depends on SlaveMatrix for embedded resources
Build & Run
dotnet build Solution.sln # build all
./run.sh # cd game_folder/ + DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 + dotnet run
dotnet run --project SlaveMatrix.Extract -- --output <path> # asset extraction
Game must run with game_folder/ as working directory. launchSettings.json sets ../game_folder automatically.
Key Quirks
- C# 9.0 (
LangVersionin.csproj). NoImplicitUsingsin SlaveMatrix/2DGAMELIB. Extract hasImplicitUsings=enable+Nullable=enable— it can use modern C#. - x64 only,
AllowUnsafeBlocks=true,InvariantGlobalization=true(required on Linux). - BinaryFormatter for legacy saves:
EnableUnsafeBinaryFormatterSerialization=true,NoWarn=SYSLIB0011. System.Drawing.EnableUnixSupportset at startup (runtimeconfig.template.json+AppContext.SetSwitchinProgram.cs).NoWarn=CA1416suppresses platform-compat warnings across all projects.- Newtonsoft.Json (not
System.Text.Json) in 2DGAMELIB and Extract. - Empty
RootNamespacein SlaveMatrix/2DGAMELIB — types live in global namespace. GenerateAssemblyInfo=false— legacyProperties/AssemblyInfo.cs.global.jsonpins SDK 8.0 withrollForward=latestMajor, allowPrerelease=true.- No test projects, no CI/CD, no formatter/linter config.
- 843 BodyPartClasses (
SlaveMatrix/SlaveMatrix/BodyPartClasses/). Do not rename — C# reflection (Type.GetType) resolves joint type names at runtime.
Architecture
- BodyTemplate (13 binary
Objresources) →VariantGrid→MorphVariant→PartGroup→ShapeParttree (cardinal-spline curves + joint points). Deserialized viaBinaryFormatter+RemappedTypeBinder. - Extract pipeline loads the 13 embedded resources, applies
MigrateKeys()(20-entry runtime KeyMap for Japanese→English lookups), then exports:- Intermediate JSON →
extracted/(gitignored) - SVG + YAML per part →
SlaveMatrix/Assets/Parts/(checked in) Catalog.yaml→SlaveMatrix/Assets/
- Intermediate JSON →
- EnglishNameMap in
SlaveMatrix.Extract/Program.cs(~176 entries) is for extraction output naming only, separate from the runtime KeyMap. - game_folder/ content is copied to build output via
<Content Include="..\game_folder\**\*" CopyToOutputDirectory="PreserveNewest" />. - Phase 0 (extraction) is complete. Phases 1-5 (engine rewrite, Vulkan/Silk.NET) are planned in
PLAN.md.
Git
.gitignoreexcludes:**/bin/,**/obj/,.vs/,.idea/,Config.ini,game_folder/save/*,extracted/.SlaveMatrix/Assets/(auto-generated) is checked in.game_folder/runtime assets are checked in (bgm, text, etc.).