ii.AirplaneDwarf 0.3.0

dotnet add package ii.AirplaneDwarf --version 0.3.0
                    
NuGet\Install-Package ii.AirplaneDwarf -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ii.AirplaneDwarf" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ii.AirplaneDwarf" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="ii.AirplaneDwarf" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ii.AirplaneDwarf --version 0.3.0
                    
#r "nuget: ii.AirplaneDwarf, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ii.AirplaneDwarf@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ii.AirplaneDwarf&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=ii.AirplaneDwarf&version=0.3.0
                    
Install as a Cake Tool

iiAirplaneDwarf

iiAirplaneDwarf is a C# library supporting the modification of files relating to Submarine Titans, the 2000 RTS game developed by Ellipse Studios.

Name Read Write Comment
3DX
ANY
AOBJ
BIN
BMP Standard bitmap
DAR
DFN Plain text (AI script defines)
DKD Archive data
DKX Archive index
FNT Font metadata
IMT UI grouping
MCR Plain text (AI macro)
MSK UI mask
PIC Terrain textures
RSPR Sprite animation grouping
SAR String table
SMF Plain text
SPR Sprite animation
SSPR Sprite grouping
TMAP
TMSK Sprite mask
TSPR Cursor animation table
TXT Plain text (AI macro)
WAV Plain text (tech level definitions)

Usage

var processor = new DkxProcessor();
foreach (var archive in archives)
{
    if (!File.Exists(archive))
    {
        Console.WriteLine($"skip missing {archive}");
        continue;
    }

    Console.WriteLine($"Reading {archive}");

    var dkdPath = Path.ChangeExtension(archive, "dkd");

    var entries = processor.Read(archive, dkdPath);
    var dest = Path.Combine(outRoot, Path.GetFileNameWithoutExtension(archive));
    Directory.CreateDirectory(dest);

    var written = 0;
    foreach (var entry in entries)
    {
        var payload = entry.Data;
        if (payload == null || payload.Length == 0)
        {
            continue;
        }

        var safe = string.Join("_", entry.Filename.Split(Path.GetInvalidFileNameChars()));
        var path = Path.Combine(dest, $"{safe}.{entry.Extension}");
        if (File.Exists(path))
        {
            path = Path.Combine(dest, $"{safe}_{entry.Type}.{entry.Extension}");
        }

        File.WriteAllBytes(path, payload);
        written++;
    }

    var types = entries.GroupBy(e => e.TypeName).OrderBy(g => g.Key);
    Console.WriteLine($"  {entries.Count} entries, wrote {written} files -> {dest}");
    Console.WriteLine("  " + string.Join(", ", types.Select(g => $"{g.Key}:{g.Count()}")));


    var pic = new PicProcessor();
    
    // Tile texture
    var palette = PicProcessor.LoadPaletteFromBmp(@"PALETTE.bmp");
    using var tile = pic.Read(File.ReadAllBytes(@"MAPTXTR001.pic"), palette);
    tile.SaveAsPng("tile.png");

    // Fog overlay (pass DKX width/height; optional plane 0..15)
    using var fog = pic.Read(dark0Bytes, palette, width: 66, height: 47, plane: 0);

    var tspr = new TsprProcessor();
    var names = tspr.Read(File.ReadAllBytes(@"CUR_CONFIRM.tspr"));
    var spr = new SprProcessor();
    var palette = SprProcessor.LoadPaletteFromBmp(@"CURSOR_PAL.bmp");
    foreach (var name in names)
    {
        var frames = spr.Read(File.ReadAllBytes($@"{name}.spr"), palette);
        // ...
    }

    var tmsk = new TmskProcessor();
    // Width/height from DKX (defaults 32×32)
    var masks = tmsk.Read(@"aven.tmsk");
    masks[0].SaveAsPng("aven_mask0.png");
    
    // Full-resolution mask (e.g. trmmine)
    var full = tmsk.Read(@"trmmine.tmsk", width: 180, height: 140);


    var sar = new SarProcessor();
    var table = sar.Read(@"SND_201.sar");
    foreach (var entry in table.Entries)
    {
        Console.WriteLine($"{entry.Index}: {entry.Value}");
    }

    var fnt = new FntProcessor();
    var font = fnt.Read(@"SYS_FONT.fnt");
    var glyph = font.FindGlyph('A');
    // glyph.Width, glyph.Height, glyph.AtlasOffset
}

Compiling

To clone and run this application, you'll need Git and .NET installed on your computer. From your command line:

# Clone this repository
$ git clone https://github.com/btigi/iiAirplaneDwarf

# Go into the repository
$ cd src

# Build  the app
$ dotnet build

Licencing

iiAirplaneDwarf is licenced under the MIT License. Full licence details are available in licence.md

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 128 7/15/2026