Skip to content

Extracts train/drone/truck routes from a Satisfactory save file

License

Notifications You must be signed in to change notification settings

denxorz/satisfactory-routes

Repository files navigation

Denxorz.Satisfactory.Routes

Build Status NuGet License

A .NET library for parsing and analyzing Satisfactory save files to extract route and station information.

Features

  • Extract the stations for trains, drones, and trucks
  • Extract the routes between stations
  • Extract flow/minute based on naming convention (see)
  • Extract factory type
  • Extract Power circuits
  • Extracts Resources and the amount they are being mined

Installation

dotnet add package Denxorz.Satisfactory.Routes

Usage

Load and parse everything.

using Denxorz.Satisfactory.Routes;

var save = SaveDetails.LoadFromStream(File.OpenRead("MySave.sav"));

foreach (var station in save.Stations)
{
    Console.WriteLine($"Station: {station.Name}");
    foreach (var cargo in station.CargoFlows)
    {
        Console.WriteLine($"\t- Cargo: {cargo.Type} {cargo.FlowPerMinute}");
    }
    foreach (var vehicle in station.Transporters)
    {
        Console.WriteLine($"\t- Vehicle: from {vehicle.From} - to {vehicle.To}");
    }
}

Load and then parse only a part, like factories.

using Denxorz.Satisfactory.Routes;

var save = SaveDetails.LoadObjectsFromStream(File.OpenRead("MySave.sav")); 

foreach (var factory in save.ParseFactories())
{
    Console.WriteLine($"Factory: {factory.Name} running at {factory.PercentageProducing}% with power from circuit: {factory.MainPowerCircuitId}");
}

Naming convention

This library assumes the following naming for stations: Name [in|out ## Type][in|out ## Type] [Name][in|out ## Type][in|out ## Type]

For example:

  • My Station [in 250.2 Rubber]
  • [Other station][out 6 Plastic][out 200 Coal]

Assumptions

The current parser assumes some things. If you need other specs, let me know in an issue.

  • Stations are named based on convention above
  • Trains only unload at one station
  • Trucks only unload at one station
  • A power circuit is named the same as the switch if it is attached to the B side

Tools and Products Used

Versions & Release Notes

  • version 1.7: Add Shard + Sloop + Recipe to Factory
  • version 1.6: Add Resources
  • version 1.5: Add Power circuits
  • version 1.4: Factories now include factories with a unknown production percentage (FactoryPercentageProducing int -> int?)
  • version 1.3: Handle more edge cases + Add .NET 10 support + Seperate load methods
  • version 1.2: Add Factory stats
  • version 1.1: Add Uploaders
  • version 1.0: First version (.NET 8)

About

Extracts train/drone/truck routes from a Satisfactory save file

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages