Adjustable Chain Gearshift does not mathematically behave as expected
Agentomega opened this issue ยท 3 comments
To produce: Place input shaft of any RPM (1 for ease of demonstration in this example), place input Adjustable Chain Gearshift, connect to at least one other chain. Place Analog Lever on Adjustable Chain Gearshift. When unpowered, Adjustable Chain Gearshift produces output equal to input as expected (1:1). When Lever signal strength set to 1, Gearshift produces 1.125 RPM (1 + 1/8). Expected either 1.06666 (1 + 1/15) or 1.0625 (1 + 1/16).
Examining AdjustablePulleyTileEntity.java, getModifierForSignal confirms this relation: 1 + ((newPower + 1) / 16f). This causes the output to skip from 1 to 1.125. Depending on desired behavior would suggest either:
1 + newPower / 15f (min modifier still 1 on 0 power, max modifier is 2, preserves linearity. Increments in 15ths though)
1 + newPower / 16f (min modifier still 1 on 0 power, max modifier would be 1 + 15/16, since a 1:2 ratio can already be achieved by cogwheels, no need to add double as max modifier)
Both solutions also cut out conditional.
This issue has been marked as stale because it has been inactive for 3 weeks. It will be closed if it remains inactive for another 3 weeks.
This issue has been closed since it has been inactive for 3 weeks since it was marked as stale.