Closed Tim2othy closed 2 months ago
I successfully tested a universe of size (100_000, 100_00)
. As an aside, if we're going to have huge universes, the gridline-draws will:
Drain a lot of performance in general, because the gridline-draw-code looks like this:
for x in range(0, int(width + 1), gridline_spacing):
camera.draw_hairline(grid_color, Vector2(x, 0), Vector2(x, height))
for y in range(0, int(height + 1), gridline_spacing):
camera.draw_hairline(grid_color, Vector2(0, y), Vector2(width, y))
i.e., it attempts to draw all the gridlines (but, in camera.draw_hairline
, only visible gridlines are drawn). The loops would have a lot of iterations per frame if the universe became larger, but -- using maths -- we can actually restrict the loop-range to a very narrow interval. I don't want to calculate those ranges right now.