Default tier config not working
Yamza opened this issue ยท 6 comments
# Default tier to assign mobs to I:factoryTier=1
This is making mobs become T3 by default.
https://i.imgur.com/xWIsnrq.png
I was expecting it to make mobs not defined in the factory_config become T1 Controllers instead of T3.
If that's not what it was meant to do, my apologies. We were planning to just make the factory config set for each mob instead.
Ideally that option shouldn't be present in the config file, hence the -1. It is really just a placeholder for the mob specific values that are set in factory_config.json. The default is essentially to use the t1UnitsMax, t2UnitsMax, t3UnitsMax, t4UnitsMax to define the default tier that will apply.
What are you trying to make happen in the mod and I'll see if there is another way to configure it, or if I can make that config option work the way that you want.
I've tried to replicate the issue, but I'm not seeing that config option causing any issues. It basically does nothing.
Could you give me your full Woot configs (factory_config.json, woot.cfg) and I'll try and replicate it.
It is possible it is interacting with some other configuration.
I am actually an idiot and sent you the default configs that I had downloaded. Here is the correct version of the configs we use. The modpack is ATM3 - Remix (https://minecraft.curseforge.com/projects/all-the-mods-3-remix/files).
woot.zip
*I am assuming this is an issue due to me turning the MaxUnits to 0 for the first 3 tiers.
So your use of MaxUnits to 0, have highlighted an issue with the tier mapping.
By setting the MaxUnits to 0 for tier 1, what should happen is that all the mobs are forced to tier 1, however due to a bug in the health->tier mapping code that doesn't happen.
What you are seeing if the following:
Tier 4 check fails as the mob health is not high enough.
Tier 3 check succeeds as the mob health is > 0, therefore a tier 3 mob.
Other tiers are never checked.
The code in WootConfigurationManager.java needs fixed,
I'll get a fix in place and push out a new release (1.4.6) in the next day or so.
When that is out, then your MaxUnits to 0 for the first 3 tiers, should work correctly and all unspecified mobs will be mapped to tier 1.
(For my reference).
The below should do the following:
- health 0 -> T1_UNITS_MAX = tier 1 mob
- health T1_UNITS_MAX + 1 -> T2_UNITS_MAX = tier 2 mob
- health T2_UNITS_MAX + 1 -> T3_UNITS_MAX = tier 3 mob
- health T3_UNITS_MAX + 1 -> T4_UNITS_MAX = tier 4 mob
However it is actually doing:
- health >= T4_UNITS_MAX = tier 4
- health >= T3_UNITS_MAX = tier 3
- health >= T2_UNITS_MAX = tier 2
- otherwise tier 1
if (integerMobMap.containsKey(key)) {
// User will select 1-4, but getTier expects enum oridinals
int tierKey = integerMobMap.get(key) - 1;
tier = EnumMobFactoryTier.getTier(tierKey);
} else {
int cost = getSpawnCost(world, wootMobName);
if (cost >= getInteger(wootMobName, EnumConfigKey.T4_UNITS_MAX))
tier = EnumMobFactoryTier.TIER_FOUR;
else if (cost >= getInteger(wootMobName, EnumConfigKey.T3_UNITS_MAX))
tier = EnumMobFactoryTier.TIER_THREE;
else if (cost >= getInteger(wootMobName, EnumConfigKey.T2_UNITS_MAX))
tier = EnumMobFactoryTier.TIER_TWO;
else
tier = EnumMobFactoryTier.TIER_ONE;
}
Resetting those to the default values restored the intended functionality. User error as usual! :D
Glad I could help find a bug that no one else will probably ever run into though.
So I loaded your config .
You have the following setup, which I believe is the defaults.
Tier 1 - mobs up to 20 max health (t1UnitsMax)
Tier 2 - mobs 21-40 max health (t2UnitsMax)
Tier 3 - mobs 41-60 max health (t3UnitsMax)
Tier 4 - mobs 61-65535 max health (t4UnitsMax)
eg, Creeper has 20 health so is tier 1.
Any mob that isn't defined in factory_config uses the above health ranges to select the tier.
The factory_config can use "spawn_units" for a specific mob to override the default health value and still use the above ranges.
The factory_config can use "fatory_tier" for a specific mob to ignore the above ranges and defines a tier.
If you are getting a standard Minecraft Cow assigned to Tier 3, then it would suggest that something has increased its max health to between 41-60 as its default health is 10.
Is this happening on a standard ATM3 version? If so could you tell me which version and I'll install the modpack and see if I can recreate it.