CustomInteriorRate
Customize the probability of generating every interior types on each map.
Date uploaded | 2 months ago |
Version | 1.0.1 |
Download link | eigeen-CustomInteriorRate-1.0.1.zip |
Downloads | 1893 |
Dependency string | eigeen-CustomInteriorRate-1.0.1 |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2100README
CustomInteriorRate v1.0.1
Customize the probability of generating every interior types on each map.
Configuration
In the [General]
section, the Enable
option is the global switch for the plugin. Setting it to false
will completely disable the plugin, effectively uninstalling it.
Each map has a corresponding [Map.<mapName>]
section. The content below pertains to the configuration for that specific map.
Enable
: Indicates whether custom generation probabilities are enabled for this map. By default, it is disabled. If disabled, the probability table will not be modified.FactoryRate
: Probability of factory generation. If left blank or set to a negative value, it will not change and will retain the original game weight. The normal value range is between 0.0 and 1.0.ManorRate
: Probability of manor generation. If left blank or set to a negative value, it will not change and will retain the original game weight. The normal value range is between 0.0 and 1.0.MineshaftRate
: Probability of mineshaft generation. If left blank or set to a negative value, it will not change and will retain the original game weight. The normal value range is between 0.0 and 1.0.
Note:
- After changing the configuration, you need to restart the game.
- If you modify each value for the same map, please ensure that the sum of FactoryRate, ManorRate, and MineshaftRate equals 1.0; otherwise, it may lead to unexpected situations. Generally, it should work normally.
- If a certain interior cannot be generated by default on a map, the plugin will not be able to modify its generation probability.
Configuration Example
Modify the mineshaft probability for the Titan map to 5%.
[Map.Titan]
Enable = true
MineshaftRate = 0.05
- Setting the mineshaft probability for the Titan map is fixed at 5%.
- The weights for other facilities remain at their default values, meaning the combined probability of factories and manors is 95%. Weights(v62): Factory = 300, Manor = 57, Mineshaft = 21,
Therefore, after modification, the factory probability = 300/(300+57)x0.95 = 0.80, and the manor probability = 57/(300+57)x0.95 = 0.15.
Principle
Before generating the map and obtaining the map seed, the target interior type is selected based on a pre-configured probability table. The plugin then continuously generates map seeds and predicts (using the in-game algorithm to calculate the interior type generated by that seed) the interior type until the generated interior type matches the target interior type. In other words, it shoots the arrow first and draws the target afterward.
Therefore, if a certain interior cannot be generated under the default conditions of a map, the plugin cannot modify its generation probability either.
中文文档
自定义每张地图的每种室内结构的生成概率。
配置文件
安装插件,初次启动游戏后,你会看到像下面这样的配置文件:
[General]
## Enable plugin features.
# Setting type: Boolean
# Default value: true
Enable = true
[Map.Adamance]
## Enable the modification on map Vow.
# Setting type: Boolean
# Default value: false
Enable = false
## Override the rate of Factory interior. If set to -1, keep the original rate.
# Setting type: Double
# Default value: -1
FactoryRate = -1
## Override the rate of Manor interior. If set to -1, keep the original rate.
# Setting type: Double
# Default value: -1
ManorRate = -1
## Override the rate of Mineshaft interior. If set to -1, keep the original rate.
# Setting type: Double
# Default value: -1
MineshaftRate = -1
[Map.Artifice]
...
[Map.Assurance]
...
其中,[General]
下的Enable
是插件的全局开关,设为false后插件完全不生效,约等于被卸载。
每张地图有一个对应的[Map.<mapName>]
域。下方的内容对应该地图相关配置。
Enable
:该地图是否启用自定义生成概率。默认不启用。如不启用,则概率表不发生修改。FactoryRate
:工厂生成概率。不写或设为负值表示不更改,保持游戏原有权重。正常值范围在0.0-1.0之间。ManorRate
:庄园生成概率。不写或设为负值表示不更改,保持游戏原有权重。正常值范围在0.0-1.0之间。MineshaftRate
:矿洞生成概率。不写或设为负值表示不更改,保持游戏原有权重。正常值范围在0.0-1.0之间。
注意:
- 更改配置文件后,需要重启游戏才能生效。
- 如果同一地图的每个值均修改,尽量保证FactoryRate、ManorRate、MineshaftRate三者之和为1.0,否则有可能引发意外情况。一般情况下应当工作正常。
- 如某个地图默认情况无法生成某种设施,则插件也无法修改其生成概率。
配置文件实例
修改Titan地图的矿井概率为5%
[Map.Titan]
Enable = true
MineshaftRate = 0.05
- Titan地图的矿井概率固定为5%
- 其他设施的权重保持默认值,即工厂+庄园的概率之和为95%,权重(v62):工厂=300, 庄园=57,矿井=21
则修改后,工厂概率=300/(300+57)x0.95=0.80,庄园概率=57/(300+57)x0.95=0.15
原理
在每次生成地图获取地图种子前,会提前根据配置后的概率表选择目标设施类型(interior),然后不断生成地图种子并预测(提前使用游戏内算法计算该种子生成的)设施类型,直到生成的设施类型与目标设施类型相同。即先射箭后画靶。
因此,如某个地图默认情况无法生成某种设施,则插件也无法修改其生成概率。