Giter VIP home page Giter VIP logo

ratecalculator's Introduction

shield shield shield

Rate Calculator

Calculate maximum production and consumption rates for the selected machines.

Installation

Download on the Mod Portal.

Usage

Select some machines with the selection tool (found on the shortcut bar, or use the hotkey Alt + X) to calculate the maximum production and consumption rates for those machines. The rates will be displayed in the GUI:

The GUI shows rates in several categories:

  • Ingredients: Materials that the machines import.
  • Products: Materials that the machines export.
  • Intermediates: Materials that some machines produce and others consume. The displayed rate is the "net rate" of that intermediate material.

With a given set, your goal is to make all of the intermediate net rates positive (green) or neutral (white). The numbers in parenthesis next to the machine counts denote "net producers" i.e. how many fewer or more similarly-configured machines you need to build to produce the material at the required rate.

The above screenshot shows that this yellow science set needs at least 1 more assembler producing engine units to achieve the required input rates. It also shows that there is an extra assembler making low density structures that can safely be removed from the set.

Use the dropdown to change the timescale for the measurements. Select a container or cargo wagon with the entity selector to scale the measurements to that container or wagon's capacity (accounting for stack sizes). Select a transport belt or inserter to measure against that belt or inserter's maximum item transfer rate.

Use the manual multiplier input and/or buttons to scale the entire subfactory's rates and machine counts by that multiplier.

You can access the previous ten sets by using the navigation buttons in the titlebar.

Tips and tricks

  • Selecting normally will produce a new selection. Alternatively, you can also hold shift to append the existing selection, or use shift + right click to remove machines from the selection.
  • Press the shortcut / use the hotkey again when already holding the tool to show the GUI.
  • Power input rates are not shown by default, but can be enabled in the mod settings.
  • Hovering over an entry will give more detailed information about that rate:

ratecalculator's People

Contributors

321freddy avatar astorin avatar choumiko avatar jansharp avatar jarg-compilatron avatar linlinglin avatar ma3ke avatar mkrieger1 avatar plexpt avatar raiguard avatar robosa avatar x2605 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ratecalculator's Issues

UX: Consider using icons instead of dropdown menu

Currently we can display item rate in a time unit or belt via a dropdown menu. My main use case is switching between viewing items/second and items/belt. However using dropdown is cumbersome and unnecessary for only 4 possible options.

Please consider replacing the dropdown menu with 4 icons, so that switching between different views would be faster (1 instead of 2 clicks).

Example:

Additional ref: https://medium.com/@kollinz/dropdown-alternatives-for-better-mobile-forms-53e40d641b53

Incorrect "net rate" figure with Space Exploration

Space Exploration uses a number of probabilistic recipes which appear to confuse the heck out of the rate calculation.

I have this lab layout, which is is 24 telescopes + 2 labs in two batches, and some astrometrics lab doing UV and visible light observation data;
image

Selecting the top half;
image

Selecting the bottom half;
image

Selecting both;
image

Yes, there is one lab with the wrong "type" but how if that causing a drop from net rate from 610 => 61 per minute?

Note; a couple QoL mods; but nothing which changes these recipies.

Factorissimo2 Buildings as Units

Describe the Bug

You can select the Factorissimo2 buildings as a unit to measure throughput

To Reproduce

Steps to reproduce the behavior:

  1. Have the Factorissimo2 mod installed
  2. Use the calculator on something
  3. Select units
  4. See error

Unrecoverable error when clearing belt type

Describe the Bug

When selecting transport belts as the calculation method, a belt type button appears. The tooltip says "right mouse button to clear". However, when cleared, an unrecoverable error occurs:

Please report this error to the mod author.

Error while running event RateCalculator::on_gui_elem_changed (ID 67)
__RateCalculator__/scripts/gui.lua:336: attempt to index local 'unit_data' (a nil value)
stack traceback:
__RateCalculator__/scripts/gui.lua:336: in function 'update_contents'
__RateCalculator__/scripts/gui.lua:107: in function 'handler'
__flib__/gui.lua:389: in function <__flib__/gui.lua:375>

To Reproduce

Steps to reproduce the behavior:

  1. Start a new game with Rate Calculator enabled. You may also want to have something that gives you quick access to an assembler, such as Creative Mod.
  2. Place an assembler and select recipe for it (it probably doesn't matter which but I used Assembling Machine 1 with Transport Belt as the recipe)
  3. Open Rate Calculator for the assembler
  4. Select Transport Belts from the dropdown
  5. Right-click the belt type button
  6. An unrecoverable error occurs

Log file

factorio-current.log

Companion Drones

When using the rate calculator with Companion Drones almost always you will select them. Can you disable the fuel consumption calculator for them?

Energy consumption display

Hello,

I would find it very useful if the calculator also shows the maximum power consumption of setups.

greetings

Electricity calculation doesn't take into account efficiency modules

Describe the Bug

I use efficiency modules in electric furnaces. I have a line of 24 furnaces with tier 1 efficiency modules in both slots. This should result in a 60% reduction in electricity usage. The mod gives a total consumption of 1872 kilowatts. I believe this calculation to be wrong, even without factoring in the fact the efficiency modules were being ignored.

This calculation adds together the base (aka resting) consumption and the active consumption. I think, rather, that the base rate is the minimum consumption and so shouldn't be added to the active consumption. I have done tests to verify this in the past when calculating exactly how many solar panels would be needed to power the inserters for a line of boilers.

And, regardless of the correctness of that, this clearly isn't taking into account the effect of efficiency modules. Efficiency modules here should be shaving off 60% from the active consumption.

I believe that the correct calculation here gives 691.2 kilowatts of consumption for the whole line of 24 furnaces, each with two efficiency 1 modules.

Also, I have, sometimes, used efficiency modules with beacons on centrifuges as the total power reduction can actually offset the power consumption of the beacon. Centrifuges are power hungry beasts.

To Reproduce

Steps to reproduce the behavior:

  1. Build a line of 24 furnaces and put efficiency 1 modules in them
  2. Use Alt-X (or whatever hotkey you use for the rate calculator)
  3. Select the whole line of furnaces
  4. Observe that it says they will consume 1872 kilowatts, which is not the correct figure

Suggestions/questions

  1. Any timeline/plan to incorporate some of the other rates MaxRateCalc has (like inserters)?

  2. What about modded belts with different speeds (also available with MaxRateCalc)?

  3. A calculator where you can use the number pad on your keyboard? ( MaxRateCalc's built-in calculator only allow button presses with a mouse)

Thanks for your help. The mod works great and looks nice but it still seems to be missing some features I use often from the other similar mod I mentioned.

Cheers

wishlist: replace "actual crafting time" mod

I wish you would replace "Actual Craft Time" instead. ...or, at least, the one specific feature that I like most about it: the automatic nature of it.

The flow I most often use is:

  1. Plop down a factory, and select a recipe for it.
  2. Click the factory, and Actual Craft Time pops up telling me input, output, and belt consumption rates.
  3. I click the "+1 / +5 factories/furnaces/whatever" button a few times to get the output rate I want.
  4. Victory!

The flow I'd like to use is:

  1. Press a shortcut button, and be prompted for the product and machine tier with sensible defaults.
  2. Now follow steps two through four above.

The key difference is that your calculator is reactive: I can find out how much a collection of things can produce (and how much it'll consume, and what sort of belt feed I need to keep it happy), while Actual Craft Time can be used proactively to figure out how many factories I need.

That workflow covers the 95 percent case for Factory Planer for me: I rarely need to calculate the entire end-to-end production chain, just add one or two simple production lines and then make sure they stay fed. Handle shortfalls by going and doubling production of whatever input fell short.

I love that I can use Rate Calculator to figure out the production of a collection of things, but I'd love it even more if it also supported this proactive "before I build a small thing" workflow.

The one other thing that'd be nice for the proactive use is if the GUI showed up without blocking the center of vision. I'm not saying attached in the left side flow, but if possible a pop-up window I can move that was in the top left, or under the minimap, would be ideal.

You did achieve the goal of fitting with the game UI, though, amazingly well. Good stuff!

PS: I know this is asking you to build something different from what you set out to make, and it'd be entirely legit to just say "no;" no upset or anything if this isn't interesting to you.

Crash Report

image

used the rate calculator on a PySinkhole (which takes any fluid and voids it)

Include unpowered beacons in the calculation

Is your feature request related to a problem? Please describe.

When designing new layouts I start with the most important step (for me): the machines and how many I need, and so on. At this step I usually have no power available in the build due to the designing phase.

Describe the solution you'd like

I'd like that the Rate Calculator does include unpowered beacons into account.

GUI pin option

I have a question,

I'm have no mod creation expetise so i am not sure how easy/hard this would be.

Your mod is the only one i have seen with the pin gui option.
Is it possible to add that to all the windows from the game through a mod?

the reason i ask this is that i would love that option on combinators so i can have more then one open to debug.

thank you for your time.

Allow for vertically resizing the window

Is your feature request related to a problem? Please describe.

When more than seven rows appear in the table you must scroll to see them all, this is annoying when there's no reason that it should be limited by that much. This causes many people to avoid using this mod due to the inconvenience.

Describe the solution you'd like

  • Option 1: Add an option in the mod settings to change the maximum amount shown upon generating the table before the overflow scrolling is needed.
  • Option 2: Allow the user to grab the corner of the window and/or the bottom edge, allowing them to drag to resize it.
    • Preferably the resizing should move in incremental steps according to the height of a table row.

UI scaling issue when above 100% scale

Describe the Bug

Using a UI scale higher than 100% results in the list becoming horizontally scrollable by a few pixels only when the list has a vertical scrollbar.

Screenshots

100% scale:
100% scale screenshot

125% scale:
125% scale screenshot

To Reproduce

Steps to reproduce the behavior:

  1. Go to Settings > Interface > UI scale set it to anything above 100%.
    • Also affects high-resolution monitors with automatic UI scale enabled.
  2. Use the Rate Calculator to create a list that's tall enough to require a vertical scrollbar.

Error

Describe the Bug

Caused error, said to report to you.

To Reproduce

Steps to reproduce the behavior:
Dragged the rate calculator on top of some labs mid-game in Krastorio 2 and this error occurred. Was working fine all game.

Save file & Username

Here is the latest autosave, if you run this save and repeat what I mentioned above, it will throw the error for sure.
https://gofile.io/d/2ayNgb

Log file

Current.log : https://hastebin.com/aqevuyecic.kotlin

new feature: Monitor

When I creating producing line setup and using modules I must every time select assembler and check rate for exactly the same machine. Is possible to pin window and refresh rate every ssecond?

Drop Down List remains open

Describe the Bug

When closing the GUI the drop down list remains open

To Reproduce

Steps to reproduce the behavior:

  1. Use the calculator on something
  2. Open the drop down list, but choose nothing
  3. Press Escape to close the GUI
  4. See error

Lab Rates

I feel like I'm missing something obvious here, but here goes - My take away from the mod page is that the rate of science pack consumption for x number of labs would be shown by selecting them, but I'm getting nothing. I've tried it with empty labs and with science packs loaded (but not actively researching). What am I doing wrong?

Make multiple selections for a calculation

I have a logistic robot factory that has several assembly machines spread out. Some intermediate assemblers, however, aren't always in the same physical "cluster" of the final product they're contributing to; they can sometimes be spread out far apart from each other. If I want to use this calculator for certain assemblers, I either have to select all of them (including unrelated machines, cluttering the UI and slowing calculation times when desired machines are far apart), or select them individually and add up the numbers manually. It would be far easier if there was a way to make multiple selections for a single calculation. Or even a way to just add/remove machines from the last calculation that was made.

Crash in 1.1.5

The mod Rate Calculator (2.0.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event RateCalculator::on_tick (ID 0)
flib/gui-beta.lua:136: attempt to index local 'elem' (a nil value)
stack traceback:
flib/gui-beta.lua:136: in function 'recursive_update'
flib/gui-beta.lua:165: in function 'update'
RateCalculator/scripts/gui/selection.lua:379: in function 'update'
RateCalculator/scripts/selection-tool.lua:166: in function 'iterate'
RateCalculator/control.lua:167: in function <RateCalculator/control.lua:164>

Handle recipes with the same fluid/gas but with different temperatures

Is your feature request related to a problem? Please describe.

Some of the recipes in Py take in fluid/gas at one temperature and output the same fluid/gas at a different temperature.

Recipe: Hot-stone brick
Ingredients: Warmer stone brick + Outlet gas (stage 4) >=1000C
Results: Hot stone brick + Outlet gas (stage 4) 750C

Describe the solution you'd like

Have rate calculator treat the gas/fluids at different temperatures as different items to be calculated

Additional context

image

Ideally there needs to be a column for temperature, or an overlay over the gas/fluid with the min temperature required.

image

it doesn't calculate the effect of beacon's modules if the beacon is not powered

Describe the Bug

It doesn't calculate the effect of beacon's modules if the beacon is not powered

To Reproduce

  1. put 2 pairs assembling machine+beacone and power one pair only.
  2. put prod modules in beacons and calculate the output of every pair, you will see that it calculates the only where beacon is powered (doesn't' matter if assembling machine is powered or not)
  3. put green modules in beacons and calculate the power consumption of every pair, you will see that it calculates the only where a beacon is powered (doesn't' matter if assembling machine is powered or not)

let me know if you can't reproduce it and need save and log

p.s. I like your mod a lot, but have to keep using Max Rare calculator as it doesn't' have such bug. Hope you can fix it :)

Furnace defaults

When using the calculator on furnaces, if they aren't currently processing an item (therefore no recipe), they don't show any processing time, this makes it effectively useless when building blueprints for furnaces.
Would it be possible to add a default furnace recipe setting or another way of selecting a recipe without live processing?

Fluid Consumption

Describe the Bug

The mod doesn't calculate how much fuel is consumed in a fluid burning boiler

To Reproduce

Steps to reproduce the behavior:

  1. Have Bob's Power installed
  2. Place a Fluid Burning Boiler and provide fuel (here given with Editor Extension)
  3. Use the calculator
  4. See error

image

new feature: Power Consumption

I wish see maximum power that machines consume I t will be very useful to plan power consumption of outpost and using power switches and accumulator backup systems or emergency powersource.

Showing Power

When selecting a group of working or non-working steam engines and their Boilers gives me zero results on Power Production

Below is 2 screenshots, one of the selection and the other of the results. I am playing on Pyblock.

https://imgur.com/a/MRqZxx6

I would have left a comment on the Factorio Mod Portal but I noticed you disabled all comments on all of your mods you produce. I currently use your recipe book, which works GREAT since FNEI doesnt work for modded playthroughs. So thank you for that.

Rate only shows Max Rate

I've got this mod and the max rate mod installed and they always show the same values. It seems to only show the max rate and not how much is actually being produced. A good example of this is where I compared the rate and max rate for some machines that didn't have enough ingredients so they weren't actually producing any items.

The rate mod still showed the same value as the max rate, even though the actual rate would be 0, as it wasn't producing anything. Do I have the wrong expectations of what this mod does? Or is this an issue?

I was looking at the rates for Assembly Machine 2.

Idea: calculate steady state inputs

In complex production chains it can be hard to match the production and consumption rates of intermediate products exactly, if non-integer ratios or modules are involved. This leads to Rate Calculator overestimating the required inputs.

As a simplified example, suppose item A takes 3 seconds to produce and requires two of item B, which only takes 2 seconds to produce and requires two of raw material C. If you have one machine for A and two for B, you'll produce 20 A per minute and 60 B per minute. Only 40 of those B are consumed each minute, so after buffers fill up the entire chain only requires 80 C per minute instead of 120.

In this simple example, having two machines for A and three for B would of course match perfectly, but in more complex chains with many different ratios it may require tens or even hundreds of machines to achieve perfect balance. And without a perfect balance the errors accumulate through the chain so you may end up having entire extra machines in earlier stages if you simply build enough to satisfy the next stage's demands.

I would like to have a way for Rate Calculator to account for this and calculate the inputs based on only the items that can be consumed by further stages of the chain. Items which are not consumed by any of the selected machines can be assumed to be outputs of the entire chain and should be accounted for at full production capacity.

bug at game load

Describe the Bug

load game with Industrial Revolution mod as well and you get loading game error

To Reproduce

Steps to reproduce the behavior:

load game with Industrial Revolution mod as well and you get this
https://imgur.com/a/85SlBuz

there is no save file as the game doesn't load. npuldon

Feature suggestion

Thank you for updating this mod for 1.1 so quickly, I really like it so far. I really like that you have belts as a unit of measure, but if you have time, I would like to suggest you also add inserters.

Crash error with space exploration

Error while running event RateCalculator::on_gui_elem_changed (ID 67)
RateCalculator/scripts/rcalc-gui.lua:210: attempt to index local 'unit_data' (a nil value)
stack traceback:
RateCalculator/scripts/rcalc-gui.lua:210: in function 'update_contents'
RateCalculator/scripts/rcalc-gui.lua:62: in function 'handler'
flib/gui.lua:352: in function 'dispatch_handlers'
flib/gui.lua:138: in function <flib/gui.lua:138>"

Can provide a save if requested.

Incorrect Calculations for Plastic from Liquification

Describe the Bug

The Rate Calculator incorrectly calculates a beaconed plastic setup.

The following setup is a fully beaconed 4 chemical plant setup (8 beacons/plant). This setup creates 2,8k plastic per minute.
See Calculator
This is also verified save below (Editor Extensions required)

To Reproduce

Steps to reproduce the behavior:

  1. Load the Save Game
  2. Use the calculator on the chemical plants
  3. The calculator produces the following stats, this is off by about 700 plastic
    image

Be certain to reproduce the issue on the same save file that you upload.

Save file & Username

Save:
MRC.zip

Username:
Roang

Log file

Not a crash, can upload if needed.

Include ghosts into calculation

Is your feature request related to a problem? Please describe.

When designing new layouts I may not have the machines (esp. beacons and modules) with me. Also I like to use the ghost placing feature of factorio to arrange new layouts instead of continously building and deconstructing the same machines.

Describe the solution you'd like

I'd love to have Rate Calculator to include ghost machines and beacons into the calculation.

Crash in 2.0.0

There are two ways to this crash:

  1. Select some trees --> crash
    or
  2. Select some trees, change measurement to pollution --> crash

crash

when using it, the game crashed.(the new version published just now, may 2.0.0)

399.060 Error MainLoop.cpp:1281: Exception at tick 2139062: 模组 速率计算器 [Rate Calculator] (2.0.0) 引发了无法恢复的错误。
请向模组作者报告此错误。

Error while running event RateCalculator::on_tick (ID 0)
flib/gui-beta.lua:136: attempt to index local 'elem' (a nil value)
stack traceback:
flib/gui-beta.lua:136: in function 'recursive_update'
flib/gui-beta.lua:165: in function 'update'
RateCalculator/scripts/gui/selection.lua:379: in function 'update'
RateCalculator/scripts/selection-tool.lua:166: in function 'iterate'
RateCalculator/control.lua:167: in function <RateCalculator/control.lua:164>
403.944 Quitting: user-quit.

Support for heat exchangers

Is your feature request related to a problem? Please describe.

When using the rate calculator on a nuclear reactor, it doesn't take heat exchangers into account - it doesn't calculate the steam output / water consumption

Describe the solution you'd like

I'd love for it to pick up on those entities and calculate those 2 values.

As a nice to have, we could introduce a heat measure, having reactors as producers of heat and exchangers as consumers (not sure of this rate exactly, but it could be nice to use the neighbour bonus to output the correct value)

Additional context

no context

Crash on load with CircuitControlledSilo mod

Describe the Bug

I've had this mod installed for a while and just installed CircuitControlledSilo and now get this error on startup:

Failed to load mods: Error in assignID: entity with name 'smart-rocket-silo-red' does not exist. It was removed by CircuitControlledSilo.

Source: rcalc-selection-tool (selection-tool).

Mods to be disabled:
• CircuitControlledSilo (1.0.2)
• RateCalculator (1.0.3)
• extended-descriptions (1.0.12)

extended-descriptions is probably not involved, it just touches everything.

To Reproduce

Steps to reproduce the behavior:

  1. Load the save file

Save file & Username

Save file

My username is sonaxaton

Log file

factorio-current.log

"Quick History" feature.

Describe the solution you'd like

From factorio discord:

It would be cool if rate calculator could store the last 5 or so calculations and allow you to quickly view them.

Include requested modules into calculation

Is your feature request related to a problem? Please describe.

When designing new layouts I may not have the machines (esp. modules) with me. So it often happens, that the are requested to be place into machines by bots (but not available currently).

Describe the solution you'd like

I'd love to have Rate Calculator to include requested modules in machines and beacons into the calculation.

IR2 Incompatibility

Describe the Bug

Mod fails to load with IR2

To Reproduce

Steps to reproduce the behavior:

Industrial Revolution 2 and Rate calc are incompatible at the moment.

Save file & Username

Not necessary?

Log file

https://pastebin.com/tvhAq7t1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.