Battle map grid not lining up in Foundry or Roll20
The squares on your battle map drift away from the VTT grid. Here is why, how a GM can fix it, and what a map seller can ship to prevent it.
Why it happens
A virtual tabletop draws its own grid over your image. It needs two facts to line up with yours: how many pixels make one square, and where the first square starts.
- Foundry VTT defaults to 100 pixel squares, with a minimum of 50. It assumes the grid starts at the top-left corner of the image. Its media guide asks for a map that covers a whole number of squares: "a scene of 20 x 20 squares at 100px grid scale should have a map image of 2000x2000(px)".
- Roll20 works on a 70 pixel baseline. By default, every 70 pixels is one 5 ft cell.
So the grid drifts when the image has a border or margin, when it is not a whole number of squares, or when the pixels per square in the VTT differ from the art. Sources: Foundry, Scenes, Foundry, Media and Roll20, Page Settings.
Fix 1, free: align it in Foundry
- Count the squares across and down. Divide the image size by them. Foundry's own example is a 3080 by 2520 pixel map with 22 by 18 squares, which gives 140 pixel squares.
- Put that number in Grid Size. If the art has a margin, use the Offset fields to shift the image by a number of pixels.
- Still off? Use the Grid Alignment Tool, the angled-ruler icon to the right of the Grid Type dropdown.
Do this before you place walls and lights. Foundry warns that changing the grid size later "may change the alignment of walls, lights, notes, and tiles".
Fix 2, free: align it in Roll20
Open the Map Layer and choose Align to Grid on the hotbar. The new tool has three steps: anchor on a grid corner, scale a sample grid to match the printed one, then drag to correct drift. The page then resizes to fit the map. The legacy 3 by 3 trace tool is still offered. Source: Roll20, Sizing and Aligning Maps.
Fix 3, free: what a map seller should ship
- Make the image a whole number of squares, with the grid flush to the edges. No border.
- Ship a gridless version. Foundry's guide says to leave the grid out of the image so users can pick their own grid or play gridless.
- Write the squares across, squares down and pixels per square in the file name or a short readme.
- Use WebP. Foundry calls it "the current best-in-class image file format for Foundry VTT usage". Roll20 accepts static WebP only, and suggests quality 90 as a start for lossy WebP (Roll20, Converting to WebP).
There is no single right pixels-per-square value. Foundry defaults to 100 and Roll20 counts in 70, so state yours and let the buyer set it once.
Fix 4, paid: build the pack with a tool
I make Map Pack Press ($12, with a free sample pack you can open in your VTT first). You load up to 12 clean maps, set columns, rows and pixels per square, and check the grid over the art before export. It writes one ZIP with gridded and gridless WebP pairs, a SETUP.txt with the Foundry and Roll20 scene settings, and a CSV list of the maps.
It needs clean art with no grid already drawn in, and all maps in one run must share the same proportions. It does not fix a map whose printed grid is already off, does not build Foundry scenes, walls or lights, and was tested in desktop Chrome on Windows only. If you sell one map now and then, Fix 3 by hand is enough.
Which one to use
- You are the GM with a bought map in Foundry: Fix 1.
- You are the GM in Roll20: Fix 2.
- You sell maps: Fix 3 always. Fix 4 if you ship gridded and gridless pairs often and want the setup notes written for you.