AsherGlick / ResourceCalculator

A Video Game Resource Calculator
https://resourcecalculator.com
GNU General Public License v3.0
56 stars 30 forks source link

[ResourceRevamp] Remove Negative Requirement Values #82

Open AsherGlick opened 1 year ago

AsherGlick commented 1 year ago

A relic from the original iteration of the code is that all of the requirements are negative values. This is due to how the solver works, by "adding" the negative requirements each iteration.

From the perspective of the resource list this makes no sense however. All the numbers should just be positive values to avoid having to add in all these extra - signs.

  Anvil:
    recipes:
    - output: 1
      recipe_type: Crafting
      requirements:
        Block of Iron: -3
        Iron Ingot: -4
    - recipe_type: Raw Resource

becomes

  Anvil:
    recipes:
    - output: 1
      recipe_type: Crafting
      requirements:
        Block of Iron: 3
        Iron Ingot: 4
    - recipe_type: Raw Resource

This will either require a change in the front end solver (ideal solution), or a change in the build script to emulate the negative values in the bundle that is sent to the front end.