Created
February 28, 2026 03:43
-
-
Save SciresM/7d6870d42ab125e4d017c8023031e246 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Mewgenics events overview: // From analysis of glaiel::WorldEvent::setupNonWheelRoll | |
| 1) The participating cat's stats are retrieved | |
| 2) The cat's luck advantage is calculated as (stats->luck - 5) | |
| 3) The cat's maximum and minimum stats are determined | |
| 4) The value of the stat being tested is retrieved from the cat. | |
| * If no stat is being tested, 5 is used. | |
| 5) The min/max bonus is calculated. | |
| * If a stat is being tested, this is 1 if the stat is the cat's highest (or tied for it), and -1 if it's the cat's lowest (or tied for it). | |
| * Otherwise, the min/max bonus is 0. | |
| * If the stat being tested is both the highest and the lowest, the bonus is 0. | |
| 6) The event's target probability is calculated. | |
| * First, a base probability is determined as min(max((5 + tested_stat - event_difficulty + 2 * minmax_bonus + next_event_bonus) * 0.1, 0.0), 1.0) | |
| * next_event_bonus is ordinarily 0, but can be set by a previous event's outcome. | |
| * event_difficulty is 5 in normal mode, 6 in hard mode, 7 in crazy mode, and 8 in impossible mode. | |
| * Next, the probability is normalized: target = (1.0 - base_probability) * 0.05 + base_probability * 0.95 | |
| * This can be rewritten (and besides float rounding is equivalent to) 0.05 + 0.9 * base_probability | |
| * This means that (ignoring luck) events are never less than 5% likely to succeed and never more likely than 95% likely to succeed. | |
| 7) The game checks if the event should use a hardcoded success chance. | |
| * If it should, the target probability is set to this, and luck_advantage is set to 0.0. | |
| 8) The game rolls for the event success/failure outcome by checking if RollWithLuck(-0.1 * luck_advantage, GetGlobalRng()) < target_probability. | |
| * This is the usual luck-based rolling mechanism where each point of luck gives a 10% chance of an advantage roll. | |
| * The multiplier is negative to make the function minimize the result (-1 means roll twice, take the minimum; 1 means roll twice, take the maximum). | |
| * Note that the game doesn't actually roll multiple times (except for fractional advantage), it samples from a distribution identical to rolling multiple times. | |
| 9) The game checks if the "Magic Mirror (Broken)" sidequest item is equipped; if it is, the event automatically fails. | |
| * Technically, this checks if the "fail_all_events" global tag is set; this is only present on the broken magic mirror. | |
| 10) The game checks if a glaiel::DebugMapUi object exists, and sets the outcome configured in that if present. | |
| * This is an imgui menu spawned when using "Event Debug" in dev_mode. It has a dropdown to force specific outcomes. | |
| 11) Next, the game checks a separate (debug?) mechanism for forcing event results (force_next_event_result), and sets the outcome configured in that if present. | |
| * I don't believe this is normally ever used. | |
| 12) Next, the game makes sure that the outcome is possible. | |
| * If the event only has good outcomes, and a bad outcome was rolled, the outcome is made good. | |
| * If the event only has bad outcomes, and a good outcome was rolled, the outcome is made bad. | |
| 13) If the stat being tested is "coins", the outcome is overridden to good/bad based on whether enough coins are present. | |
| * This is just good if the player has enough coins, and bad otherwise. | |
| Mewgenics event crit overview: | |
| * Event critical success/failure is determined later, when processing the event's "reward" field. | |
| * A luck advantage is calculated as 0.1 * (participating_cat_luck - 5) + 0.25 * minmax_bonus | |
| * This is the usual luck advantage, but whether the cat's stat being tested is its highest/lowest gives or takes away an extra 25% of an advantage roll. | |
| * If the event outcome was good, luck_advantage is multiplied by -1. | |
| * This makes luck minimize the value for good outcomes, and maximize it for bad outcomes. | |
| * Thus, luck helps you critically succeed, and helps you not critically fail. | |
| * Critical success/failure is determined as RollWithLuck(luck_advantage, GetGlobalRng()) < 0.15 | |
| Final boss looting overview: | |
| * These are normal events, which use stat = "none" | |
| * Thus, the target probability can be calculated as: | |
| * Normal mode: 50% | |
| * Hard mode: 41% | |
| * Crazy mode: 32% | |
| * Impossible mode: 23% | |
| * With this in mind, it becomes less worth it to try to loot a final boss on higher difficulties. | |
| * Looting is probably only advisable on high-luck cats, whose advantage rolls can mitigate the low target probabilities. | |
| * The target may also be higher or lower if the previous event set a next_event_bonus. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just read over this and your last post, they were super helpful, thanks for the information! If you can find any information on how house mutation stats work I'd really appreciate knowing that or if you could let me know how to find that out for myself that would also be great!