Tactile Game Level Creator (TGLC) turns tabletop drawings and everyday objects into playable 2D platformer levels. Capture a scene, customize settings, then play the generated level in Unity. It aims to lower the barrier to level authoring for non-experts by using familiar hands-on interactions.
Demo video: https://drive.google.com/file/d/1St-wbC0KPDumuw-_we3f-Gaty572lLuQ/view?usp=sharing
- Capture (webcam): you take a photo of the physical tabletop layout.
- Segmentation + filtering: the perception step isolates the objects and extracts clean contours. It also produces session artifacts like an object-only RGBA (visual layer), a contour JSON (geometry layer), and planned spawn positions.
- Unity build: Unity consumes the contours/JSON to build the platform geometry and generate one-way edge colliders.
- Customize & preview: the system uses the same geometry plus the planned spawns so users can adjust visuals/gameplay and preview placement.
- Gameplay runtime: Unity instantiates the final level from those artifacts and runs the playable scene.
.
├── images/
│ ├── tglc_pipeline.png
│ └── capture_customize_play.png
├── segmentation/
│ ├── .venv/ # local python environment
│ ├── fastsam_segmentation_for_unity.py
│ ├── models/
│ │ ├── FastSAM-s.pt (or FastSAM-x.pt) # downloaded pretrained weights
│ └── archive/
│ ├── sam2_segmentation_for_unity.py
│ └── cv_segmentation_for_unity.py
└── unity/
└── TactileGameLevelCreator/
├── Assets/
├── Packages/
└── ProjectSettings/
-
Open the Unity project from:
unity/TactileGameLevelCreator -
Create a Python environment in
segmentation/:python3 -m venv segmentation/.venv -
Install dependencies:
segmentation/.venv/bin/python -m pip install ultralytics opencv-python pillow numpy -
Download
FastSAM-s.ptorFastSAM-x.ptand place it at:segmentation/models/Note: this project currently uses
FastSAM-s.ptas the default.FastSAM pretrained weights: https://docs.ultralytics.com/models/fast-sam/#available-models-supported-tasks-and-operating-modes
-
In Unity (
Capturescene), set:pythonExePath-> absolute path tosegmentation/.venv/bin/pythonsegmenterScriptPath-> absolute path tosegmentation/fastsam_segmentation_for_unity.py
-
Run capture flow in Unity. Outputs are written to the run directory created by
CaptureController.
- FastSAM: https://github.com/CASIA-IVA-Lab/FastSAM
- Ultralytics: https://github.com/ultralytics/ultralytics
- SAM 2 (reference/archived comparison): https://github.com/facebookresearch/sam2
- OpenCV: https://opencv.org/
- Unity: https://unity.com/

