Fuel burnt result cycle and recipe cycle causes loading screen to hang

Place for things which are bugs but we have no idea how to solve them. Things related to hardware, libraries, strange setups, etc.
Post Reply
Hokome
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Mar 29, 2023 7:45 pm
Contact:

Fuel burnt result cycle and recipe cycle causes loading screen to hang

Post by Hokome »

The game gets stuck at 95% loading when you have two items that have each other as burnt result and two recipes that turn the items into each other. It happens if there are more than 3 items and if the cycles don't go the same way (a > b > c > a for fuel, a > c > b > a for recipe still breaks).

It might seem like a very niche thing and it kind of is but I actually encountered this bug by making a mod and it was what I was trying to do. Anyway I think it should at least throw an error even if the case isn't supported, instead of going into an infinite loop.

This is the whole data.lua code

Code: Select all

local function create_fuel(name)
    ---@type data.ItemPrototype
    local item = {
        type = "item",
        name = name,
        icon = "__base__/graphics/icons/solid-fuel.png",
        icon_size = 64,
        stack_size = 50,

        fuel_value = "10MJ",
        fuel_category = "chemical",
    }
    data:extend{item}
    return item
end
local function create_fuel_recipe(ingredient, product)
    ---@type data.RecipePrototype
    local recipe = {
        type = "recipe",
        name = product.name,
        ingredients = {
            { name = ingredient.name, amount = 1},
        },
        --Tried this to see if it would solve the problem but it didn't
        allow_as_intermediate = false,
        allow_decomposition = false,
        result = product.name,
    }
    data:extend{recipe}
    return recipe
end

local fuel_a = create_fuel("fuel-a")
local fuel_b = create_fuel("fuel-b")

create_fuel_recipe(fuel_a, fuel_b)
create_fuel_recipe(fuel_b, fuel_a)

fuel_a.burnt_result = fuel_b.name
fuel_b.burnt_result = fuel_a.name
Here is the log:

Code: Select all

   0.000 2024-04-22 13:06:22; Factorio 1.1.107 (build 62234, linux64, steam)
   0.058 Operating system: Linux (Linuxmint 21.3)
   0.000 Initializing Steam API.
   0.058 Program arguments: "/home/hokome/.steam/debian-installation/steamapps/common/Factorio/bin/x64/factorio" 
   0.058 Config path: /home/hokome/.factorio/config/config.ini
   0.058 Read data path: /home/hokome/.steam/debian-installation/steamapps/common/Factorio/data
   0.058 Write data path: /home/hokome/.factorio [328088/479118MB]
   0.058 Binaries path: /home/hokome/.steam/debian-installation/steamapps/common/Factorio/bin
   0.062 System info: [CPU: AMD Ryzen 5 5600H with Radeon Graphics, 12 cores, RAM: 15318 MB]
   0.062 Environment: DISPLAY=:0 WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=cinnamon XDG_SESSION_DESKTOP=cinnamon XDG_CURRENT_DESKTOP=X-Cinnamon __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
   0.062 Display options: [FullScreen: 1] [VSync: 1] [UIScale: automatic (100.0%)] [Native DPI: 1] [Screen: 255] [Special: lmw] [Lang: en]
   0.067 Video driver: x11
   0.067 Available displays: 2
   0.067  [0]: VG27A 27" - {[0,0], 2560x1440, SDL_PIXELFORMAT_RGB888, 144Hz}
   0.067  [1]: 1 - {[2560,0], 1920x1080, SDL_PIXELFORMAT_RGB888, 60Hz}
   0.169 Initialised OpenGL:[0] RENOIR (renoir, LLVM 15.0.7, DRM 3.42, 5.15.0-105-generic); driver: 4.6 (Core Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2
   0.169   [Extensions] s3tc:yes; KHR_debug:yes; ARB_clear_texture:yes, ARB_copy_image:yes
   0.169   [Version] 4.6
   0.169 Graphics settings preset: medium-with-low-vram
   0.169   Dedicated video memory size 512 MB
   0.184 Graphics options: [Graphics quality: normal] [Video memory usage: high] [DXT: low-quality] [Color: 32bit]
   0.184                   [Max threads (load/render): 32/8] [Max texture size: 4096] [Tex.Stream.: 1] [Rotation quality: low] [Other: stDCwt] [B:0,C:0,S:100]
   0.506 [Audio] Backend:SDL(default); Driver:pulseaudio, Device:Default device, Depth:16, Channels:2, Frequency:44100
   0.766 Loading mod settings EditorExtensions 2.2.4 (settings.lua)
   0.767 Loading mod core 0.0.0 (data.lua)
   0.793 Loading mod base 1.1.107 (data.lua)
   0.902 Loading mod chromatic 0.0.1 (data.lua)
   0.910 Loading mod flib 0.14.0 (data.lua)
   0.917 Loading mod EditorExtensions 2.2.4 (data.lua)
   0.937 Loading mod base 1.1.107 (data-updates.lua)
   0.949 Loading mod EditorExtensions 2.2.4 (data-final-fixes.lua)
   1.017 Checksum for core: 607699937
   1.017 Checksum of base: 1054619811
   1.017 Checksum of chromatic: 386015871
   1.017 Checksum of flib: 1790189614
   1.017 Checksum of EditorExtensions: 3840276693
   1.174 Prototype list checksum: 2553426155
   1.214 Loading sounds...
   1.267 Info PlayerData.cpp:78: Local player-data.json unavailable
   1.267 Info PlayerData.cpp:81: Cloud player-data.json available, timestamp 1713782332
   1.373 Initial atlas bitmap size is 4096
   1.380 Created atlas bitmap 4096x4096 [none]
   1.384 Created atlas bitmap 4096x4092 [none]
   1.386 Created atlas bitmap 4096x4084 [linear-minification, linear-magnification]
   1.388 Created atlas bitmap 4096x4088 [none]
   1.391 Created atlas bitmap 4096x4096 [none]
   1.394 Created atlas bitmap 4096x4096 [none]
   1.394 Created atlas bitmap 4096x508 [none]
   1.394 Created atlas bitmap 4096x2120 [decal]
   1.398 Created atlas bitmap 4096x4016 [low-object]
   1.398 Created atlas bitmap 4096x1792 [low-object]
   1.398 Created atlas bitmap 4096x2464 [mipmap, linear-minification, linear-magnification, linear-mip-level]
   1.398 Created atlas bitmap 4096x2272 [terrain, mipmap, linear-minification, linear-mip-level]
   1.398 Created atlas bitmap 4096x1152 [terrain-effect-map, mipmap, linear-minification, linear-mip-level]
   1.398 Created atlas bitmap 4096x1664 [smoke, mipmap, linear-minification, linear-magnification]
   1.398 Created atlas bitmap 4096x928 [mipmap]
   1.400 Created atlas bitmap 4096x4096 [icon, not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level]
   1.400 Created atlas bitmap 4096x768 [icon, not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level]
   1.400 Created atlas bitmap 2048x684 [alpha-mask]
   1.407 Created atlas bitmap 4096x4096 [shadow, linear-magnification, alpha-mask]
   1.411 Created atlas bitmap 4096x4092 [shadow, linear-magnification, alpha-mask]
   1.415 Created atlas bitmap 4096x4092 [shadow, linear-magnification, alpha-mask]
   1.415 Created atlas bitmap 4096x3124 [shadow, linear-magnification, alpha-mask]
   1.415 Created atlas bitmap 4096x1328 [shadow, mipmap, linear-magnification, alpha-mask]
   1.416 Created atlas bitmap 2048x240 [icon-background, not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level, ]
   1.429 Created virtual atlas pages 4096x4096x2
   1.436 Texture processor created (2048). GPU accelerated compression Supported: yes, Enabled: yes/yes. Test passed. YCoCgDXT PSNR: 35.83, BC3 PSNR: 33.82
   1.579 Parallel Sprite Loader initialized (threads: 11)
   3.403 Sprites loaded
   3.410 Generated mipmaps (3) for atlas [8] of size 4096x4016   
   3.414 Generated mipmaps (3) for atlas [9] of size 4096x1792   
   3.417 Generated mipmaps (3) for atlas [10] of size 4096x2464   
   3.420 Generated mipmaps (3) for atlas [11] of size 4096x2272   
   3.423 Generated mipmaps (3) for atlas [12] of size 4096x1152   
   3.428 Generated mipmaps (3) for atlas [13] of size 4096x1664   
   3.436 Generated mipmaps (3) for atlas [14] of size 4096x928   
   3.441 Generated mipmaps (5) for atlas [15] of size 4096x4096   
   3.445 Generated mipmaps (5) for atlas [16] of size 4096x768   
   3.447 Generated mipmaps (3) for atlas [22] of size 4096x1328   
   3.456 Custom mipmaps uploaded (1964)
   3.537 Generated mipmaps for virtual atlas of size 4096x8192
   3.548 Custom inputs active: 5

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Fuel burnt result cycle and recipe cycle causes loading screen to hang

Post by Rseding91 »

Thanks for the report however when I try the code you've provided it loads to the main menu without any issues.

I suspect the actual issue is related to the top few lines of the log file (you're running linux) and or this line in the log file:
0.169 Dedicated video memory size 512 MB
95% is where the final graphics portions are finished and sounds are finished loading. So it might also be sounds related.
If you want to get ahold of me I'm almost always on Discord.

Hokome
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Mar 29, 2023 7:45 pm
Contact:

Re: Fuel burnt result cycle and recipe cycle causes loading screen to hang

Post by Hokome »

The dreaded "it works on my machine" :lol:

That might be because I'm on linux yeah, but what I can tell is that if I don't have these fuel cyclic references the game loads fine. So maybe it only causes problems on linux but I think those recipes and fuels are what causes something to break further down the line. Is there anything I can do to help track the bug down?

Also I tried removing editor extensions just in case and it didn't help.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Fuel burnt result cycle and recipe cycle causes loading screen to hang

Post by Rseding91 »

Does it happen with *just* the changes you have here (no other mods?) If no, can you zip up your mods folder and upload it here?

There are no code differences between the linux build and the windows build when it comes to this logic.

ALSO, prototypes are already loaded and fully finished before graphics starts loading (around 30% in the progress bar). Maybe it's related to some mod(s) you're using increasing the graphics load which exceeds what your system can handle?
If you want to get ahold of me I'm almost always on Discord.

Hokome
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Mar 29, 2023 7:45 pm
Contact:

Re: Fuel burnt result cycle and recipe cycle causes loading screen to hang

Post by Hokome »

The only mod I was using was editor extensions (and flib) but even after disabling those, the change persists. I just tried to make a new mod and have only data.lua and info.json (before I still had the other files even if I commented out all the 'requires') and the problem is still here so it has to be these lines of code.

Just in case I put the actual mod in the attachments but appart from the info.json there's nothing new in it.

I played mods with heavy amounts of content like SE and Py mods without issue before too so I know unless something is filling up VRAM indefinitely or something so there's no way I don't have enough performance to at least load one small mod.

(also if needed I'm available on discord, username in the mod file)
Attachments
bug-test_0.0.1.tar.gz
Full mod
(679 Bytes) Downloaded 9 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Fuel burnt result cycle and recipe cycle causes loading screen to hang

Post by Rseding91 »

Loads up without issue for me. Do you have any other computer available you can test on?
Attachments
Untitled.png
Untitled.png (1.46 MiB) Viewed 253 times
If you want to get ahold of me I'm almost always on Discord.

Hokome
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Mar 29, 2023 7:45 pm
Contact:

Re: Fuel burnt result cycle and recipe cycle causes loading screen to hang

Post by Hokome »

I can try on a Windows VM, my other computer is broken so I can't test with other hardware.

Edit: Nevermind I don't think I can, it's a lot harder than I expected.

Post Reply

Return to “1 / 0 magic”