feat: quality system compatibility — matter source/void quality filtering + entity health scaling#61
Merged
jodli merged 4 commits intoJun 30, 2026
Conversation
Swap the level-0 entity.prototype.get_max_health() reads on the "restore to full" paths to the quality-aware instance read entity.max_health, via a shared util.restore_entity_to_full_health helper. Covers repair-mined-item, the entity full-health cheat (write + "is it full?" comparison), and the healer wand (character flat bonuses layered on the quality-aware ceiling). A legendary entity now restores to 100%, not the normal-quality value. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert item-providers-util's filter_item_name string parameter to a
quality-bearing {name, quality} filter object threaded end-to-end, and
stop the four matter shims (item-void, item-source, duplicator,
random-item-source) from stripping .name/.quality. Output, duplicate,
slot-fill, transport-line, and ground-drop stacks now carry quality;
removal paths compare quality.
Matter Void semantics: filter quality set -> that quality only; filter
present but quality unset -> all qualities of the name; no filter ->
everything. Source/Duplicator/Random output at the configured quality.
Adds verify.py behavior assertions matter_source_outputs_quality,
matter_void_targets_quality, and matter_void_unset_quality_removes_all.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Thread quality through the fills that synthesize their own item stacks rather than going through the item-providers-util engine: the old creative chest fill, the Duplicating Chest locked-item fill and copy-paste insert (via a new locked_item_quality field), the Creative Lab fill, the Autofill Requester Chest fill, and the keep-last-item cheat. Each now produces a stack carrying the configured/source quality instead of defaulting to normal. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Creative Lab - Build the runtime refill list from the lab's own lab_inputs instead of the "tool" prototype type, which Factorio 2.1 removed (science packs are now plain items), so the lab auto-refills again. - Derive the lab inputs and the void-technology ingredients from real labs' inputs rather than the "science-pack" subgroup, keeping non-pack items that merely share that subgroup (coin, the "science" pictogram) out. Both must change together: the void technology required those items and the buggy lab was the only lab that satisfied it. Dead code / migration - Delete the orphaned creative-chest.lua and creative-provider-chest.lua (never required, their tick() functions were never called). - Remove the v1.8.1 old->new chest conversion migration; no save predates it. Autofill Requester Chest - Remove the feature entirely (script, require, tick, clear-on-mine, storage, register hooks, prototypes, item, recipe, setting, defines, and locale). It was already dead: its tick was commented out and called an undefined helper. verify.py static + full behavior suite pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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 | PR Walkthrough
What problems was I solving
Space Age players with CreativeMod encountered four quality-system failures in Factorio 2.0+:
repair-mined-itemcheat calledentity.prototype.get_max_health()which always returns the normal-quality ceiling, not the quality-scaled instance maximum.item-providers-util.luaaccepted a{name, quality}filter table but immediately passed onlyfilter.namedownstream, producing normal-quality stacks regardless of what quality the player configured.data.raw["item"]and matchingsubgroup == "science-pack", a subgroup that no longer reliably maps to lab inputs.What user-facing changes did I ship
scripts/cheats.lua— Repair-mined-item and entity-full-health cheat restore to quality-scaled max HPscripts/magic-wand-healer.lua— Healer wand now heals quality entities to their actual 100%scripts/item-providers-util.lua— Matter Source outputs items at the configured quality; Matter Void removes only the configured quality tier (or all tiers if no quality is set)data-final-fixes.lua— Creative Lab accepts all science packs againHow I implemented it
Step 1 — Quality-aware health restoration
Added
scripts/util.lua+10: a singleutil.restore_entity_to_full_health(entity)helper that setsentity.health = entity.max_health. Theentity.max_healthproperty is Factorio 2.0's quality-aware instance ceiling — it already folds in the quality multiplier.Wired through:
scripts/cheats.lua— repair-mined-item and the "set entity to full health" cheatscripts/magic-wand-healer.lua— healer wand HP ceilingscripts/global-util.lua— shared restore pathsStep 2 — Thread quality through the matter provider spine
scripts/item-providers-util.lua: Thefilter_item_namestring parameter was replaced with a{name, quality?}filter table throughout all internal helpers. Every output stack, duplicate call, slot fill, transport-line fill, and ground-drop path now receives and passes on the full object.Matter Void semantics codified: filter quality set → remove only that quality; filter present but quality nil → remove all qualities of that name; no filter → remove everything.
Callers updated to stop splitting off
.name:scripts/item-void.luascripts/item-source.luascripts/duplicator.luascripts/random-item-source.luascripts/gui-entity.luaStep 3 — Standalone edge fills
Fills that synthesize stacks directly (bypassing
item-providers-util) were updated:scripts/creative-chest-util.luascripts/duplicating-chest-util.lua— newlocked_item_qualityfieldscripts/creative-lab.luaStep 4 — Creative Lab fix + dead code removal
data-final-fixes.luaandprototypes/technology.lua: Input lists now derived fromdata.raw["lab"][*].inputs(excluding the creative and void labs themselves) rather than thescience-packsubgroup. The void-technology ingredient list is built the same way.Dead code removed in full:
scripts/autofill-requester-chest.luadeleted (99 lines)scripts/creative-chest.luaandscripts/creative-provider-chest.luadeleted (16 lines each)scripts/events.lua−128 lines of autofill hook registrationsDeviations from the plan
No plan file found in task directory. The work was guided by a structure outline (
05-structure-outline-quality-compatibility.md) and design discussions. The implementation follows the outline phases closely.How to verify it
Setup
Automated Tests
uv run verify.py all # Expected: RESULT: all=PASS (27 behavior assertions, static, load)Manual Testing
Description for the changelog
Fix quality-system compatibility: entity health scaling (repair/healer), Matter Source/Void quality filtering, and Creative Lab refill broken in Factorio 2.1; remove non-functional Autofill Requester Chest.