Fractal Maps

by mrvn

Add a H-tree elevation function to the game, selectable in Terrain -> Map Type in the map generator.

Content
1 year, 8 months ago
1.1
180
Environment

i Voids

1 year, 8 months ago

Very cool mod! Any consideration for adding voids along the fractal? I could see players just landfilling in all the water as-is.

1 year, 8 months ago

I don't think there is any way to do that with the elevation function. I can see 2 options for this:

1) disable landfill. I just do that on a honors basis.

Maybe at some point I need a larger space than one of the boxes for something and I could landfill between 4 boxes to create a bigger one. That's why I leave landfill in there.

2) You can make the elevation rise quickly and the game will add cliffs. All the land could be surrounded by cliffs preventing the player from going down to the water and using any landfilled parts to cross over.

Since there are no interior lakes or rivers this would have to be tweaked to leave 2 tiles land at the waters edge and then have a cliff. That would allow placing a pump and undergound pipe to get water.

One thing I haven't tested is if this would leave any gaps in the cliffs with ramps down to the water. I'm not sure how they are generated but I think they happen when the elevation isn't steep enough in the middle of a cliff.

Of cause using LUA and on_chunk_generated can be used to replace water with voids. I might eventually do that for some reason or another and include that option. But first I want to see what other fractals I can implement as elevation function instead of LUA.

1 year, 6 months ago

Cliffs are generated based on elevation contours and a 'cliffiness' map generation tile property, which "Determines whether (when >0.5) or not (when <0.5) a cliff will be placed at an otherwise suitable (according to CliffPlacementSettings) location." (https://wiki.factorio.com/Types/NoiseExpression) So if you want to go the cliffs route, you would have to also override cliffiness to = 1. I think you can make this an option by setting intended_property = "cliffiness" on a new, constant named noise expression, e.g.

data:extend{
  {
    type = "noise-expression",
    name = "constant-one-cliffiness",
    intended_property = "cliffiness",
    expression = tne(1)
  }
}

I think you should similarly be able to provide an override to the void tile's probability expression so that it's...whatever water is, plus one. But I am less certain about this. "tile:out-of-map:probability" would be the expression name to override, but I'm not sure if or how that will present in the map settings UI.

Alternatively to providing new named noise expression options, you could do something with mod options, but arguably doing it with named noise expression overrides is cleaner because one doesn't need to restart the entire game to put them into effect. :P

5 months ago

The comment wasn't about the cliffs itself but the gaps you sometimes have in cliffs providing a narrow way up. I'm not sure if there is some mechanism that generates those gaps or if they are simply places along a cliff where the cliffiness isn't steep enough.

New response