Skip to content

Productivity math treats ignored_by_productivity as all-or-nothing #93

Description

@ApocDev

Factorio 2.0 defines ProductPrototype.ignored_by_productivity as an amount, not a flag: the first N units of the product are catalytic and only the remainder is multiplied by productivity (the classic example is Kovarex — 41 U-235 out with ignored_by_productivity = 40, so productivity applies to just 1).

Our import coerces it to a boolean: ignored_by_productivity: c.ignored_by_productivity ? 1 : 0 (app/src/db/import-factorio.ts:296), stored as a bool column (schema.ts:96), and every consumer applies full-productivity-or-none (queries.ts:484, server/factorio.ts:555, lib/recipe-card.tsx:392).

Consequence: any recipe with a partial value (0 < ignored < amount) has its productivity-boosted output undercounted whenever prod modules / TURD prod bonuses are active — we treat the whole product as catalytic when only part of it is.

Fix: store the amount, and compute boosted output as amount + prodBonus * max(0, amount - ignored). While in there, check the dump for Py recipes with partial values to gauge how much this currently mis-solves (needs a data migration for the column type).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: dataData-dump import, synthetic recipes, cost analysisarea: plannerProduction block / planning modelbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions