[1.1.74] Furnace progress in quantum state after json migration

Post your bugs and problems so we can fix them.
Post Reply
User avatar
Stringweasel
Fast Inserter
Fast Inserter
Posts: 197
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

[1.1.74] Furnace progress in quantum state after json migration

Post by Stringweasel »

What
I'm changing the internal name of a furnace entity, and after the migration the previous crafting_progress is reset to zero and the machine idles.
- If I then add another burnable item of the same type then the progress starts at where it should have been (and not at zero)
- Or if I instead add a different burnable item then the progress starts at zero.

I would expect the furnace to continue burning the entity that was burning previously as if nothing changed, even though the internal name changed.

Note: I could not recreate the same behaviour with the vanilla furnace, the progress was always correct after the migration. But I could never get my modded furnace-type-machine to have the same effect. See first comment, I reproduced it by placing a single iron-ore in the furnace, letting it burn, and then migrating.
Reproduction
Attached is a `pre.zip` before migration, made with 0.3.0. As well as a `post.zip` which applied a migration contained in 0.3.1.

1. Open `post.zip` with 0.3.1. The game should be paused.
2. Notice both machines has a progress of zero. The items in the boxes is the same type that was burning in `pre.zip`.
3.a. Unpause, and after the inserter inserted the items notice the left machine start at around 80-ish% in the next tick, and right machine at 20-ish%.
4.b. Or rotate (delete) the inserters, and watch the machines stay idle after no input. (not expected)
4.c. Or insert some other allowed burnable item (different than what was being burned, as shown in the box) and notice the progress start at 0.
Attachments
factorio-current.log
(6.26 KiB) Downloaded 10 times
biter-power_0.3.0.zip
(7.51 MiB) Downloaded 12 times
post.zip
(814.83 KiB) Downloaded 7 times
pre.zip
(814.98 KiB) Downloaded 6 times
biter-power_0.3.1.zip
(7.51 MiB) Downloaded 7 times
Last edited by Stringweasel on Mon Jan 16, 2023 9:17 pm, edited 1 time in total.

User avatar
Stringweasel
Fast Inserter
Fast Inserter
Posts: 197
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

Re: [1.1.74] Furnace progress in quantum state after json migration

Post by Stringweasel »

Just reproduced it with the vanilla furnace. To get it into the quantum state I only added a single iron-ore which then started burning, meaning there was nothing in t

1. New map with a single electric-furnace (+ supporting structures)
2. Add a single iron-ore and pause the game before the iron is completely melted.
3. There should now be nothing in the input or output slots, but the progress bar should be in-progress.
4. Exit the game. Write a tiny mod that migrates the furnace (see below)
5. Enter game with migration, and witness furnace now in a quantum state.

Pretty sure for the migration to work correctly there needs to be items in the input-inventory. When I tested it initially I added an entire stack of ore and that worked as expected. Meaning migration doesn't work if the furnace is burning without an item in the input-inventory.

Quick code you can add to create and migrate to a new furnace.

Code: Select all

--new.json
{
        "entity":
        [
            ["electric-furnace", "n"]
        ]        
}

-- data.lua
require "util"
n = table.deepcopy(data.raw["furnace"]["electric-furnace"])
n.name = "n"
data:extend{ n }

Post Reply

Return to “Bug Reports”