Skip to content

Commit a83b772

Browse files
committed
Update to new capturing radiance hypotheses, add standard 5*
1 parent 6d50999 commit a83b772

1 file changed

Lines changed: 56 additions & 14 deletions

File tree

pages/tools/gachacalc.tsx

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function pityRate(
4343
const gachas: Record<string, Banner> = {
4444
char: {
4545
bannerName: "5* banner character [Genshin Impact (5.0+, hypothese A)]",
46-
banner: [0.5, 0.5, 0.75, 1],
46+
banner: [0.5, 0.5, 0.55, 1],
4747
guaranteed: 1,
4848
canGuarantee: true,
4949
minConst: -1,
@@ -126,6 +126,18 @@ const gachas: Record<string, Banner> = {
126126
maxPity: 10,
127127
rate: pityRate(5.1, Math.ceil(44 / 5.1)),
128128
},
129+
"5*charOffBannerStandard": {
130+
bannerName: "Specific 5* character/weapon on Standard Banner [Genshin Impact] [INACCURATE: see note!]",
131+
banner: 0.5,
132+
guaranteed: 1 / 0, // This needs to be filled in by user!
133+
canGuarantee: false, // STANDARD BANNER HAS DIFFERENT PITY SYSTEM FOR KEEPING 50/50
134+
minConst: -1,
135+
maxConst: 6,
136+
constFormat: "C",
137+
constName: "Constellation",
138+
maxPity: 90,
139+
rate: pityRate(0.6, Math.ceil(44 / 0.6)),
140+
},
129141
charOld: {
130142
bannerName: "5* banner [Genshin Impact (Chronicled Wish / Character before 5.0)]",
131143
banner: 0.5,
@@ -534,7 +546,7 @@ export default function GachaCalc({ location, fourStarCount }: Props & { locatio
534546
</p>
535547
<p className="pt-2">
536548
Exact details of &apos;Capturing Radiance&apos; are not yet known.
537-
Hypothese A assumes a lost pity model where rate goes from 50%/50%, to 50%/50% to 75%/25% to 100%/0% and resets when you win the 50/50.
549+
Hypothese A assumes a lost pity model where a counter increases when you lose the 50/50 and decreases when you win the 50/50. If this counter reaches 2, there&apos;s an (unknown, assumed to be a 55/45) rate to win. When the counter reaches 3, triggering capturing radiance is guaranteed. When capturing radiance is triggered, the counter is reset to 1.
538550
The other version assumes a flat consolidated rate of 55% mentioned in the <a href="https://www.hoyolab.com/article/32168979">HoYoLAB article</a> which is what you can expect in the long term.
539551
</p>
540552

@@ -547,7 +559,7 @@ export default function GachaCalc({ location, fourStarCount }: Props & { locatio
547559
</p>
548560
<p className="pt-2">
549561
<i>
550-
<b>NOTE</b>: The 4* off-banner calculator is <b>not</b> accurate for the standard banner. In-game there&apos;s a pity system for keeping amount of 4* weapons and characters balanced. Here we assume a flat 50/50 rate between characters and weapons.
562+
<b>NOTE</b>: The off-banner calculator is <b>not</b> accurate for the standard banner. In-game there&apos;s a pity system for keeping amount of weapons and characters balanced. Here we assume a flat 50/50 rate between characters and weapons.
551563
</i>
552564
</p>
553565
</Main>
@@ -680,7 +692,7 @@ function GachaTargetInput({
680692
options={Object.values(gachas).map((g) => g.bannerName)}
681693
/>
682694
{!Number.isFinite(banner.guaranteed) && (
683-
<NumberInput label="Available 4* star count in banner" set={setGuaranteedRate} value={guaranteedRate} min={0} max={banner.guaranteed}/>
695+
<NumberInput label="Available targets in banner (eg. amount of possible 4* or 5* characters/weapons)" set={setGuaranteedRate} value={guaranteedRate} min={0} max={banner.guaranteed}/>
684696
)}
685697
<NumberInput label={`Current ${banner.constName.toLowerCase()}`} set={setCurrent} value={current} min={banner.minConst} max={target - 1}/>
686698
<NumberInput label={`Target ${banner.constName.toLowerCase()}`} set={setTarget} value={target} min={current + 1} max={banner.maxConst}/>
@@ -947,6 +959,7 @@ function calcSimsExact<T>(
947959
let rate = banner.rate(currentPity) / 100
948960
if (rate > 1) rate = 1
949961
else if (rate < 0) rate = 0
962+
const hasLostPity = Array.isArray(banner.banner)
950963
const bannerRate = (
951964
(sim.guaranteed ||
952965
(banner.guaranteedPity && sim.guaranteedPity >= banner.guaranteedPity - 1)) && banner.canGuarantee
@@ -967,16 +980,45 @@ function calcSimsExact<T>(
967980

968981
const bannerGuaranteedRate = Number.isFinite(banner.guaranteed) ? banner.guaranteed : (1 / gachaTarget.guaranteedRate)
969982
// Got wanted banner item
970-
addOrMerge({
971-
gachaTargetIndex: sim.gachaTargetIndex,
972-
gachaTarget: sim.gachaTarget,
973-
pity: 0,
974-
guaranteed: false,
975-
guaranteedPity: 0,
976-
lostPity: sim.guaranteed ? sim.lostPity : 0, // Keep lost pity if it was guaranteed, otherwise we won 50/50
977-
const: sim.const + 1,
978-
rate: sim.rate * rate * bannerRate * bannerGuaranteedRate,
979-
})
983+
if (sim.guaranteed)
984+
addOrMerge({
985+
gachaTargetIndex: sim.gachaTargetIndex,
986+
gachaTarget: sim.gachaTarget,
987+
pity: 0,
988+
guaranteed: false,
989+
guaranteedPity: 0,
990+
lostPity: sim.lostPity, // Keep lost pity if it was guaranteed
991+
const: sim.const + 1,
992+
rate: sim.rate * rate * bannerRate * bannerGuaranteedRate,
993+
})
994+
else {
995+
const bannerBaseRate = Array.isArray(banner.banner) ? banner.banner[0] : banner.banner
996+
const subtractRate = bannerRate == 1 ? 0 // Guaranteed to trigger at max counter
997+
: bannerBaseRate // tbf, at counter = 2, the subtract and reset to 1 result in the same entry
998+
999+
addOrMerge({
1000+
gachaTargetIndex: sim.gachaTargetIndex,
1001+
gachaTarget: sim.gachaTarget,
1002+
pity: 0,
1003+
guaranteed: false,
1004+
guaranteedPity: 0,
1005+
lostPity: Math.max(0, sim.lostPity - 1), // Otherwise we won 50/50 and decrease with -1
1006+
const: sim.const + 1,
1007+
rate: sim.rate * rate * subtractRate * bannerGuaranteedRate, // Just regular base rate
1008+
})
1009+
1010+
if (bannerRate - subtractRate > 0)
1011+
addOrMerge({
1012+
gachaTargetIndex: sim.gachaTargetIndex,
1013+
gachaTarget: sim.gachaTarget,
1014+
pity: 0,
1015+
guaranteed: false,
1016+
guaranteedPity: 0,
1017+
lostPity: 1, // Resets to 1
1018+
const: sim.const + 1,
1019+
rate: sim.rate * rate * (bannerRate - subtractRate) * bannerGuaranteedRate, // We triggered lost pity
1020+
})
1021+
}
9801022

9811023
// Got banner item but not wanted (eg. wrong rate up 4* char/5* char)
9821024
if (bannerGuaranteedRate < 1)

0 commit comments

Comments
 (0)