Advertisement
shirkit

Untitled

Jul 17th, 2014
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.19 KB | None | 0 0
  1. require 'defines'
  2.  
  3. region_size=8 -- alternative mean to control how further away resources would be, default - 256 tiles or 8 chunks
  4.               -- each region is region_size*region_size chunks
  5.               -- each chunk is 32*32 tiles
  6.  
  7. override_normal_spawn = true   -- if false then the standard spawner can also spawn full grown resources/entities,
  8.                                -- set resources you want to control through this config to "None" in worldgen "Size" settings when starting a new game
  9.                                -- changing of this setting requires game restart, i.e. close game and start it again, not actally a new game
  10.                                
  11. override_type = 'partially'    -- 'full' - no spawns by game are allowed, 'partially' - very small patches are spawned by world gen
  12.                                -- changing of this setting requires game restart
  13.  
  14. starting_area_size=1           -- starting area in regions, safe from random nonsense
  15.  
  16. absolute_resource_chance=0.30  -- chance to spawn an resource in a region
  17. global_richness_mult = 1.0      -- multiply richness all resources
  18.  
  19. multi_resource_richness_factor=0.60 -- any additional resource is multiplied by this value times resources-1
  20. multi_resource_size_factor=0.60
  21. multi_resource_chance_diminish=0.8    -- diminishing effect factor on multi_resource_chance
  22.  
  23. min_amount=350 -- default value for minimum amount of resource in single pile
  24.  
  25. richness_distance_factor=1.030 -- 3.0 relative % per region distance ~ 2.1x mult @ 25 regions distance
  26.  
  27. deterministic = true           -- set to false to use system for all decisions  math.random
  28.  
  29. config={
  30.   ["iron-ore"] = {
  31.     type="resource-ore",
  32.  
  33.     -- general spawn params
  34.     allotment=120, -- how common resource is
  35.     spawns_per_region={min=1, max=2}, --number of chunks
  36.     richness=7000,
  37.    
  38.     size={min=20, max=40}, -- rough radius of area, too high value can produce square shaped areas
  39.    
  40.     -- resource provided at starting location
  41.     starting={richness=2000, size=17},
  42.    
  43.     multi_resource_chance=0.13, -- absolute value
  44.     multi_resource={
  45.       ["iron-ore"] = 1, -- ["resource_name"] = allotment
  46.       ['copper-ore'] = 2,
  47.       ["coal"] = 4,
  48.       ["stone"] = 4
  49.     }
  50.   },
  51.   ["copper-ore"] = {
  52.     type="resource-ore",
  53.  
  54.     allotment=120,
  55.     spawns_per_region={min=1, max=2},
  56.     richness=11000,
  57.     size={min=15, max=30},
  58.  
  59.     starting={richness=1800, size=10},
  60.    
  61.     multi_resource_chance=0.13,
  62.     multi_resource={
  63.       ["iron-ore"] = 2,
  64.       ['copper-ore'] = 1,
  65.       ["coal"] = 4,
  66.       ["stone"] = 4
  67.     }
  68.   },
  69.   ["coal"] = {
  70.     type="resource-ore",
  71.  
  72.     allotment=100,
  73.  
  74.     spawns_per_region={min=1, max=3},
  75.     size={min=15, max=25},
  76.     richness=14000,
  77.  
  78.     starting={richness=2500, size=12},
  79.    
  80.     multi_resource_chance=0.13,
  81.     multi_resource={
  82.       ["iron-ore"] = 1,
  83.       ['copper-ore'] = 1,
  84.       ["coal"] = 4,
  85.       ["stone"] = 4
  86.     }
  87.   },
  88.   ["stone"] = {
  89.     type="resource-ore",
  90.  
  91.     allotment=80,
  92.     spawns_per_region={min=1, max=2},
  93.     richness=8000,
  94.     size={min=15, max=25},
  95.  
  96.     starting={richness=1000, size=8},
  97.    
  98.     multi_resource_chance=0.13,
  99.     multi_resource={
  100.       ["iron-ore"] = 1,
  101.       ['copper-ore'] = 1,
  102.       ["coal"] = 4,
  103.       ["stone"] = 4
  104.     }
  105.   },
  106.  
  107.   ["crude-oil"] = {
  108.     type="resource-liquid",
  109.     minimum_amount=750,
  110.    
  111.     allotment=60,
  112.     spawns_per_region={min=1, max=3},
  113.     richness={min=40000, max=70000}, -- total richness of site
  114.     size={min=2, max=4}, -- richness devided by this number
  115.    
  116.     starting={richness=4000, size=1}
  117.   },
  118.  
  119.   ["biter-spawner"] = {
  120.     type="entity",
  121.     force="enemy",
  122.     clear_range = {3, 3},
  123.    
  124.     spawns_per_region={min=1,max=3},
  125.     size={min=1,max=4},
  126.     size_per_region_factor=1.025,
  127.     richness=1,
  128.    
  129.     absolute_probability=0.08, -- chance to spawn in region
  130.     probability_distance_factor=1.025, -- relative incress per region
  131.     max_probability_distance_factor=2.0, -- absolute value
  132.  
  133.     along_resource_probability=0.25, -- chance to spawn in resource chunk anyway, absolute value. Can happen once per resource.
  134.    
  135.     sub_spawn_probability=0.5,     -- chance for this entity to spawn anything from sub_spawns table, absolute value
  136.     sub_spawn_size={min=1, max=2}, -- in same chunk
  137.     sub_spawn_distance_factor=1.02,
  138.     sub_spawn_max_distance_factor=2,
  139.     sub_spawns={
  140.       ["small-worm-turret"]={
  141.         min_distance=2,
  142.         allotment=2000,
  143.         allotment_distance_factor=0.9,
  144.       },
  145.       ["medium-worm-turret"]={
  146.         min_distance=5,
  147.         allotment=1000,
  148.         allotment_distance_factor=1.05,
  149.       },
  150.       ["big-worm-turret"]={
  151.         min_distance=7,
  152.         allotment=1000,
  153.         allotment_distance_factor=1.15,
  154.       }
  155.     }
  156.   }
  157. }
  158.  
  159. --[[ MODS SUPPORT ]]--
  160.  
  161. -- Roadworks mod
  162. if remote and game then
  163. if game.entityprototypes["RW-limestone"] then
  164.   config["RW-limestone"] = {
  165.     type="resource-ore",
  166.  
  167.     allotment=100,
  168.     spawns_per_region={min=1, max=2},
  169.     richness=11000,
  170.     size={min=10, max=17},
  171.  
  172.     starting={richness=1000, size=4},
  173.    
  174.     multi_resource_chance=0.15,
  175.     multi_resource={
  176.       ["coal"] = 1,
  177.       ["stone"] = 4
  178.     }
  179.   }
  180.  
  181.   config["stone"].multi_resource["RW-limestone"] = 12
  182.   config["iron-ore"].multi_resource["RW-limestone"] = 3
  183.   config["copper-ore"].multi_resource["RW-limestone"] = 3
  184.   config["coal"].multi_resource["RW-limestone"] = 3
  185. end
  186.  
  187. -- DyTech
  188.  
  189. if remote.interfaces["DyTech-Core"] then
  190.   config["stone"].allotment = 100
  191.   config["stone"].richness = 25000
  192.   config["stone"].starting.richness = 10000
  193. end
  194.  
  195. if remote.interfaces["DyTech-Metallurgy"] then
  196. -- exotic ores
  197.   config["gold-ore"] = {
  198.     type="resource-ore",
  199.  
  200.     allotment=25,
  201.     spawns_per_region={min=2, max=5},
  202.     richness=175,
  203.     size={min=2, max=5},
  204.     min_amount = 15,
  205.  
  206.     starting={richness=50, size=3},
  207.    
  208.     multi_resource_chance=0.60,
  209.     multi_resource={
  210.       ["lead-ore"] = 3,
  211.       ["silver-ore"] = 3,
  212.       ["tin-ore"] = 3,
  213.       ["tungsten-ore"] = 3,
  214.       ["zinc-ore"] = 3,
  215.     }
  216.   }
  217.   config["silver-ore"] = {
  218.     type="resource-ore",
  219.  
  220.     allotment=25,
  221.     spawns_per_region={min=2, max=5},
  222.     richness=220,
  223.     size={min=2, max=5},
  224.     min_amount = 15,
  225.  
  226.     starting={richness=50, size=3},
  227.    
  228.     multi_resource_chance=0.60,
  229.     multi_resource={
  230.       ["lead-ore"] = 3,
  231.       ["gold-ore"] = 3,
  232.       ["tin-ore"] = 3,
  233.       ["tungsten-ore"] = 3,
  234.       ["zinc-ore"] = 3,
  235.     }
  236.   }
  237.  
  238.   config["lead-ore"] = {
  239.     type="resource-ore",
  240.  
  241.     allotment=25,
  242.     spawns_per_region={min=2, max=5},
  243.     richness=220,
  244.     size={min=2, max=5},
  245.     min_amount = 15,
  246.  
  247.     starting={richness=50, size=3},
  248.    
  249.     multi_resource_chance=0.60,
  250.     multi_resource={
  251.       ["silver-ore"] = 3,
  252.       ["gold-ore"] = 3,
  253.       ["tin-ore"] = 3,
  254.       ["tungsten-ore"] = 3,
  255.       ["zinc-ore"] = 3,
  256.     }
  257.   }
  258.  
  259.   config["tin-ore"] = {
  260.     type="resource-ore",
  261.  
  262.     allotment=25,
  263.     spawns_per_region={min=2, max=5},
  264.     richness=220,
  265.     size={min=2, max=5},
  266.     min_amount = 15,
  267.  
  268.     starting={richness=50, size=3},
  269.    
  270.     multi_resource_chance=0.60,
  271.     multi_resource={
  272.       ["lead-ore"] = 3,
  273.       ["silver-ore"] = 3,
  274.       ["gold-ore"] = 3,
  275.       ["tungsten-ore"] = 3,
  276.       ["zinc-ore"] = 3,
  277.       ["copper-ore"] = 2,
  278.     }
  279.   }
  280.  
  281.   config["tungsten-ore"] = {
  282.     type="resource-ore",
  283.  
  284.     allotment=25,
  285.     spawns_per_region={min=2, max=5},
  286.     richness=220,
  287.     size={min=2, max=5},
  288.     min_amount = 15,
  289.  
  290.     starting={richness=50, size=3},
  291.    
  292.     multi_resource_chance=0.60,
  293.     multi_resource={
  294.       ["lead-ore"] = 3,
  295.       ["silver-ore"] = 3,
  296.       ["gold-ore"] = 3,
  297.       ["tin-ore"] = 3,
  298.       ["zinc-ore"] = 3,
  299.     }
  300.   }
  301.  
  302.   config["zinc-ore"] = {
  303.     type="resource-ore",
  304.  
  305.     allotment=25,
  306.     spawns_per_region={min=2, max=5},
  307.     richness=220,
  308.     size={min=2, max=5},
  309.     min_amount = 15,
  310.  
  311.     starting={richness=50, size=3},
  312.    
  313.     multi_resource_chance=0.60,
  314.     multi_resource={
  315.       ["lead-ore"] = 3,
  316.       ["silver-ore"] = 3,
  317.       ["gold-ore"] = 3,
  318.       ["tin-ore"] = 3,
  319.       ["tungsten-ore"] = 3,
  320.     }
  321.   }
  322.  
  323. -- moltensomethin
  324.   config["lava-2800"] = {
  325.     type="resource-liquid",
  326.     minimum_amount=1000,
  327.    
  328.     allotment=30,
  329.     spawns_per_region={min=1, max=3},
  330.     richness={min=40000, max=120000},
  331.     size={min=2, max=7},
  332.    
  333.     absolute_probability=0.01,
  334.    
  335.     multi_resource_chance=0.25,
  336.     multi_resource={
  337.       ["lava-2800"] = 1,
  338.       ["lava-1400"] = 2,
  339.       ["lava-600"] = 4
  340.     }
  341.   }
  342.   config["lava-1400"] = {
  343.     type="resource-liquid",
  344.     minimum_amount=1000,
  345.    
  346.     allotment=35,
  347.     spawns_per_region={min=1, max=3},
  348.     richness={min=40000, max=120000},
  349.     size={min=2, max=7},
  350.    
  351.     absolute_probability=0.01,
  352.    
  353.     multi_resource_chance=0.25,
  354.     multi_resource={
  355.       ["lava-2800"] = 1,
  356.       ["lava-1400"] = 2,
  357.       ["lava-600"] = 4
  358.     }
  359.   }
  360.   config["lava-600"] = {
  361.     type="resource-liquid",
  362.     minimum_amount=1000,
  363.    
  364.     allotment=40,
  365.     spawns_per_region={min=1, max=3},
  366.     richness={min=40000, max=120000}, -- total richness of site
  367.     size={min=2, max=7}, -- richness devided by this number
  368.    
  369.     absolute_probability=0.01,
  370.    
  371.     starting={richness=10500, size=3},
  372.     multi_resource_chance=0.25,
  373.     multi_resource={
  374.       ["lava-2800"] = 1,
  375.       ["lava-1400"] = 2,
  376.       ["lava-600"] = 4
  377.     }
  378.   }
  379.  
  380. end
  381.  
  382. if remote.interfaces["DyTech-Warfare"] then
  383.   config["gems"] = {
  384.     type="resource-ore",
  385.  
  386.     allotment=50,
  387.     spawns_per_region={min=2, max=5},
  388.     richness=125,
  389.     size={min=2, max=5},
  390.     min_amount = 15,
  391.     starting={richness=40, size=3},
  392.    
  393.     multi_resource_chance=0.20,
  394.     multi_resource={
  395.       ["stone"] = 1
  396.     }
  397.   }
  398.  
  399.   if config["zinc"] then
  400.     config["gems"].multi_resource["lead-ore"] = 3
  401.     config["gems"].multi_resource["silver-ore"] = 3
  402.     config["gems"].multi_resource["gold-ore"] = 3
  403.     config["gems"].multi_resource["tin-ore"] = 3
  404.     config["gems"].multi_resource["tungsten-ore"] = 3
  405.     config["gems"].multi_resource["zinc-ore"] = 3
  406.     config["gems"].multi_resource_chance = 0.50
  407.    
  408.     config["lead-ore"].multi_resource["gems"] = 2
  409.     config["silver-ore"].multi_resource["gems"] = 2
  410.     config["gold-ore"].multi_resource["gems"] = 2
  411.     config["tin-ore"].multi_resource["gems"] = 2
  412.     config["tungsten-ore"].multi_resource["gems"] = 2
  413.     config["zinc-ore"].multi_resource["gems"] = 2
  414.   end
  415.  
  416. end
  417.  
  418.  
  419. --[[ commented due to absence in current version of F-Mod
  420. if remote.interfaces["F-Mod"] then
  421.   -- geyser left as is for now
  422.   config["geyser"] = {
  423.     type="resource-liquid",
  424.     minimum_amount=750000000,
  425.    
  426.     allotment=0,
  427.     spawns_per_region={min=1, max=2},
  428.     richness={min=7500000000, max=7500000000}, -- total richness of site
  429.     size={min=1, max=2}, -- richness devided by this number
  430.   }
  431.   if config["lava-600"] then
  432.     config["lava-600"].multi_resource["geyser"] = 8
  433.     config["lava-1400"].multi_resource["geyser"] = 8
  434.     config["lava-2000"].multi_resource["geyser"] = 8
  435.   end
  436. end
  437. ]]--
  438. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement