Skip to content

A .NET library for analyzing, creating, and manipulating Bethesda mods

License

Notifications You must be signed in to change notification settings

some1one/Mutagen

This branch is 150 commits behind Mutagen-Modding/Mutagen:dev.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Nov 8, 2024
8136856 · Nov 8, 2024
Oct 14, 2024
Oct 27, 2024
Oct 2, 2024
Nov 6, 2024
Jul 22, 2024
Oct 21, 2024
Nov 8, 2024
Jul 22, 2024
Jul 22, 2024
Aug 24, 2024
Jul 22, 2024
Sep 21, 2024
Jul 22, 2024
Jul 22, 2024
Oct 12, 2024
Jul 23, 2024
Jul 22, 2024
Jul 22, 2024
Oct 14, 2024
Oct 13, 2024
Sep 28, 2024
Oct 14, 2024
Nov 2, 2024
Jul 29, 2024
Jul 22, 2024
Oct 12, 2024
Aug 24, 2024
Nov 6, 2024
Sep 18, 2024
May 7, 2024
Oct 14, 2024
Aug 16, 2023
Nov 8, 2024
May 10, 2020
May 7, 2023
Jun 16, 2024
Apr 14, 2022
Mar 5, 2022
Mar 11, 2022
Sep 1, 2023
Sep 1, 2023
Apr 15, 2024
Mar 24, 2021
Oct 28, 2024
Nov 6, 2024

Repository files navigation

Release Dev NuGet Stats

Discord

Mutagen

Mutagen is a C# library for analyzing, modifying, and creating Bethesda mods. One of its main features is offering interfaces and classes for the records that exist at compile time and are first class citizens in C#. With actual members for each field they get the benefits of type safety, simple live debugging, Intellisense features such as autocomplete. The interfaces offer clean API to the user and abstract away much of the binary record specifics and oddities of how they are stored on disk, while the actual implementation remains very closely tied to the data offering as much speed as it can by leveraging some of the latest C# features. Most of the public facing API is created by code generation, with small manual snippets of code for the one-off special cases. This means the library is able to provide consistent API with very little manual work when adding new record definitions or features.

Documentation

Check out the Documentation Official Documentation for more detailed explainations of Mutagen's API, and more typical use cases and examples.

Also be sure to check out the Big Cheat Sheet

Goals

What is Mutagen trying to provide?

  • Ability to analyze, create, or manipulate esp/esm mod files for Bethesda games in C#.
  • Strongly typed objects and fields for all records, which naturally offer Intellisense and type safety.
  • User abstraction from complex binary record structures/patterns, when appropriate and beneficial.
  • Frameworks for accomplishing common tasks, such as Patchers
  • Performance via intelligent short circuiting of work and minimal internal layers underneath the API.
  • Heavy use of generated code to provide the above goals without requiring verbose manual development or maintenance.
  • Powerful but gritty low level tools for those that want to forgo the autogenerated classes for special tasks.
  • Other tooling related to Bethesda modding in C#

Sample API

using var env = GameEnvironment.Typical.Skyrim(SkyrimRelease.SkyrimSE);
foreach (var weaponEditorId in env.LoadOrder.PriorityOrder.Weapon().WinningOverrides()
    .Select(weap => weap.EditorID)
    .Where(x => !x.IsNullOrWhitespace())
    .Distinct())
{
    System.Console.WriteLine(weaponEditorId);
}

This example snippet would print all the unique Weapon EditorIDs from the load order to the console.

Seeing Mutagen in Action

Synthesis

Synthesis is a patcher pipeline built on top of Mutagen, and it already has a large library of example patchers to study and get inspiration from.

Installing Mutagen

Mutagen can be added to your C# project via NuGet, under the package name Mutagen.Bethesda. Search for it in Visual Studio, or find it here.

If you're unfamiliar with setting up C# projects in general, a good place to start might be creating a simple Synthesis patcher, and be sure to ask questions on our Discord.

About

A .NET library for analyzing, creating, and manipulating Bethesda mods

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%