
Better Fog 是一款轻量级模组,旨在根据不同类型的生物群系增强游戏内雾效的外观,并使其完全可配置。它添加了 8 种按生物群系配置的雾效类型,例如洞穴、云层、雨天和夜间雾效。
Better Fog 2.0 现已发布!除了原有的雾效外,现在新增了虚空、熔岩、水和雷雨雾效。每种生物群系都可以以多种方式对这些雾效进行配置,包括设置、添加或乘以其颜色、起始高度、结束高度和不透明度,从而打造你所需的完美雾效。此外,还添加了维度黑名单等功能,并大幅提升了性能。
配置文件详细解释
剧透
配置文件分为两个主要部分,均位于 <config folder>/betterfog/ 目录下:
1: 主配置文件 (betterfog.json)
2: 所有生物群系的配置文件 (位于 ./biomes 下)
在主文件中,第一个 <fog_type>"_enabled" 配置项仅表示指定的雾效类型是否启用(针对每个生物群系)。其中第一个配置项表示模组本身是否启用。
雾效类型是一种特定的可修改雾效状态,例如:洞穴雾效是在 cave_y_start 和 cave_y_end 之间激活的雾效类型,稍后会详细介绍它们。
生物群系选项是包含特定生物群系所有雾效类型的 JSON 文件,位于 /biomes/<biome_name>.json。
默认选项是为未配置的生物群系默认使用的生物群系选项(如果 use_defaults 设置为 false,否则它将不会被使用,该生物群系中将全部为原版效果)。
"use_vanilla_for_unconfigured" 指示当特定生物群系配置中的雾效类型是否使用默认选项还是原版的选项(本质上就是禁用该未配置的雾效类型)。
"dimension_blacklist" 是一个简单的维度列表,在这些维度中模组将不会启用。
"use_defaults" 已在上面解释过。
接下来的 <fog_type>"_y_start" 配置项简单地指示这些特定雾效的起始和结束 Y 值。洞穴雾效在高于 y start 时完全无效,在低于 y end 时完全激活,而虚空和云层雾效则在中间达到峰值,并在其范围之外无效。
"change_time" 是模组能够检测到生物群系变化所需的时间(以刻为单位),以便在你进入和离开生物群系时雾效不会随机闪烁。
"step_color" 用于雾效颜色变化时,它指示每刻颜色变化的最大量(从 0 到 1,乘以 100 得到百分比)(例如:如果你进入水中,雾效不会立即变成蓝色,而是需要一段时间)。
"step_distance" 是完全相同的概念,但适用于雾效的起始和结束位置,它以方块而不是百分比进行变化。
"cave, cloud, void pick 指示将普通雾效转换为自定义雾效的 Sigmoid 曲线的陡峭程度,因此如果 p 为 0.5,转换将几乎完全是线性的,但如果 p 为 10,则在开始时几乎没有变化,中间变化很大,结尾又几乎没有变化。如果你不知道自己在做什么,建议不要触碰这些参数。
在生物群系配置文件中,有许多雾效类型,每种都有指示雾效在完全激活时的值的参数。
有 6 个参数:
red, green, blue, opacity 都专用于颜色,范围从 0 到 1,它们简单地指定最终雾效的颜色。
start 和 end 指示雾效何时开始和结束,以方块为单位。
所有这些参数都可以是简单的数字,雾效在完全激活时将设置为这些值。
或者可以使用操作符 "+, -, *, /",并且不是设置这些前缀后面的值,而是在当前值上执行操作。
为了更好地理解正在发生的事情,让我们看看代码是如何工作的。
模组默认会获取原版的颜色和起始及结束位置。
然后它会应用“白天”或“夜晚”雾效,这些雾效的活动状态会交替变化。当完全处于白天时,只应用“白天”雾效;在过渡期间,两者混合应用;最后在夜晚,只应用“夜晚”雾效。
如果像示例中那样,这些雾效没有设置颜色值,它将只使用原版的颜色,但改变起始和结束位置(在这种情况下,雾效在白天从 32 开始,到原版值的 95% 结束)。
在此之后,如果你身处熔岩或水中,这些雾效将被应用并完全激活。
现在,洞穴、云层和虚空雾效有点不同,它们不会立即完全激活,你输入的值将在 y start 和 y end 之间从 0 变化变为完全变化(详见上一部分的更好解释)。
雨和雷暴应该是不言自明的,在降雨和打雷时激活(不同时激活)。












Better Fog is a lightweight mod meant to enhance the look of the fog in the game, based on different environments and make it fully configurable, adding 8 configurable types of fog by biome, such as a cave, cloud, rain and night fog.
Better Fog 2.0 is out! now with void, lava, water and thunder fog in addition to the original ones are all configurable for each biome in many ways, being able to set, add or multiply their color, start, end and opacity, all to get the perfect fog you need dimension blacklist and much more have also been added aswell as improving drastically performance
In Depth config explaination
Spoiler
The config is divided into 2 main parts, both found under <config folder>/betterfog/
1: the main config file (betterfog.json)
2: all the biomes configs (under ./biomes)
In the main file, the first <fog_type>"_enabled" configs just indicate if the specified fog type is enabled (for every biome) the first one states if the mod itself is enabled
A fog type is a specific modifiable fog state, example: cave is the fogtype activated between cave_y_start and cave_y_end, more on them later
A biome options is the json with all the fog types of a specific biome, found in /biomes/<biome_name>.json
Default options is the biome options used by default for unconfigured biomes (if use_defaults is set to false, otherwise it wont be used and all will just be vanilla in that biome)
"use_vanilla_for_unconfigured" indicates if, when for a specific biome config, a fog type will use the default's options or vanilla's (essentialy disabling that unconfigured fog type)
"dimension_blacklist" is a simple list of dimensions in which the mod wont be enabled
"use_defaults" has been explained above
the next <fog_type>"_y_start" configs simply indicate the start and ending y values of those specific fogs, cave fog will be fully inactive above y start and fully active belove y end, while void and cloud will peak at the middle and be inactive outside their ranges.
"change_time" is the time in ticks it takes to be able for the mod to detect a biome change after one just happened (so if you step in and out of a biome the fog doesnt just flash randomly)
"step_color" is used, when the fog changes in color, it indicates the max amount (from 0 to 1, multiply by 100 to get percentage) the color can change in a tick (example: if you go inside water, it doesnt immediately turn the fog to blue, it will take some time)
"step_distance" is the exact thing but for start and end fog, it also changes by blocks and not percentage
"cave, cloud, void pick indicate how steep the sigmoid curve transforming the normal fog into the custom one will be, so if p is 0.5, the tranformation will be almost fully linear, but if p is 10, there will be little to no change at the start, a lot in the middle, and very little in the end again, i suggest not touching these if you dont know what youre doing
in the biome config files, there are many fog types, each will have values indicating what the fog will be when the fog type is fully active
there are 6 parameters
red, green, blue, opacity are all dedicated to the color, from 0 to 1, they simply state what color the final fog will take
start and end indicate when the fog starts and ends, in blocks
all of these parameters can be simple numbers, and the fog when fully active will be set to those values
or an operation "+, -, *, /" can be used, and, instead of setting to the value following these prefixes, it will execute the operation on the current value
to better understand what's happening, lets look at how the code works
the mod will take the vanilla colors, start and end by default
then it will apply the "day" or "night" fog, these will be alternating in activity, when its fully day only "day" will be applied, during the transition a mix between the 2 will, and in the end at night, only the "night" one
if like in the example, these have no set color values, it will instead just use the vanilla colors, but change the start and end (in this case the fog starts at 32 and ends 95% of the vanilla value during the day)
after this, if you're inside lava or water these will be applied and fully active
now cave, cloud and void are a little different they are not fully active immediately, and the values you input will transform from 0 change to full change across y start and y end (see better explanation in the previous part)
rain and thunder should be self explanatory, activated during rain and thunder (not simultaneously)











评论 0
登录后参与评分
还没有评论,来抢沙发吧