Cooking

**Cooking** a feature that is unlocked by defeating IT HUNGERS.

It is a feature that can be used once every ~24 hours to permanently increase exp gains, up to a maximum of 300%.

Different quantities of ingredients are balanced to maximize Current Meal Efficiency. Various gear can be equipped before eating the dish to increase the Total Cooking Bonuses. Once satisfied with the Current Meal Exp Gain, eating the dish will apply it to the Total Exp Gain and generate a new random meal and ingredients.

If a meal is ready to eat but has not been eaten, the timer will bank time for the next meal(s) up to a maximum of 48 hours. Due to a bug, the banked time will not exceed 24.5 hours (25.5 hours with the Bread Set).

## Mechanics overview

At the start 6 ingredients are available which later increases to 7 and then 8. The ingredients are part of 4 secret pairs. With 6 ingredients, two of them may be unpaired, and with 7 one will always be unpaired.

Every pair is scored separately, and Current Meal Efficiency is the sum of those scores. When all ingredients are set perfectly the score will be 100%.

For a given pair the score is determined by an ingredient score which has peaks at two different levels, and a combination score for the sum of the ingredients, which has a single peak. The closer to a peak, the higher the score. The ingredients of the pair are interchangeable so having 5 of A and 14 of B gives the same score as 14 of A and 5 of B.

If the ingredient peaks are at 3 and 9 and the sum peak is at 11, then the optimal selection could be 3 each of A and B (using the first peak for both ingredients). Or it could be 9 each of A and B (second peak). It could be 3 of A and 9 of B (using both peaks and getting close to optimal sum). It could be 2 and 9 (close to first, hit second, hit sum). It could be 3 and 8 (hit first, close to second, hit sum).

## Strategy

1. **Prepare** Reduce all ingredients to zero.
2. **Identify the pairs** Increment ingredients and find the ones that produce the same change in efficiency (reset everything back to zero when trying to find the initial pairs). That is your pair, unless the off chance that multiple pairs rolled the same RNG. You may have to increment a few times to notice a change in efficiency, if their values are both set high enough. If something doesn't seem to have a pair and you have less than 8 ingredients, it might not be paired with anything.
3. **Optimize the pairs one at a time**
	1. **Identifying the spikes** The efficiency is based on three values. Two of those values are specific ingredient values, which can range in increments of 0-20, and the third value is the sum of the two individual values, and can range from 5-40. Identify where the efficiency first spikes, which can be at 0, and that is your low ingredient value. Continue to increment the ingredient all the way to 20 and see the other spikes you can identify. It is possible the total ingredient spike will be over 20, and you won't find it with a single ingredient. It is also possible for both individual ingredient values to be the same number.
	2. **Optimize using the spikes** Try both ingredients at the first spike, then both at the second spike, then try different possibilities for the sum spike that gets you close to one or both ingredient spikes.
	3. **Backup plan** If you are still having trouble just use brute force! (**Pro Tip:** Click a +/- button once to select it, alternate pressing the <Enter> and <Space> keys to rapidly increment a button, and use WASD/arrow keys to change the button you want to increment). Check every combination of the paired ingredients to see which one gives the highest value. Each ingredient has 20 increments, which means 400 possibilities for each pair.
4. **Finished** When you reach 100% meal efficiency, you know you've made it.
5. **Equip** Equip all your cooking gear before eating. Despite the wildly varying "cooking" stat, they all give the same boost, except the pants, which count double because shoddy coding.

## Nerdy Math

Once unlocked, a new meal and 8 ingredients will be randomly generated (only 6 or 7 ingredients may display if ingredient slots 7 and 8 are not unlocked). The ingredients are generated in random pairs which are unrelated to their position on the screen. The goal is to adjust the amounts of each ingredient to maximize the "Current Meal Efficiency" multiplier, which can have a maximum of 100%.

Each ingredient is given:

* A whole number target level between 0 and 20 inclusive (IngredTargetLevel)
* A decimal weight between 4 and 14 inclusive (IngredWeight)

Each ingredient pair is given:

* A whole number target level between 5 and 34 inclusive (PairTargetLevel). (Note: This value is taken from the game's source code. The ingredient levels that give you the highest score may sum to above 34 or below 5 due to the fact that the Pair Target Level is just one of 3 factors feeding into the pair score.)
* A decimal weight between 8 and 30 inclusive (PairWeight).

From these numbers, an optimal score is calculated (Scoreopt). A current score (Scorecurr) is calculated based on your selected ingredient amounts (IngredCurrLevel) and the sum of each pair of ingredient amounts (PairCurrLevel). The Current Meal Efficiency multiplier is calculated as Scorecurr / Scoreopt.

Scoreopt is calculated as the best score that could be achieved by setting all 8 ingredients to a number between 0 and 20. Scores are calculated as the sum of all 4 pair scores.

For each pair of ingredients consisting of Ingred1 and Ingred2, the pair score is equal to the sum of all of the following:

* If Ingredient 1 is unlocked: Ingredient Level Score(Ingred1, Ingred1) + Ingredient Level Score(Ingred2, Ingred1)
* If Ingredient 2 is unlocked: Ingredient Level Score(Ingred1, Ingred2) + Ingredient Level Score(Ingred2, Ingred2)
* If both ingredients are unlocked: Pair Level Score()

Where

* Ingredient Level Score(IngredA, IngredB) = (1 - 0.03 \* |IngredATargetLevel - IngredBCurrLevel|) ^ 30 \* IngredAWeight
* Pair Level Score = (1 - 0.02 \* |PairTargetLevel - PairCurrLevel|) ^ 40 \* PairWeight

## Gear

Each piece of gear with "Cooking %" displayed on it contributes to "Total Cooking Bonus". However, note that the "Cooking %" number displayed does not affect the bonus. A My Rainbow Heart (138,000,000% bonus) contributes just as much in practice as Non Slip Shoes (60% bonus). See also Build Cooking.

Each equipped Cooking gear item provides a multiplicative 3% bonus to "Total Cooking Bonuses". However a bug currently exists that causes Cooking gear in the legs slot to count twice so Regular Pants gives x1.032 bonus. Additionally, Bloody Cleaver must be in the primary (top) weapon slot to provide its bonus,

## Cooking upgrades

There are several upgrades that improve different aspects of Cooking:

### Total Cooking Bonuses

* Cooking Gear: 7 pieces in Build Cooking each giving x1.03 (=1.037) (=1.038 with legs slot bug)
* Space Set: x1.10
* Ingredient Slot 7 unlocked: x1.20
* Ingredient Slot 8 unlocked: x1.20
	+ Total: x1.9481 (x2.007 with legs slot bug)

### Eat Rate

* Base rate: 1 meal per 23.5 hours
* Bread Set: -1 hour
	+ Total: 22.5 hours

### Ingredient Slots

* Base: 6 slots
* Defeat Titan 11: +1 slot
* Defeat Titan 12: +1 slot
	+ Total: 8 slots

## Trivia

* It is possible to see the "The End" screens once when using the keys under 'strategy/backup plan'.
* It is only available in Build 1.260 (Kartridge and Steam versions) and is unavailable in Build 1.220 (Kongregate browser version)