Giter Club home page Giter Club logo

mutagen's Introduction

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.

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 mod = OblivionMod.CreateFromBinaryOverlay(pathToMod);
foreach (var editorId in mod.Potions.Records
    .Select(potion => potion.EditorID)
    .Distinct()
    .Where(s => !string.IsNullOrWhiteSpace(s)))
{
    System.Console.WriteLine(editorId);
}

This example snippet would print a mod's unique Potion EditorIDs to the console.

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

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.

Example Project

Another option is the Mutagen Bootcamp project. It contains a good number of example tasks which you can run after pointing it to your copy of Skyrim. It should be a good starter to help you understand the basics and actually see some of the processing in action.

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.

mutagen's People

Contributors

noggog avatar deigue avatar mrudat avatar erri120 avatar effelo avatar ghos71y avatar stevetownsend avatar halgari avatar focustense avatar

Stargazers

 avatar Scorpio SixNine avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.