Page 1 of 1

chart_all ignores unvisited surfaces

Posted: Sat Jan 27, 2024 6:14 pm
by SupplyDepoo
The chart_all method won't chart surfaces until the player has teleported to them, even when the surface name is specified.

Reproduction steps:
  1. Start a new freeplay scenario with default settings.
  2. Create a new surface and try to chart a large area:
  3. /c game.create_surface("test")
  4. /c game.surfaces["test"].request_to_generate_chunks({0, 0}, 20)
  5. /c game.player.force.chart_all("test")
  6. /c game.player.teleport({0, 0}, "test")
  7. Open the map and notice that only a tiny area is charted.

Re: [1.1.101] chart_all ignores unvisited surfaces

Posted: Mon Jan 29, 2024 2:38 pm
by Loewchen
No chunks have been generated so no chunks will be charted.

Re: chart_all ignores unvisited surfaces

Posted: Wed Jan 31, 2024 6:12 pm
by SupplyDepoo
The chunks are definitely generated, with the following evidence:
  1. There is perceptible lag when request_to_generate_chunks is called with a large radius like 20 chunks.
  2. The on_chunk_generated event is raised for those chunk positions.
  3. The function is_chunk_generated returns true for those chunk positions.
  4. Using chart(surface, area) instead of chart_all(surface) yields the expected result. The attached video shows the difference.


But if I teleport to the surface before chart_all() is called, then it does chart all of the chunks:
teleport_before_chart_all.gif
teleport_before_chart_all.gif (2.49 MiB) Viewed 770 times
So the behaviour between chart() and chart_all() differs depending on if I go to the surface beforehand, which is unexpected and I would say a bug.

Re: chart_all ignores unvisited surfaces

Posted: Thu Feb 01, 2024 3:25 pm
by Rseding91
Thanks for the report. This is now fixed for the next release.