   Seamless or paged rendering
  I am trying to accomplish a 2d rendering system in which each map in the world will load up next to the one currently being rendered. The overall goal and effect is to have an endless world. I've taken into account several things:Terrain data will need to be streamed in (Can't have 50 256x256 maps loaded at once)I have to take into account the fact that rendering on a corner is going to involve several render calls and lots of math.My approach:To take a single 2d array and stream the map data from multiple zones into this array to make one broad render call that takes care of it.Where I am stuck:Either writing the code to pull data from the separate maps into the render array or to render multiple maps at once in their respective positions. I can't figure out the math for either. I can get this to work in a very hacky way which involved resetting camera positions at precise times to make it appear like and endless world.Any and all help/suggestions/thoughts would be greatly appreciated.   
Quote:Original post by wcmcculloughTerrain data will need to be streamed in (Can't have 50 256x256 maps loaded at once)Can't because you don't want to? 256*256*4 bytes * 50 = 12.5 MB. Conceivably you can load a 32x32 grid of 256x256 textures which would be the same as loading an 8192x8192 texture which is what newer hardware allows (or 16384^2 or something).Going back to your problem though. Have you ever written a tile game? Grab some graph paper or draw a grid where each cell is a 256x256 texture and (0, 0) is at the top left. Now inside that grid draw a rectangle that's 1280x1024 (or some resolution) that represents the screen. You'll notice it has an offset from (0, 0). Now figure out which textures you need to load and how to render them in respect to the camera you've made.The top left part of the camera starts in (int(camera.x / cellSize), int(camera.y / cellSize)) and the bottom right is (int((camera.x + camera.width) / cellSize), int((camera.y + camera.height) / cellSize)). By iterating through these using a technique like:topLeft = (int(camera.x / cellSize), int(camera.y / cellSize));bottomRight = (int(camera.x / cellSize), int(camera.y / cellSize));for (int y = topLeft.y; y <= bottomRight.y; ++y){  for (int x = topLeft.x; x <= bottomRight.x; ++x)  {    // this iterates through all of the cells the camera is currently viewing  }}You can use this technique also to find all of the cell textures that you should have currently loaded. (Make the camera bigger on all sides so that you iterate tiles outside of the camera's view).Rendering is simple actually. You render the tiles you iterated under the camera with the offset (-camera.x, -camera.y).I'm assuming though that you know how to load and unload textures from the GPU which is all that's really required. (Not sure if loading them in the main loop will cause lag spikes, but there's only one way to find out).   ;  I appreciate your response but I know how to render tile maps. The issue that I stated above is regarding rendering multiple maps in together in a seamless fashion to give the impression of an endless world.   ;  I am going to go with the option of rendering multiple zones next to each based on their appropriate location.   