- Book Of Hours specific redeems only work when I'm live on Twitch playing Book Of Hours
- Users can only use the redeems on Twitch
- Redeem usage is limited to 1 use per redeem per user per stream, 10 uses per redeem for the total audience each stream, to keep things balanced
## Redeem Pricing
Redeem pricing may seem random, it's not! Basically:
- By default, Obsidian shows my notes, within a folder, in alphabetical order
- The notes for each redeem are paired, Birds of a Feather vs. Worms of a Scale for each title, e.g. "Grocery Delivery vs. Pantry Raid" where Birds of a Feather's redeem is Grocery Delivery and Worms of a Scale's redeem is Pantry Raid.
- I want the Obsidian redeems list to be in 1:1 order with the order they appear on Twitch
How do you make channel point redeems show up in a specific order on Twitch? They're ordered by their price, so that's why the prices go from 500 up, to make them show up in a specific order, so each redeem is near its twin.
## Redeem Availability/Unavailablity
Redeems are made available/unavailable based on how much of Hush House is unlocked in a given Book Of Hours run (not that individual stream, but the run as a whole,) as well as various in-game states
- For instance, if I don't have a penny to lose for "Leave A Penny" you cannot give me a penny with "Take A Penny" and both redeems are made unavailable
Redeem states are checked every few seconds, which means in theory, you could try to use a redeem that shouldn't be usable if you catch it during that window
- Let's say I have 0 pennies and you try to use the "Leave A Penny redeem" in the window of time *before* the redeem state is updated to reflect that it shouldn't be usable
- The redeem won't work and you'll be refunded your channel points
## Tech Stack
- The redeems are wired up in StreamerBot with a BepInEx mod for Book Of Hours called Havoc House. It's not a public mod.
- Some of the redeems are wired up to the Twitch Integrated Throwing System
# The math behind destruction-based redeems:
tl;dr weighted random sampling with renormalization and conditional probabilities
- Game mod gets a list of eligible items to be destroyed because the game has to have an item to destroy for a redeem to work.
- Game mod rolls which tier of item gets deleted. If I had at least one item of every rarity tier, the spread would look like this:
- Common: 64% rate (a little less than a 2 in 3 chance if at least one item of each rarity tier is present)
- Uncommon: 30% rate (a little less than a 1 in 3 chance if at least one item of each rarity tier is present)
- Rare: 5% rate (1 in 20 chance if at least one item of each rarity tier is present)
- Ultra Rare: 1% rate (1 in 100 chance if at least one item of each rarity tier is present)
- If there are no items of a tier(s) available (100-tier%) becomes the new sum of weights
Example: 10 Common, 0 Uncommon, 1 Rare, 1 Ultra-Rare beverage exist in the house when somebody redeems "Cat Spills Your Drink," the drink destruction redeem.
- Common still has weight 64
- Rare still has weight 5
- Ultra Rare still has weight 1
The sum of the weights is now 70 (instead of 100) and now, the chance to pull a common is 64/70, meaning it gets pulled around 90% of the time.