feat: add Super Quality Module and let the super-beacon broadcast quality#60
Merged
Conversation
…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>
b5422f7 to
a078774
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_effectivitywas 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— Newsuper_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 automaticallydefines.lua— Module registered innames.items,names.recipes, and the Creative Provider Chest content listlocale/en/base.cfg— English item name + descriptiongraphics/icons/super-quality-module.png— Placeholder icon (productivity module recolor; final art can follow)prototypes/entity.lua—"quality"added tosuper_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 omittingcharging_station_count_affected_by_qualityverify.py— Two new behavior assertions:super_quality_module_effect_appliedandsuper_quality_module_beacon_insertablechangelog.txt—2.4.0block with Features + Changes entriesHow I implemented it
Name constants (
defines.lua)Added
super_quality_moduletonames.itemsandnames.recipesafter thesuper_pollution_moduleentries, and appended atable.insertintocreative_provider_chest_additional_content_namesso 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. Thequalityeffect key is category-independent (vanilla speed modules carry a negative quality effect while stayingcategory = "speed"), socategory = "quality"is valid. At1.0the 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 = falserecipe following the sibling pattern. Added an inline deliberate-no-op comment explaining thatcan_set_qualityresolves tofalsefor 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:
"quality"appended toallowed_effects— enables area-wide distribution of the quality effect to nearby crafting machines.distribution_effectivityraised from0.5→1.5withdistribution_effectivity_bonus_per_quality_level = 0.2added — 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:
lab()function — creative labs keep the engine default (all effects except quality); a quality effect on a lab is inert.super_personal_roboport_equipment—charging_station_count_affected_by_qualitystays 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 intrinsicquality = 0.5baseline.super_quality_module_beacon_insertable: places a super-beacon and inserts the module; a returned count of 1 proves theallowed_effectsquality 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
super_beacon.allowed_effectsupdated with"quality"resultslist andfailed-zip tupleDeviations/surprises
distribution_effectivitybumped anddistribution_effectivity_bonus_per_quality_leveladded — the outline markeddistribution_effectivity_bonus_per_quality_levelas 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.machine.effects.quality.module >= 1.0(nested shape), butLuaEntity.effectsis 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
Items planned but not implemented
zh-CN,zh-TW) — explicitly deferred to translators per the outline's open question.How to verify it
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 ChestDescription 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).