Skip to content

High recipe value overshoot in Balanced mode #86

Description

@h4ilst0rm

private (LogicEntity ingredient, int number) ChooseSecondaryIngredient(LogicEntity entity, int currentValue)
{
LogicEntity ingredient = GetRandom(_validIngredients);
// What's the maximum number of this ingredient the recipe can still sustain?
int max = FindMaximum(ingredient, entity.Value, currentValue);
// Figure out how many to actually use.
int number = _random.Next(1, max + 1, _distribution);
return (ingredient, number);
}

Secondary ingredient selection does not consider remaining free value in the recipe before rolling an item, so it may pick a highly overvalued one and overshoot the recipe value by jarringly large amounts.

I have a customized recipe data file with AirBladder at value 20, AcidMushroom at 10, AdvancedWiringKit at 250.

[Debug  :Subnautica Randomiser] [R] Figuring out ingredients for AirBladder
[Debug  :Subnautica Randomiser] Calc max: 5
[Debug  :Subnautica Randomiser] [R] > Adding ingredient: AcidMushroom, 1, size: 1
[Debug  :Subnautica Randomiser] [R] > Adding primary ingredient AcidMushroom
[Debug  :Subnautica Randomiser] Calc max: 5
[Debug  :Subnautica Randomiser] [R] > Adding ingredient: AdvancedWiringKit, 1, size: 2
[Debug  :Subnautica Randomiser] [R] > Recipe is now valued 270 out of 20
[Debug  :Subnautica Randomiser] [R][+] Randomised recipe for [AirBladder].

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions