Float 2D Array Data Limit

  • Your map is 64000x64000 pixels, 1600x1600 tiles, 160x160 xtiles, 16x16 regions.
  • A tile is 40x40 pixels.
  • An xtile is a group of 10x10 tiles, or 400x400 pixels. You can use those for deciding what to draw.
  • If your screen is 1600x1200 pixels, then it is 40x30 tiles, or 4x3 xtiles.
  • A region is 100x100 tiles, 10x10xtiles, or 4000x4000 pixels.
  • Your map data is stored in 256 files e.g. region_00x00, region_01x01… region_15x15.

Your loader loads and unloads regions from disk as you move around your map. Because a region is larger than a screen you can have up to 4 regions loaded at once by standing on a corner between them – but no more. Four regions is 40,000 tiles – significantly less than 2.5 million.

Are you using the ptmx or Sprites libraries? You don’t have to roll your own everything unless it is interesting / fun.

Also potentially of interest:

1 Like