Plugin Request Automatically generate the value of block/item IDs by analyzing an area for frequency of resources.

Discussion in 'Plugin Help/Development/Requests' started by Luminess, Nov 18, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Luminess

    It would be useful to have a plugin to run through all the registered block/item IDs and generate it's value based on many factors. This would be useful for modded servers and mod developers. Modded servers because one can easily generate the values of mod items instead of manually tweaking values. Developers because it'll allow them to see which of their items are underpriced or overpriced and adjust their recipes accordingly.

    The value of the item should be generated based on the rarity of the most basic resources used to craft it.

    ---------------------------------------------------------

    It would first determine the rarity of naturally generated blocks by pre-generating a certain amount of chunks, then analyzing the ratio of block being analyzed to all the other blocks.
    The ratio will be determined by dividing the amount of times the target block appears in the area being analyzed by the number of non-air blocks in the area being analyzed.
    This ratio will be the base value of the naturally generated block. This will be "WR".

    ---------------------------------------------------------

    It'll also check every generated chest for the amount of the target block/item that appears in it against the total amount blocks in the area being analyzed by dividing the amount of the target block/item by the total amount of blocks in the world.
    Then multiply by the number of chests in the area being analyzed divided by total amount of non-air blocks in the area being analyzed.
    So (<amount of target block in chest>/<total amount blocks in the area being analyzed>)*(<number of chests in the area being analyzed>/<total amount of non-air blocks in the area being analyzed>)
    The result will be "CR".

    ---------------------------------------------------------

    Now we'll get the base value ratio of each naturally generated block with this equation:
    BVR=100-[(WR+CR)*100]

    ---------------------------------------------------------

    It'll then loop through all the block/item IDs to get the amount of recipes each ID appears in vs the total amount of recipes by dividing the amount of recipes of the ID by the total amount of recipes.
    The ratio will be "RR".

    ---------------------------------------------------------

    The number of recipes the target ID appears in will be "RN".
    The amount of recipes also factors in subsequent recipes.
    So in vanilla: if an enderpearl can be crafted into an endereye which then can be crafted into an enderchest, that would mean the enderpearl has 2 crafting recipes.

    ---------------------------------------------------------

    We need the amount of "processing" steps for each ID to do the equation. That means how much times do you need to craft/smelt/etc it to make the target block/item.
    The amount of recipes that directly craft/smelt/etc into the target block/item subtracts from the processing steps.

    ---------------------------------------------------------

    Lastly, it'll assign each ID a value based on the total value of the naturally generated resources required to make the block/item.
    IDs that have no recipe and aren't used in any recipes will have an infinite value or will be excluded from the list.
    The less items/blocks an ID can craft into, the higher the reduction in value, the reduction can be negative.

    ---------------------------------------------------------

    For this equation, you'll need the following for each ID:
    -Base value ratio: "BVR"
    -The ratio of recipes the ID is included in (directly or indirectly) compared to the total amount of registered recipes: "RR"
    -Number of recipes the target ID appears in: "RN"
    -Amount of "processing" steps required to make the item: "PM"

    Now for the equation:
    BVR*(RR+1)-(PM-RN)

    Here's an example:

    Diamond Ore value in vanilla:

    Getting base value ratio: average amount of diamond per chunk taken from wiki (3.097) divided by average number of non-air blocks in a chunk from guesstimate (16x16x52).
    BVR=100-[(3.097/13,312)*100]
    BVR=99.976735276442307692307692307692

    Getting ratio of recipes: amount of recipes that use diamond ore (16) to total registered recipes from googling plus guesstimating (350).
    RR=16/350
    RR=0.04571428571428571428571428571429

    Number of recipes that use diamonds taken from above.
    RN=16

    Getting number of processing steps: diamond ore spawns naturally, so 0. Nothing can craft into diamond ore so nothing to subtract.
    PM=0

    The actual math:
    BVR*(RR+1)-(PM-RN)
    Value = 99.976*(0.046+1)-(0-16)
    Value = 120.574896

    Let me know if there's any flaws in this.
     
  2. Offline

    timtower Moderator Moderator

    Moved to alternate versions
     
Thread Status:
Not open for further replies.

Share This Page