MaiScoreCalc 0.1.0

dotnet add package MaiScoreCalc --version 0.1.0
                    
NuGet\Install-Package MaiScoreCalc -Version 0.1.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="MaiScoreCalc" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MaiScoreCalc" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="MaiScoreCalc" />
                    
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 MaiScoreCalc --version 0.1.0
                    
#r "nuget: MaiScoreCalc, 0.1.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 MaiScoreCalc@0.1.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=MaiScoreCalc&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=MaiScoreCalc&version=0.1.0
                    
Install as a Cake Tool

MaiScoreCalc

MaiScoreCalc is a small SDK for calculating:

  • theoretical score from chart note counts
  • theoretical DX score from chart note counts
  • approximate score and DX score from a target achievement value

The scoring tables in this package are based on the reversed game logic already referenced in this repository.

Install

dotnet add package MaiScoreCalc

Quick Start

using MaiScoreCalc;

var notes = new[] { 320, 1, 3, 2 }; // tap, hold, slide, break

var theory = MaiScoring.GetTheoryFromNotes(notes);

Console.WriteLine(theory.TheoreticalScore);   // 170700
Console.WriteLine(theory.TheoreticalDxScore); // 978
Console.WriteLine(theory.MaxAchievement);     // 101.0

Supported Note Counts

Legacy 4-value format:

var notes = new[] { tap, hold, slide, breakCount };

Extended format:

var counts = new ChartNoteCounts(
    Tap: 320,
    Hold: 1,
    Slide: 3,
    Break: 2,
    TouchTap: 0,
    TouchHold: 0);

Scoring behavior:

  • TouchTap uses the same score table as Tap
  • TouchHold uses the same score table as Hold
  • Break includes both normal score and break bonus score

API

1. Generate theoretical score and DX score from notes

var theory = MaiScoring.GetTheoryFromNotes(320, 1, 3, 2);

or

var theory = MaiScoring.GetTheoryFromNotes(new[] { 320, 1, 3, 2 });

or

var theory = MaiScoring.GetTheoryFromNotes(counts);

Returns TheoryProjection:

theory.TheoreticalScore
theory.TheoreticalDxScore
theory.AllPerfectScore
theory.BreakBonusScore
theory.MaxAchievement

2. Estimate close score and DX score from achievement

var estimate = MaiScoring.EstimateFromAchievement(new[] { 320, 1, 3, 2 }, 98.2747m);

or

var estimate = MaiScoring.EstimateFromAchievement(counts, 98.2747m);

Returns AchievementEstimate:

estimate.TargetAchievement
estimate.EstimatedAchievement
estimate.EstimatedScore
estimate.EstimatedDxScore
estimate.EstimatedNormalScore
estimate.EstimatedBreakBonusScore
estimate.TheoreticalScore
estimate.TheoreticalDxScore

Important:

  • this method is an approximation
  • achievement alone cannot uniquely reconstruct the original judge distribution
  • the returned score and DX score are intended to be close and stable, not exact replay reconstruction

Full Calculation API

If you already have per-note judge results, use:

var result = MaiScoring.Calculate(counts, judgedNotes);

Example:

var judgedNotes = new List<JudgedNote>
{
    new(ScoreNoteType.Tap, JudgeTiming.Critical),
    new(ScoreNoteType.Hold, JudgeTiming.FastPerfect),
    new(ScoreNoteType.Break, JudgeTiming.FastGreat),
};

var result = MaiScoring.Calculate(counts, judgedNotes);

Pack For NuGet

Create the package:

dotnet pack -c Release

The generated package will be in:

bin/Release

Usually you will get:

  • MaiScoreCalc.0.1.0.nupkg
  • MaiScoreCalc.0.1.0.snupkg

Push To NuGet

Push the main package:

dotnet nuget push bin/Release/MaiScoreCalc.0.1.0.nupkg --api-key YOUR_NUGET_API_KEY --source https://api.nuget.org/v3/index.json

Optional symbol package:

dotnet nuget push bin/Release/MaiScoreCalc.0.1.0.snupkg --api-key YOUR_NUGET_API_KEY --source https://api.nuget.org/v3/index.json

Versioning

Update the version in MaiScoreCalc.csproj before packing:

<Version>0.1.0</Version>

Suggested rules:

  • bug fix: 0.1.1
  • backward-compatible feature: 0.2.0
  • breaking change: 1.0.0

Notes

  • current target framework is net9.0
  • if you want broader NuGet compatibility, consider changing to netstandard2.0, net8.0, or multi-targeting
  • if you want, this repository can also be split into:
    • SDK library project
    • sample console project
    • test project
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.
  • net9.0

    • No dependencies.

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.1.0 151 4/3/2026