Mekanism

Mekanism

111M Downloads

Osmium compressor using an unexpected and seemingly random quantity of osmium "gas"

Jessassin opened this issue ยท 1 comments

commented

Issue description

The osmium compressor uses a "wrong" amount of osmium when any number of speed upgrades are installed.

When creating refined obsidian ingots, the following amounts of osmium are consumed:

qty of speed upgrades mb of osmium consumed per craft
0 200
1 297
2 223
3 250
4 249
5 231
6 205
7 201
8 191

I've seen it argued in previous threads on this topic, that additional osmium consumption is expected behavior, however with the quantities above, there is no way to account for the seemingly random quantities used when setting up autocrafting.

If these numbers are expected, then at a minimum, they should be exposed to JEI. (mekanism/Mekanism-Feature-Requests#207).

However given the seemingly random, and "descending" nature of the numbers above, I suspect that this is not intended behavior, and is indeed a bug.

Likely related to: #6765 #6787

Steps to reproduce

Within a powered osmium compressor:

  • Install the quantity of speed upgrades according to the table above
  • Insert 2x osmium ingots to be turned into "gas"
  • Insert 1x refined obsidian dust to be compressed
  • Once complete, observe and record the amount of osmium consumed
  • "dump" osmium, and move to the next upgrade qty

Minecraft version

1.16.5 (Latest)

Forge version

36.2.4

Mekanism version

10.0.21 (Latest)

Other relevant versions

No response

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

No response

commented

So after a bunch of further investigation, it seems that both sides were previously correct:

  • Osmium Compressors were (incorrectly) changing amount of needed osmium based on speed upgrades
  • Osmium Compressors (correctly) requiring more osmium with more speed upgrades (but an incorrect amount of "more".

The errors where:

  1. Last tick usage wasn't using the proper scaled amount (which is why 8 speed upgrades was 191 instead of 200, most of the others were slightly shifted as well).
  2. Rounding issues as once I started looking into this in more depth to see the numbers you provided and why they were so weird... the compressor (among other things) increases the amount of gas needed proportionally to the speed upgrades to account for the recipe taking less ticks to process. The issue is this was ending up with partial amounts which then were ceil'd to get how many mB to use.

I fix this and a variety of other small issues I found while looking at it by making it so it calculates how much needs to be used for that tick based on how much has been used so far out of the target amount, so that it will consistently reach the same total.