Cold Biome

Place to get help with not working mods / modding interface.
Post Reply
kolt16
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Oct 12, 2013 10:55 am
Contact:

Cold Biome

Post by kolt16 »

So I made a snow terrain mod back in 0.7, what can I say I like snow. :D

I'm trying to migrate it to 0.12 the assets show up properly, and I might make new graphics for it as well if I have the time.

The problem is, I can't for the life of me figure out the autoplace settings. I did search it and found some things, but I suck at programming, I got as far as making a copy of the water autoplace function, and modified it to work for higher ground not lower, for the hills that use to be part of that mod.(I made this based on the only post I found about this system, the hill issue was the topic there as well, but there was no final solution I could take) It fills 80% of the map with hills so I probably messed that up too. :D About biomes I haven't a clue where would I set up a temperature check for instance.

How would I make hills that are placed in large or medium (preferably changeable size at generation) size chunks like water?
How would I set up a set of autoplaces, checking for temperature and placing a mix of snowy ground with snowy trees and other stuff?


autoplace = autoplace_settings("grass", {{{35, 0.8}, {0, 0.4}}}),
This makes absolutely no sense to me at all, I played around with the numbers, but found no info on what's what, and couldn't figure it out by testing either, there are just too many variables. If at least there would be a list of possible variables for this, that would help at least getting started, and an explanation what changes what. I also managed to make a copy of the autoplace system of ores, got it to show up as hills in the map generator, but the values don't seem to change much.

I hope someone can help me clean this up. The biome system is a great idea, it just not very useful if nobody knows what changes what.

Thanks in advance.

vzybilly
Fast Inserter
Fast Inserter
Posts: 143
Joined: Thu May 14, 2015 6:10 pm
Contact:

Re: Cold Biome

Post by vzybilly »

I am going to look into this for you abit... I'm also quite interested but it might take afew days for me to post back up here so I'm making this post >.>

also, could I see what you've gotten so far, so I can fiddle quicker?
Will code for Food. I also have 11+ mods!

kolt16
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Oct 12, 2013 10:55 am
Contact:

Re: Cold Biome

Post by kolt16 »

Here is all the code I have made so far, the autoplace settings section can be used for the hills as well, it just doesn't do much better then anything else.

Thanks a lot for taking a look at it, I can send the graphics as well if you need it, or make a download for them from mediafire or something.
Got to run now.

Code: Select all

noise-layers.lua
tiles.lua
demo-trees.lua
autoplace-controls.lua

autoplace setting tests

\data\base\graphics\terrain\my_snow
\data\base\graphics\terrain\my



noise-layers.lua

{
    type = "noise-layer",
    name = "hills"
  },
    {
    type = "noise-layer",
    name = "hills_snow"
  },
    {
    type = "noise-layer",
    name = "grass_snow"
  },
      {
    type = "noise-layer",
    name = "dirt_snow"
  },
      {
    type = "noise-layer",
    name = "sand_snow"
  },

  
  
  
  
tiles.lua

function hills_autoplace_settings(from_depth, rectangles)
  local ret =
  {
    {

      influence = 1e3 + from_depth,
      elevation_optimal = from_depth,
      elevation_range = 500,
      elevation_max_range = 5000, -- everywhere below elevation 0 and nowhere else
    }
  }
 

  if rectangles == nil then
    ret[2] = { influence = 1 }
  end

  autoplace_utils.peaks(rectangles, ret)

  return { peaks = ret }
end




{
    type = "tile",
    name = "hills",
	--autoplace = autoplace_settings("hills", {{{35, 0}, {0, 0.4}}}),
	--autoplace = hills_autoplace_settings(3000),

    collision_mask =
    {
	  "water-tile",
      "ground-tile",
      "resource-layer",
      "floor-layer",
      "item-layer",
      "object-layer",
      "player-layer"
    },
    
    layer = 45,
    variants = 
    {
      main = 
      {
      
      {
        picture = "__base__/graphics/terrain/my/hills.png",
        count = 4,
		size=1
      },
      },
      inner_corner = 
      {
        picture = "__base__/graphics/terrain/my/hills-inner-corner.png",
        count = 1,
      },
      outer_corner = 
      {
        picture = "__base__/graphics/terrain/my/hills-outer-corner.png",
        count = 1,
      },
      side = 
      {
        picture = "__base__/graphics/terrain/my/hills-side.png",
        count = 4,
      }
    },
    walking_sound =
    {
      {
        filename = "__base__/sound/walking/grass-01.ogg",
        volume = 0.8
      },
      {
        filename = "__base__/sound/walking/grass-02.ogg",
        volume = 0.8
      },
      {
        filename = "__base__/sound/walking/grass-03.ogg",
        volume = 0.8
      },
      {
        filename = "__base__/sound/walking/grass-04.ogg",
        volume = 0.8
      }
    },
    map_color={r=0.2, g=0.156, b=0.098},
    ageing=0.0006
  },
 
	
	{
    type = "tile",
    name = "hills_snow",
    collision_mask =
    {
	  "water-tile",
      "ground-tile",
      "resource-layer",
      "floor-layer",
      "item-layer",
      "object-layer",
      "player-layer"
    },
    
    layer = 35,
    variants = 
    {
      main = 
      {
      
      {
        picture = "__base__/graphics/terrain/my_snow/hills.png",
        count = 4,
		size=1
      },
      },
      inner_corner = 
      {
        picture = "__base__/graphics/terrain/my_snow/hills-inner-corner.png",
        count = 1,
      },
      outer_corner = 
      {
        picture = "__base__/graphics/terrain/my_snow/hills-outer-corner.png",
        count = 1,
      },
      side = 
      {
        picture = "__base__/graphics/terrain/my_snow/hills-side.png",
        count = 4,
      }
    },
    walking_sound =
    {
      {
        filename = "__base__/sound/walking/grass-01.ogg",
        volume = 0.8
      },
      {
        filename = "__base__/sound/walking/grass-02.ogg",
        volume = 0.8
      },
      {
        filename = "__base__/sound/walking/grass-03.ogg",
        volume = 0.8
      },
      {
        filename = "__base__/sound/walking/grass-04.ogg",
        volume = 0.8
      }
    },
    map_color={r=0.2, g=0.156, b=0.098},
    ageing=0.0006
  },
  
  
  {
    type = "tile",
    name = "grass_snow",
    collision_mask = {"ground-tile"},
    --autoplace = autoplace_settings("grass_snow", {{{35, 0.8}, {0, 0.4}}}),
    layer = 19,
    variants =
	{
    main = {
	{
        picture = "__base__/graphics/terrain/my_snow/grass.png",
        count = 4,
		size=1
      },
	  },
      inner_corner = {
        picture = "__base__/graphics/terrain/my_snow/grass-inner-corner.png",
        count = 1,
      },
      outer_corner = {
        picture = "__base__/graphics/terrain/my_snow/grass-outer-corner.png",
        count = 1,
      },
      side = {
        picture = "__base__/graphics/terrain/my_snow/grass-side.png",
        count = 4,
      }
    },
    walking_sound =
    {
      {
        filename = "__base__/sound/walking/grass-01.ogg",
        volume = 0.8
      },
      {
        filename = "__base__/sound/walking/grass-02.ogg",
        volume = 0.8
      },
      {
        filename = "__base__/sound/walking/grass-03.ogg",
        volume = 0.8
      },
      {
        filename = "__base__/sound/walking/grass-04.ogg",
        volume = 0.8
      }
    },
    map_color={r=61, g=51, b=17},
    ageing=0.00045,
    vehicle_friction_modifier = grass_vehicle_speed_modifier
  },

	{
    type = "tile",
    name = "dirt_snow",
    collision_mask = {"ground-tile"},
    --autoplace = autoplace_settings("dirt_snow", {{{35, 0.4}, {-10, 0}, 0.95}}),
    layer = 24,
    variants =
    {
      main =
      {
      {
        picture = "__base__/graphics/terrain/my_snow/dirt.png",
        count = 4,
		size=1
      },
	  },
      inner_corner = {
        picture = "__base__/graphics/terrain/my_snow/dirt-inner-corner.png",
        count = 1,
      },
      outer_corner = {
        picture = "__base__/graphics/terrain/my_snow/dirt-outer-corner.png",
        count = 1,
      },
      side = {
        picture = "__base__/graphics/terrain/my_snow/dirt-side.png",
        count = 4,
      }
		
    },
    walking_sound =
    {
      {
        filename = "__base__/sound/walking/dirt-02.ogg",
        volume = 0.8
      },
      {
        filename = "__base__/sound/walking/dirt-03.ogg",
        volume = 0.8
      },
      {
        filename = "__base__/sound/walking/dirt-04.ogg",
        volume = 0.8
      }
    },
    map_color={r=132, g=91, b=34},
    ageing=0.00045,
    vehicle_friction_modifier = dirt_vehicle_speed_modifier
  },
	
	{
    type = "tile",
    name = "sand_snow",
    collision_mask = {"ground-tile"},
    --autoplace = autoplace_settings("sand_snow", {{{35, 0.2}, {0, 0}}}),
    layer = 34,
    variants =
    {
      main =
      {
	  {
        picture = "__base__/graphics/terrain/my_snow/sand.png",
        count = 4,
		size=1
      },
	  },
	  inner_corner = {
        picture = "__base__/graphics/terrain/my_snow/sand-inner-corner.png",
        count = 1,
      },
      outer_corner = {
        picture = "__base__/graphics/terrain/my_snow/sand-outer-corner.png",
        count = 1,
      },
      side = {
        picture = "__base__/graphics/terrain/my_snow/sand-side.png",
        count = 4,
      }
        
    },
    walking_sound =
    {
      {
        filename = "__base__/sound/walking/sand-01.ogg",
        volume = 0.8
      },
      {
        filename = "__base__/sound/walking/sand-02.ogg",
        volume = 0.8
      },
      {
        filename = "__base__/sound/walking/sand-03.ogg",
        volume = 0.8
      },
      {
        filename = "__base__/sound/walking/sand-04.ogg",
        volume = 0.8
      }
    },
    map_color={r=160, g=126, b=54},
    ageing=0.00025,
    vehicle_friction_modifier = sand_vehicle_speed_modifier
  },








demo-trees.lua


{
    type = 2,
    identifier = "snow",
    --autoplace_peaks = {{{25, 0.5}, {10, 0.4}}},
    --autoplace_extra = { random_probability_penalty = 3e-3 },
    colors =
    {
      --snow
	  {r = 200, g = 214, b = 150},
	  {r = 201, g = 236, b = 196},
	  {r = 101, g = 191, b = 110},
      {r = 187, g = 195, b = 187},
      {r = 179, g = 180, b = 182},
      {r = 211, g = 220, b = 215},
      {r = 208, g = 210, b = 206},
      {r = 228, g = 228, b = 230},
      {r = 222, g = 225, b = 220},
    }
  },
  {
    type = 5,
	identifier = "snow",
    --autoplace_peaks = {{{20, 0.8}, {5, 0.4}}},
    colors =
    {
      --snow
	  {r = 200, g = 214, b = 150},
	  {r = 201, g = 236, b = 196},
	  {r = 101, g = 191, b = 110},
      {r = 187, g = 195, b = 187},
      {r = 179, g = 180, b = 182},
      {r = 211, g = 220, b = 215},
      {r = 208, g = 210, b = 206},
      {r = 228, g = 228, b = 230},
      {r = 222, g = 225, b = 220},
    }
  },
  
  {
    type = "tree",
    name = "big-tree",
    icon = "__base__/graphics/icons/dead-dry-hairy-tree.png",
    flags = {"placeable-neutral", "placeable-off-grid", "breaths-air"},
    emissions_per_tick = -0.0005,
    minable =
    {
      count = 5,
      mining_particle = "wooden-particle",
      mining_time = 2,
      result = "raw-wood"
    },
    max_health = 50,
	emissions_per_tick = -0.0001,
    collision_box = {{-0.7, -0.8}, {0.7, 0.8}},
    selection_box = {{-0.8, -2.2}, {0.8, 0.8}},
    drawing_box = {{-0.8, -2.8}, {0.8, 0.8}},
	subgroup = "trees",
    order = "a[tree]-b[dead-tree]",
    vehicle_impact_sound =  { filename = "__base__/sound/car-wood-impact.ogg", volume = 1.0 },
    --autoplace = dead_trees_autoplace(0.5),
    pictures =
    {
      {
        filename = "__base__/graphics/terrain/my_snow/big-tree-01.png",
        priority = "extra-high",
        width = 155,
        height = 118,
        shift = {1.1, -1}
      },
      {
        filename = "__base__/graphics/terrain/my_snow/big-tree-02.png",       
        width = 144,
        height = 169,
        shift = {1.2, -0.8}
      },
      {
        filename = "__base__/graphics/terrain/my_snow/big-tree-03.png",        
        width = 151,
        height = 131,
        shift = {0.8, -0.7}
      },
      {
        filename = "__base__/graphics/terrain/my_snow/big-tree-04.png",
        width = 167,
        height = 131,
        shift = {2, -1}
      },
      {
        filename = "__base__/graphics/terrain/my_snow/big-tree-05.png",
        width = 156,
        height = 154,
        shift = {1.5, -1.7}
      },
      {
        filename = "__base__/graphics/terrain/my_snow/big-tree-06.png",
        width = 113,
        height = 111,
        shift = {0.7, -0.9}
      },
      {
        filename = "__base__/graphics/terrain/my_snow/big-tree-07.png",
        width = 116,
        height = 125,
        shift = {1, -0.7}
      },
      {
        filename = "__base__/graphics/terrain/my_snow/big-tree-08.png",
        width = 162,
        height = 129,
        shift = {1.4, -1.3}
      },
      {
        filename = "__base__/graphics/terrain/my_snow/big-tree-09.png",
        width = 156,
        height = 164,
        shift = {1.7, -1.1}
      },
      {
        filename = "__base__/graphics/terrain/my_snow/big-tree-10.png",
        width = 196,
        height = 129,
        shift = {1.1, -1.1}
      },
      {
        filename = "__base__/graphics/terrain/my_snow/big-tree-11.png",
        width = 196,
        height = 129,
        shift = {1.3, -1.4}
      },
      {
        filename = "__base__/graphics/terrain/my_snow/big-tree-12.png",
        width = 175,
        height = 164,
        shift = {1.6, -1.2}
      }
    },
  },
  
  
  
  
  
  
  autoplace-controls.lua
  
  {
    type = "autoplace-control",
    name = "hills",
    richness = true,
    order = "d-a"
  },
  
  
  
  
  autoplace setting tests
  
   	autoplace =
  {
    control = "hills",
    sharpness = 1,
    richness_multiplier = 14000,
    richness_base = 1000,
    size_control_multiplier = 1.00,
    peaks =
    {
      {
        influence = 0.2,
      },
      {
        influence = 0.65,
        noise_layer = "hills",
        noise_octaves_difference = -1.9,
        noise_persistence = 0.3,
        starting_area_weight_optimal = 0,
        starting_area_weight_range = 0,
        starting_area_weight_max_range = 2,
      },
      {
        influence = 0.68,
        noise_layer = "hills",
        noise_octaves_difference = -2.3,
        noise_persistence = 0.4,
        starting_area_weight_optimal = 1,
        starting_area_weight_range = 0,
        starting_area_weight_max_range = 2,
      },
    },
	

Post Reply

Return to “Modding help”