ii.AscendancyLib
1.0.0
dotnet add package ii.AscendancyLib --version 1.0.0
NuGet\Install-Package ii.AscendancyLib -Version 1.0.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.AscendancyLib" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ii.AscendancyLib" Version="1.0.0" />
<PackageReference Include="ii.AscendancyLib" />
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.AscendancyLib --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ii.AscendancyLib, 1.0.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.AscendancyLib@1.0.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.AscendancyLib&version=1.0.0
#tool nuget:?package=ii.AscendancyLib&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
iiAscendancyLib
iiAscendancyLib is a C# library targetting .NET10, supporting the modification of files relating to Ascendancy, the 1995 4X science fiction turn-based strategy computer game. The library supports:
| Name | Read | Write | Comment |
|---|---|---|---|
| COB | ✔ | ✔ | |
| FLC | ➜ | ✗ | Autodesk FLC, see ii.FLC |
| FNT | ✔ | ✔ | |
| RAW | ✔ | ✔ | |
| SAV | ✔ | ✔ | File format is not fully decoded |
| SHP | ✔ | ✔ | |
| WAV | ✔ | ✗ | |
| VOC | ✔ | ✔ |
Usage
Sample code to use the library is provided below.
using ii.AscendancyLib.Reader;
using ii.AscendancyLib.Writer;
using SixLabors.ImageSharp;
var gameDir = @"D:\Games\ascendancy\ASCEND\";
var assetDir = @"D:\data\Ascendancy\";
//----------------------------------------------------------------------
//----------------------------------------------------------------------
Console.WriteLine($"Extracting all files to {assetDir}");
// Open a COB file
var cobFiles = new string[] { "ASCEND00.COB", "ASCEND01.COB", "ASCEND02.COB" };
var cr = new CobReader();
foreach (var cobFile in cobFiles)
{
var file = cr.Read(Path.Combine(gameDir, cobFile));
Console.WriteLine($"{cobFile} contains {file.files.Count} files");
// Save all files to disk
for (int i = 0; i < file.files.Count; i++)
{
var fileName = string.Join("", file.fileNames[i].filename).Split('\0')[0].ToString();
fileName = fileName.StartsWith("\\") ? fileName.Substring(1) : fileName;
fileName = Path.Combine(assetDir, Path.GetFileNameWithoutExtension(cobFile), fileName);
var directory = Path.GetDirectoryName(fileName);
Directory.CreateDirectory(directory);
using var fs = new FileStream(fileName, FileMode.Create, FileAccess.Write);
fs.Write(file.files[i], 0, file.files[i].Length);
fs.Flush(flushToDisk: true);
}
}
// Create a new COB file from the files just extracted
Console.WriteLine($"Repacing ASCEND00.COB into 00COPY.COB");
var cobWriter = new CobWriter();
cobWriter.Write(Path.Combine(assetDir, "00COPY.COB"), Path.Combine(assetDir, "ASCEND00"), Path.Combine(assetDir, "ASCEND00\\"), "*.*");
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Convert a VOC to a WAV
Console.WriteLine($"Converting VOC to WAV");
var vocReader = new VocReader();
var convertedVoc = vocReader.Read(Path.Combine(assetDir, "ASCEND01", "data", "blueexit.voc"), true);
// Convert a RAW to a WAV
Console.WriteLine($"Converting RAW to WAV");
var rawReader = new RawReader();
var convertedRaw = rawReader.Read(Path.Combine(assetDir, "ASCEND01", "data", "shield.voc"));
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Convert all SHP files
Console.WriteLine($"Converting all SHP files in ASCEND01.COB and saving the first frame");
var shpReader = new ShpReader();
List<string> shps = new List<string>(Directory.EnumerateFiles(Path.Combine(assetDir, "ASCEND01", "data"), "*.shp"));
foreach (var shp in shps)
{
var shpFile = shpReader.Read(shp);
shpFile.Images.First().SaveAsJpeg(Path.Combine(assetDir, "ASCEND01", $"{Path.GetFileNameWithoutExtension(shp)}.bmp"));
}
//----------------------------------------------------------------------
//----------------------------------------------------------------------
Console.WriteLine($"Loading resume.gam");
var savReader = new SavReader();
var savegame = savReader.Read(Path.Combine(gameDir, "resume.gam"));
Console.WriteLine($"Saving resume.new");
var savWriter = new SavWriter();
savWriter.Write(Path.Combine(assetDir, "resume.new"), savegame);
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/iiAscendancyLib
# Go into the repository
$ cd src
# Build the app
$ dotnet build
Licencing
iiAscendancyLib is licenced under the MIT License. Full licence details are available in licence.md
| Product | Versions 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.
-
net10.0
- SixLabors.ImageSharp (>= 3.1.12)
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 |
|---|---|---|
| 1.0.0 | 95 | 4/26/2026 |
| 0.7.7-alpha.2 | 427 | 12/9/2025 |
| 0.7.7-alpha.1 | 175 | 5/20/2025 |
| 0.7.0-alpha.1 | 152 | 3/27/2025 |