# Tilemap Level Layout Math

Use tile size, room dimensions, camera view, collision cells, and traversal time to design one readable 2D room before painting a large map.

## Outcome
Sketch and build a one-room Godot tilemap where the player can see the route, collide with solid cells, reach a goal, and explain the scale.

## Safe first step
Write tile size, viewport size, room tile count, solid/passable cell rules, and one route before decorating the map.

## Ladder steps
### 1. Choose the tile size
A tile size turns the map into measurements instead of decoration.

Check: Room pixels, speed, camera view, and collision cells can all be compared.

### 2. Draw the room grid
One room is enough to prove scale, route, goal, and camera framing.

Check: The room has a start, route, obstacle, goal, and visible viewport.

### 3. Mark collision cells
Separate solid walls, passable floor, hazards, gaps, and goal triggers before polishing tiles.

Check: A reader can tell which cells block movement and which cells only decorate.

### 4. Check camera and traversal time
The player should see enough of the route and reach the goal at a readable pace.

Check: Viewport size, room size, and movement speed produce a sensible first pass.

## Examples
### Convert tiles to pixels
```sh
16 px tiles, 30 x 18 room
```
Expected signal: Room size is 480 x 288 px

### Compare room to camera
```sh
viewport 320 x 180, room 480 x 288
```
Expected signal: The room is about 1.5 screens wide and 1.6 screens tall

### Estimate traversal time
```sh
speed 120 px/s across 480 px
```
Expected signal: A straight crossing takes about 4 seconds

## Common traps
- Painting a huge level before one readable room works.
- Mixing decorative tiles and collision rules without labels.
- Choosing a camera view that hides the next safe jump or goal.
- Changing player speed before checking tile size and room scale.

## Practice task
Use the widget to choose tile size, room dimensions, viewport size, and movement speed. Copy the note, then build one room with floor, wall, gap, goal, and camera limits.

## Next steps
- Save the Obsidian note with [[Godot]], [[TileMapLayer]], [[TileSet]], [[Collision]], [[Camera2D]], [[Viewport]], [[Tile Size]], [[Level Design]], and [[Game Loop]] backlinks.
- Use the sprite game loop lesson when animation state is the next blocker.
- Use vectors when enemy movement, knockback, or target direction starts to matter.
- Use trigonometry when rotating hazards, arcs, or radial layouts appear.
- Use source video notes to preserve tilemap settings and timestamps beside the build.

## Related
- [Sprite-animated 2D game loop](/learn/games/sprite-animated-2d-game-loop/)
- [Build a first Godot game loop](/projects/build-first-godot-game-loop/)
- [Godot first playable loop](/learn/godot-first-playable-loop/)
- [Godot collision debugging basics](/learn/godot-collision-debugging-basics/)
- [Calculus for game motion](/learn/math/calculus-for-game-motion/)
- [Vectors for maker projects](/learn/vectors-for-maker-projects/)
- [Trigonometry for rotation and layout](/learn/trigonometry-for-rotation-and-layout/)
- [Turn source videos into notes](/video-notes/)
- [Review Anki-compatible decks](/decks/)

## Obsidian backlinks

Use these wiki links to connect this note inside a local maker vault:

- [[TopicLadder]]
- [[Maker Learning]]
- [[Tilemap Level Layout Math]]
- [[Games and Interactive Tools]]
- [[game-dev]]
- [[project-path]]
- [[Choose the tile size]]
- [[Draw the room grid]]
- [[Mark collision cells]]
- [[Check camera and traversal time]]
- [[Sprite-animated 2D game loop]]
- [[Build a first Godot game loop]]

## Source and next routes

Source: https://topicladder.com/learn/games/tilemap-level-layout-math/

- [Sprite-animated 2D game loop](/learn/games/sprite-animated-2d-game-loop/)
- [Build a first Godot game loop](/projects/build-first-godot-game-loop/)
- [Godot first playable loop](/learn/godot-first-playable-loop/)
- [Godot collision debugging basics](/learn/godot-collision-debugging-basics/)
- [Calculus for game motion](/learn/math/calculus-for-game-motion/)
- [Vectors for maker projects](/learn/vectors-for-maker-projects/)
- [Trigonometry for rotation and layout](/learn/trigonometry-for-rotation-and-layout/)
- [Turn source videos into notes](/video-notes/)
