BAGatchaCompare is a small Bun + TypeScript simulator for comparing two Blue Archive-style gacha systems:
oldGatcha: the existing ceiling-point system.newGatcha: an alternative system where pickup acquisition can reset the internal ceiling point.
The main question is whether the new system is actually better when leftover ceiling-point value is included, not just the raw number of pulls needed to reach the target pickup characters.
This project compares oldGatcha and newGatcha through Monte Carlo simulation. It measures both pull-count behavior and effective pickup value, where leftover ceiling points are converted into fractional pickup value:
effectivePickedChars = pickedChars + roofPoint / 200This makes it possible to compare not only "how many pulls were needed", but also "how much value remained after the run".
src/BAGatcha.ts: definesoldGatchaandnewGatcha.src/Simulator.ts: runs reusable simulations, calculates summary statistics, and creates JSON reports for plotting.src/index.ts: compares both systems and prints a JSON report.docs/compare_main.png: visualization of the comparison.
The JSON report is designed for LLM analysis and matplotlib.pyplot plotting. It includes:
- distribution graph data:
bins,counts,percentages,normalExpectedCounts,normalExpectedPercentages averagestandardDeviationaverageEffectivePickedCharsstandardDeviationEffectivePickedChars
bun install
bun src/index.tsTo save the report:
bun src/index.ts --format json > output.jsonUse --format cli for the human-readable terminal chart and --format json for LLM or pyplot analysis. Other useful options are --count, --pickup, --bin-size, and --width.
import json
import matplotlib.pyplot as plt
with open("output.json", encoding="utf-8") as f:
report = json.load(f)
for series in report["series"]:
distribution = series["distribution"]
plt.plot(
distribution["bins"],
distribution["percentages"],
label=series["label"],
)
plt.xlabel("Gacha count")
plt.ylabel("Percentage (%)")
plt.legend()
plt.show()이 프로젝트는 몬테카를로 시뮬레이션으로 oldGatcha와 newGatcha를 비교합니다. 단순히 목표 픽업을 얻기까지 필요한 뽑기 수만 보는 것이 아니라, 남은 천장 포인트의 가치까지 포함해 비교합니다.
천장 포인트 가치는 다음처럼 계산합니다.
effectivePickedChars = pickedChars + roofPoint / 200즉, pickedChars는 실제로 얻은 픽업 수이고 roofPoint / 200은 남은 천장 포인트를 픽업 캐릭터 가치로 환산한 값입니다.
src/BAGatcha.ts:oldGatcha,newGatcha로직을 정의합니다.src/Simulator.ts: 공용 시뮬레이션, 통계 계산, pyplot용 JSON 리포트 생성을 담당합니다.src/index.ts: 두 가챠 시스템을 실행하고 비교 JSON을 출력합니다.docs/compare_main.png: 비교 결과 시각화 자료입니다.
출력 JSON은 LLM 분석과 matplotlib.pyplot 시각화에 쓰기 좋은 형태입니다. 포함되는 주요 값은 다음과 같습니다.
- 분포 그래프 데이터:
bins,counts,percentages,normalExpectedCounts,normalExpectedPercentages averagestandardDeviationaverageEffectivePickedCharsstandardDeviationEffectivePickedChars
bun install
bun src/index.ts리포트를 파일로 저장하려면:
bun src/index.ts --format json > output.json사람이 읽는 터미널 차트는 --format cli, LLM 또는 pyplot 분석용 JSON은 --format json을 사용합니다. --count, --pickup, --bin-size, --width 옵션도 사용할 수 있습니다.
import json
import matplotlib.pyplot as plt
with open("output.json", encoding="utf-8") as f:
report = json.load(f)
for series in report["series"]:
distribution = series["distribution"]
plt.plot(
distribution["bins"],
distribution["percentages"],
label=series["label"],
)
plt.xlabel("Gacha count")
plt.ylabel("Percentage (%)")
plt.legend()
plt.show()このプロジェクトは、モンテカルロシミュレーションで oldGatcha と newGatcha を比較します。目標ピックアップを獲得するまでのガチャ回数だけでなく、残った天井ポイントの価値も含めて評価します。
天井ポイントの価値は次のように計算します。
effectivePickedChars = pickedChars + roofPoint / 200つまり、pickedChars は実際に獲得したピックアップ数で、roofPoint / 200 は残った天井ポイントをピックアップキャラクター価値に換算したものです。
src/BAGatcha.ts:oldGatchaとnewGatchaのロジックを定義します。src/Simulator.ts: 汎用シミュレーション、統計計算、pyplot 向け JSON レポート生成を行います。src/index.ts: 2つのガチャシステムを実行し、比較用 JSON を出力します。docs/compare_main.png: 比較結果の可視化画像です。
出力 JSON は LLM による分析や matplotlib.pyplot での可視化に使いやすい形式です。主な項目は次の通りです。
- 分布グラフ用データ:
bins,counts,percentages,normalExpectedCounts,normalExpectedPercentages averagestandardDeviationaverageEffectivePickedCharsstandardDeviationEffectivePickedChars
bun install
bun src/index.tsレポートをファイルに保存する場合:
bun src/index.ts --format json > output.json人間が読むためのターミナル表示には --format cli、LLM や pyplot で分析する JSON には --format json を使います。--count, --pickup, --bin-size, --width も指定できます。
import json
import matplotlib.pyplot as plt
with open("output.json", encoding="utf-8") as f:
report = json.load(f)
for series in report["series"]:
distribution = series["distribution"]
plt.plot(
distribution["bins"],
distribution["percentages"],
label=series["label"],
)
plt.xlabel("Gacha count")
plt.ylabel("Percentage (%)")
plt.legend()
plt.show()
