Below is a battle-tested way to start a desktop modding kit that stays maintainable as it grows.
It is split into two parts:
- A high-level project outline (what to build first, what later).
- A clean, layered code structure that keeps file I/O, UI, and rendering isolated.
You can literally copy the folder names into your solution and start dropping code into them.
────────────────────────────────────────
- Project Road-Map (Milestones)
────────────────────────────────────────
M0 Bootstrap (1–2 days)
• Empty .NET 6/7 project, Veldrid + ImGui.Net packages, “Hello ImGui” window.
• Build script that copies native ImGui/Veldrid binaries next to the exe.
M1 File System Mirror (2–3 days)
• Scan the game’s data folder once at start-up.
• Build an in-memory tree of relative paths + file type tags (mesh, texture, map).
• Show the tree in a left-dock window (ImGui::BeginChild).
• Double-click → open a placeholder tab that just prints the file name.
M2 Core Loaders (1 week)
• Move your existing parsers into a new project “RFG.Formats”.
• Expose one synchronous interface per asset type:
ITexture LoadTexture(Stream s);
IMesh LoadMesh(Stream s);
IMap LoadMap(Stream s);
• Add a tiny “AssetCache” (Dictionary<Guid, object>) so the same file is never parsed twice.
M3 Viewers (1–2 weeks)
• TextureViewer: ImGui::Image + zoom/alpha checkerboard.
• MeshViewer: Veldrid pipeline, arc-ball camera, wireframe toggle.
• MapViewer: simple AABB renderer + list of objects.
• Each viewer is a class that implements IAssetViewer and lives in RFGLab.Viewers.
M4 Import / Export (1 week)
• Menu bar: File → Import… (fbx, png, tga, etc.)
• Convert to RFG formats using the same ITexture/IMesh/IMap interfaces but in reverse.
• Add a “Dirty” flag per asset; File → Export writes back only the dirty ones.
M5 Project System (optional but powerful)
• A .rfgproj file that stores:
– Root game folder path (machine-specific)
– List of overridden files (relative path → temp edited copy)
– Export profile (Steam workshop, raw patch, etc.)
• Lets users save their work and reopen it later.
M6 Polish & Extensibility
• Plug-in folder: drop a new DLL that exports IAssetViewer or IImporter.
• Settings window (game path, renderer backend, keybinds).
• Undo/redo stack for map editing.
────────────────────────────────────────
2. Layered Code Structure
────────────────────────────────────────
Solution: RFG.ModKit.sln
┌─ RFG.Formats (netstandard2.1)
│ Pure parsers, no UI, no Veldrid.
│ • MeshReader.cs, TextureReader.cs, MapReader.cs
│ • DTOs: MeshData, TextureData, MapData
│ • Optional: tiny unit-test project RFG.Formats.Tests
┌─ RFG.IO (netstandard2.1)
│ • GameFileSystem – scans game folder, gives IFileEntry objects.
│ • ImportPipeline – converts external formats → RFG.Formats DTOs.
│ • ExportPipeline – converts DTOs → game formats.
│ • AssetCache.cs – in-memory store + ref-counting.
┌─ RFGLab.Core (net6.0)
│ • Application.cs – owns Veldrid.GraphicsDevice, ImGui controller, main loop.
│ • DockspaceLayout.cs – central docking setup (ImGui Dockspace over entire window).
│ • Settings.cs – JSON file on disk.
┌─ RFGLab.UI (net6.0)
│ • MainMenuBar.cs – File, View, Tools menus.
│ • FileExplorer.cs – tree view, search box, context menus.
│ • TabManager.cs – keeps list of open tabs, each tab = IAssetViewer.
│ • Widgets – reusable ImGui helpers (drag-drop, file picker, etc.).
┌─ RFGLab.Viewers (net6.0)
│ • TextureViewer.cs : IAssetViewer
│ • MeshViewer.cs : IAssetViewer
│ • MapViewer.cs : IAssetViewer
│ • ViewerFactory.cs – maps file extension → viewer type.
┌─ RFGLab.Plugins (optional folder)
│ • ExampleImporter.cs : IImporter
│ • ExampleViewer.cs : IAssetViewer
│ Loaded via MEF or Reflection at start-up.
┌─ RFGLab (net6.0, EXE)
│ Program.cs → new Application().Run();
────────────────────────────────────────
3. Day-Zero Checklist
────────────────────────────────────────
[ ] Create the folder structure above.
[ ] Add Veldrid.StartupUtilities + ImGui.Net packages to RFGLab.Core.
[ ] Commit a .gitignore that ignores build/, *.user, and the entire game data folder.
[ ] Write a one-page README: “How to build & point the tool at your RFG install”.
[ ] Push to GitHub/GitLab so you have incremental backups.
Start with M0 → M1 → M2 in that order; you’ll have something runnable and motivating in the first week.