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

This subforum contains all the issues which we already resolved.
Quezler
Long Handed Inserter
Long Handed Inserter
Posts: 75
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

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

Post 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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14469
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

Thanks for the report. This is now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”