its actually easy, conceptually. it can get rough when tracking multiple objects though.
Experiment with a matrix 1000x1000, 10x10 grids
Set the camera dead center looking down so you can see the entire thing....
Setup a basic matrix and texture it
now, as you move the camera accross the matrix, you need to check the position against the width of a tile. If the camera crosses a tile boundary, scroll the matrix one tile (back wards) and move it in the direction the camera moved (forewards).
Observer:
you notice that the grid under the camera "looks" the same, but the matrix will continously move in front of the the camera. Obviously, you can't play a game this way, but....
If the camera was at ground level, the fog and camera range were closer than the widht of your matrix, nobody will ever see the edges. And now, you have a playable world....
But, you will need to experiment with the above concept on the small scale to "learn" what's happening and how to handle it. Its alot trickyer than "just a natrix" but alot more useful.