IndustrialCraft - More Qualities


Adds 40 new qualities. Qualities are unlocked with quality modules. Possibility to change efficiency and chance with dynamic chance reduction.

Content
6 days ago
2.0
1.39K
Manufacturing Cheats

g Bug or Feature? Skipping levels twice

26 days ago
(updated 26 days ago)

Hi,

I'm not sure whether it is a bug or a feature.
When I checked the values of the different quality levels, using the "All Levels" option resulting in 40 new qualities, whenever a new tier starts, the values increase by twice the amount compared to the increase per level inside a tier. (e.g. +6% from Common to Uncommon or Uncommon to Rare, +3% from Uncommon 1 to Uncommon 2)
Wondering whether it was a settings issue and not entirely understanding the settings, I looked into the code and found it seems you are skipping the levels on purpose.

In addition I found two more things, that first confused me.
The ic-more-qualities-chance-plus setting's description sounded to me like being used to decide whether and by how much the chance to skip a quality should increase per quality level.
The setting isn't used in the code at all though. Instead, each next level's chance to skip a quality level on production is increased by 1%, resulting in a whopping 48% chance to skip from the third last level to the last one. (49% and 50% for the second last and last levels are not relevant anymore.)

Are these two things intended?
At least the second one seems to be a bug/oversight to me.

If I am not missing something important, an easy fix should be changing

function ic.get_chance()
    local value = math.min(ic.chance.value + ic.chance.add, 1)
    ic.chance.add = ic.chance.add + 0.01
    return value
end

to

function ic.get_chance()
    local value = math.min(ic.chance.value + ic.chance.add, 1)
    ic.chance.add = ic.chance.add + settings.startup["ic-more-qualities-chance-plus"].value
    return value
end

Cheers and thanks again for this mod!

(By the way, if you would consider hosting your mod as a GitHub repository or poking me on Discord (Username: merikolus), I could provide a German localization.)

26 days ago
(updated 26 days ago)

To the first.
I guess I don't understand what you mean. If you mean the Level of the quality, then yes, I intentionally have it more than +1. Vanilla has +1, only the jump between Epic and Legendary is +2. Since getting to higher qualities can be frustrating with their number, I intentionally increase the jumps between Levels of some qualities.

Second point.
Yes, it's a bug :) I tested and forgot to replace it with a variable from the configuration :oo) I'm working on a new version, so I'll include it there.

Third (repository).
Yes, it's public, but I don't have it on github, but gitlab. Later I can put a link to the mod here.

Edit:
The main bug I have is that the dynamic bonus should be negative, not positive - positive skips tiers (chance more then 100%)

26 days ago
(updated 26 days ago)

I fixed it in 1.0.2. I had more bugs there. Now it should be OK if you use the default settings in the settings. The dynamic bonus should be negative correctly.
And added a link to gitlab.
Otherwise, thanks for the report.

26 days ago
(updated 26 days ago)

To the first.

Yes, that's exactly what I meant. Thanks.

Second point.

Thanks for fixing it. Now everyone can choose wether to make skipping harder or easier. Awesome! ❤️

Third (repository).

Thanks a lot. It allowed me to go through your code changes without having to version it myself locally.
As I went through the code before already, I was curious about your changes.
I have a comment that might be relevant or helpful in the future: On a first glance, the ic.debug(node) function seems to convert a table to a string representation, e.g. like JSON.stringify() does in JavaScript. I recently realized Factorio already includes the Serpent library, which serves this and more purposes. You could use it like log(serpent.block(node)) for example. It might save you from having to maintain your debug function, outputs the table as a Lua code representation and has additional functionality, e.g. parsing strings to a table as well. (Serpent has a GitHub Repo with some documentation in the README.md.)


Two more notes:

  • When updating from 1.0.1 to 1.03, you get an error for the next range, having to be between 0 and 1, but getting -0. Resetting the mod settings solves it. I guess it is due to the chance to skip now being negative with the settings, and the value "-0.000000" from the error message was rounded.
  • I won't create a GitLab account, but I will create a German localization and share it here as a Gist (soon tm).
26 days ago
(updated 26 days ago)

Oh, I don't know about serpent, or rather I needed something to debug, and Lua doesn't even include some basic stuff without extra libraries, unfortunately. When I need to debug something again, I'll try it ;)

1) Yes, that's quite possible. Originally, this value couldn't even be negative and I had to adjust the range now. But if a reset solves it and I don't have to do anything, all the better

2) Github just has a nicer UI, but it's worse in features. But no problem, give me a link and I'll add it to the next version

New response