Page 1 of 1

[Rseding91] [2.0.23] LuaSurface::force_generate_chunk_requests() works differently than advertised

Posted: Mon Dec 02, 2024 11:56 am
by Quezler
surface.orce_generate_chunk_requests() is advertised as:

Code: Select all

Blocks and generates all chunks that have been requested using all available threads.
when you create a new lab tile world, and then request a chunk to generate + force generate + set tiles all the same tick the concrete gets overwritten:

Code: Select all

-- *new 50x50 world*
-- /c game.create_surface("lab").generate_with_lab_tiles = true
-- /c game.print(game.surfaces["lab"].get_tile(0, 0).name) -- luatile invalid
-- /c game.surfaces["lab"].request_to_generate_chunks({0, 0}, 0) game.surfaces["lab"].force_generate_chunk_requests() game.surfaces["lab"].set_tiles({{position = {0, 0}, name = "concrete"}})
-- /c game.print(game.surfaces["lab"].get_tile(0, 0).name) -- lab dark 1
when you do not set the surface to lab tile mode the resulting tile is concrete as expected:

Code: Select all

-- *new 50x50 world*
-- /c game.create_surface("default")
-- /c game.print(game.surfaces["default"].get_tile(0, 0).name) -- luatile invalid
-- /c game.surfaces["default"].request_to_generate_chunks({0, 0}, 0) game.surfaces["default"].force_generate_chunk_requests() game.surfaces["default"].set_tiles({{position = {0, 0}, name = "concrete"}})
-- /c game.print(game.surfaces["default"].get_tile(0, 0).name) -- concrete
if i had to point fingers i'd blame the "processed < 10" check somewhere in MapGenerationManager.cpp, but i have not confirmed its value or desired loops.

Re: [Rseding91] [2.0.23] LuaSurface::force_generate_chunk_requests() works differently than advertised

Posted: Mon Dec 02, 2024 3:31 pm
by Rseding91
Thanks for the report. This is now fixed for the next release.