get generalized ore distributions from entity_prototypes ?

Place to get help with not working mods / modding interface.
Post Reply
Plawerth
Fast Inserter
Fast Inserter
Posts: 117
Joined: Thu Mar 02, 2017 12:57 am
Contact:

get generalized ore distributions from entity_prototypes ?

Post by Plawerth »

Is there some way to parse the complex ore distribution equations buried in game.entity_prototypes into a single digit of randomness from 0 to 1, and which can then be added up across all resource types to equal 1 ?

Turn this into a single number ... lol

Code: Select all

game.entity_prototypes.coal.autoplace_specification.probability_expression 
  function-application - clamp 
    arg1 procedure-delimiter
      function-application - clamp
         arg1 function-application - add
           function-application - spot noise
             arg basement value
               function-application - clamp
                 arg1 function-application - multiply
                   arg1 literal-number -6
                   arg2 function-application - multiply
                     literal-number 0.125 
                     function-application clamp
                       arg1 function-application - divide
                       [......]
This assumes a perfectly even distribution of all resources across the entire map, including "clumped resources" like oil wells.

,

I am trying to figure out how the Comfy Minesweeper scenario softmod could be modified to handle modded ore types such as Krastorio or Bob's mods.

The Minesweeper softmod revises the entire world into a simple desert/grass perlin noise map with rivers separating them.

Currently it uses a static ore table for vanilla/base, but I'd like to see a Krastorio 2 minesweeper.

I need a way to parse the entity_prototypes, get the list of additional resources, and get their average global map distribution when mixed evenly with every other ore type.

Post Reply

Return to “Modding help”