Skip to content

feat: add Super Quality Module and let the super-beacon broadcast quality#60

Merged
jodli merged 1 commit into
masterfrom
data-stage-quality
Jun 30, 2026
Merged

feat: add Super Quality Module and let the super-beacon broadcast quality#60
jodli merged 1 commit into
masterfrom
data-stage-quality

Conversation

@jodli

@jodli jodli commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Artifacts | Task

What problems was I solving

Creative-mod had seven "super" modules covering speed, effectivity, productivity, cleanliness, slowness, consumption, and pollution — but no quality module. Players wanting to test quality-dependent builds deterministically had to fall back on vanilla quality modules (small random chance, not guaranteed), or wait on RNG. The super-beacon also couldn't distribute quality effects, making area-wide quality testing impractical.

Additionally, the super-beacon's distribution_effectivity was 0.5, far below a legendary vanilla beacon's 2.5, making it weaker than the best obtainable vanilla beacon.

Every quality behavior in the data stage was inherited from engine defaults by omission, with no inline documentation of intent — making it unclear to future readers whether each field was a deliberate choice or an oversight.

What user-facing changes did I ship

  • prototypes/item.lua — New super_quality_module (category = "quality", effect = { quality = 1.0 }): a creative module guaranteeing at-least-+1 quality upgrade on output (the engine's fixed ~10% cascade can still push to +2/+3)
  • prototypes/recipe.lua — Empty-ingredient recipe granting the module, so the existing Creative-tools sweep picks it up automatically
  • defines.lua — Module registered in names.items, names.recipes, and the Creative Provider Chest content list
  • locale/en/base.cfg — English item name + description
  • graphics/icons/super-quality-module.png — Placeholder icon (productivity module recolor; final art can follow)
  • prototypes/entity.lua"quality" added to super_beacon.allowed_effects; distribution effectivity raised from 0.5 → 1.5 with +0.2 per quality level (matching vanilla beacon model, legendary = 2.5)
  • prototypes/equipment.lua — Inline deliberate-no-op comment on omitting charging_station_count_affected_by_quality
  • verify.py — Two new behavior assertions: super_quality_module_effect_applied and super_quality_module_beacon_insertable
  • changelog.txt2.4.0 block with Features + Changes entries

How I implemented it

Name constants (defines.lua)

Added super_quality_module to names.items and names.recipes after the super_pollution_module entries, and appended a table.insert into creative_provider_chest_additional_content_names so the Provider Chest stocks it alongside the other seven.

Module prototype (prototypes/item.lua)

Added the eighth literal module table after super_pollution_module. Key fields: category = "quality", effect = { quality = 1.0 }, order = "i", tier = 50. The quality effect key is category-independent (vanilla speed modules carry a negative quality effect while staying category = "speed"), so category = "quality" is valid. At 1.0 the first upgrade is guaranteed; values above 1.0 are identical since the engine cascade probability is fixed at ~10%.

Recipe (prototypes/recipe.lua)

Empty-ingredient enabled = false recipe following the sibling pattern. Added an inline deliberate-no-op comment explaining that can_set_quality resolves to false for empty-ingredient recipes — intentional, since the module itself is already a cheat item obtainable only at normal quality.

Super-beacon changes (prototypes/entity.lua)

Two edits to the super-beacon literal:

  1. "quality" appended to allowed_effects — enables area-wide distribution of the quality effect to nearby crafting machines.
  2. distribution_effectivity raised from 0.51.5 with distribution_effectivity_bonus_per_quality_level = 0.2 added — mirrors the vanilla beacon model so a legendary-tier beacon reaches 2.5. (The super-beacon entity is only obtainable at normal quality today, so the per-level bonus is a forward-compatible alignment rather than a functional change for now.)

Deliberate no-ops documented (entity.lua, equipment.lua)

Added inline comments at:

  • The lab() function — creative labs keep the engine default (all effects except quality); a quality effect on a lab is inert.
  • super_personal_roboport_equipmentcharging_station_count_affected_by_quality stays omitted; the equipment is only reachable at normal quality.

Behavior assertions (verify.py)

super_quality_module_effect_applied: places an assembling-machine-2 (vanilla allows quality effect), reads the baseline resolved quality, inserts the module, reads again, and asserts the delta ≥ 1.0. Uses a before/after delta rather than an absolute threshold because assembling-machine-2 carries an intrinsic quality = 0.5 baseline.

super_quality_module_beacon_insertable: places a super-beacon and inserts the module; a returned count of 1 proves the allowed_effects quality gate admits the module for distribution.

Deviations from the plan

No plan file — implemented from structure outline 04-structure-outline-super-quality-module.md.

Implemented as planned

  • All prototype/recipe/locale/icon/defines additions match the outline spec exactly
  • super_beacon.allowed_effects updated with "quality"
  • Both behavior assertions added and registered in results list and failed-zip tuple
  • Deliberate no-op comments on labs, roboport equipment, and empty-ingredient recipes

Deviations/surprises

  • distribution_effectivity bumped and distribution_effectivity_bonus_per_quality_level added — the outline marked distribution_effectivity_bonus_per_quality_level as a deliberate no-op (moot while beacon is normal-quality only). The user requested mirroring the vanilla beacon model (1.5 + 0.2/level → 2.5 legendary) during implementation, so both fields were set and the deliberate-no-op comment was removed.
  • Behavior assertion uses a before/after delta — the outline sketched machine.effects.quality.module >= 1.0 (nested shape), but LuaEntity.effects is a flat table ({ quality = 1.5 }). The assertion was adapted to a delta read to correctly isolate the module's contribution from the machine's intrinsic baseline.

Additions not in plan

  • None

Items planned but not implemented

  • Non-English locales (zh-CN, zh-TW) — explicitly deferred to translators per the outline's open question.
  • Final icon art — placeholder (productivity module copy) shipped; final art can follow.

How to verify it

git checkout data-stage-quality
uv run verify.py all --clean

Manual Testing

  • uv run verify.py debug --gui: enable Creative tools, confirm the Super Quality Module appears in the modules subgroup and in the Creative Provider Chest
  • Insert the module into an assembling machine that allows quality; confirm output is upgraded by ≥1 level
  • Place a super-beacon with the Super Quality Module; confirm nearby crafting machines show the quality effect distributed in their GUI (not rejected)
  • Check the super-beacon's distribution effectivity tooltip shows 1.5 (normal quality)

Description for the changelog

Add Super Quality Module (guaranteed ≥1-level upgrade), enable quality broadcast on the super-beacon, and align its distribution effectivity with the vanilla beacon model (1.5 + 0.2/level).

…lity

Add a super_quality_module (category = "quality", effect = { quality = 1.0 })
granted by the Creative-tools sweep and stocked by the Creative Provider Chest,
giving a guaranteed at-least-+1 quality upgrade on a machine's output.

Add "quality" to super_beacon.allowed_effects so a single beacon can distribute
the effect, and align its distribution effectivity with the vanilla beacon
(1.5 baseline + 0.2 per quality level). Cover both with verify.py behavior
assertions. Deliberate data-stage no-ops (labs, empty-ingredient recipes,
roboport quality flag) are documented inline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jodli jodli force-pushed the data-stage-quality branch from b5422f7 to a078774 Compare June 30, 2026 22:02
@jodli jodli merged commit 878ca4a into master Jun 30, 2026
2 checks passed
@jodli jodli deleted the data-stage-quality branch June 30, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant