← Back to Projects

Engineering Case Study

ChildGame

A 2D interactive educational coloring, tracing, and drawing game for preschool and early-learning audiences.

UnityC#ScriptableObjectsRenderTexturesMulti-touch

Role

Gameplay Programmer

Project Status

Educational Game Prototype

Technical Focus

Touch Interaction, Procedural Painting, Guided Tracing, Pixel Evaluation

Section 01

Project Demonstration

ChildGame educational coloring and tracing game prototype

Section 02

Media Gallery

ChildGame interactive drawing and coloring prototype
ChildGame project media showing the educational drawing and coloring experience.

Section 03

Project Overview

This project is a 2D interactive educational coloring, tracing, and drawing game built in Unity for preschool and early-learning audiences. Designed around a physical art-easel aesthetic in a playful classroom setting, the game features guided dot-to-dot line tracing, animated tap-to-fill flood coloring, and freehand multi-touch drawing across diverse template categories.

My work focused on engineering the core gameplay systems and rendering pipeline: building a modular, ScriptableObject-driven level and tool architecture, programming real-time procedural canvas painting on dynamic textures, implementing multi-touch input tracking with undo/redo command buffering, and developing a pixel-accurate color-coverage and boundary-spill calculation engine.

Section 04

Engineering Challenge

The primary challenge was building a high-performance, real-time 2D drawing and rasterization pipeline on mobile and touch displays that executes low-latency multi-stroke painting, flood fill, and live pixel analysis without causing frame drops or garbage collection spikes.

01

Architect a decoupled, ScriptableObject-driven pipeline to rapidly configure templates, star-tracing nodes, and color palettes without code changes.

02

Implement a responsive procedural texture painting and flood-fill engine supporting simultaneous multi-finger brush strokes.

03

Engineer a real-time pixel evaluation algorithm that dynamically computes coloring progress and boundary spill percentages.

04

Build a memory-efficient Undo/Redo history buffer that caches dynamic canvas texture states without inflating runtime RAM.

Section 05

System Architecture

The architecture relies on a data-driven ScriptableObject foundation and a decoupled component structure, isolating data definitions from the rendering canvas, input listeners, and evaluation logic.

MODULE 01

ScriptableObject Data Pipeline

Defines level templates, line-art vector masks, star waypoint sequences, and color palettes as modular ScriptableObject assets including LevelDataSO, BrushConfigSO, and PaletteSO.

MODULE 02

Dynamic Canvas & Procedural Painting Engine

Manages active RenderTextures and texture pixel buffers, blitting brush stamps, line-renderer meshes, and animated flood-fill shaders onto the easel surface.

MODULE 03

Guided Tracing & Waypoint Evaluator

Monitors player stroke trajectory against star waypoint nodes, enforcing progressive dot-to-dot connectivity with snap-to-point assistance and visual particle feedback.

MODULE 04

Color Coverage & Spill Detection Subsystem

Performs asynchronous pixel-mask comparisons against template alpha masks to continuously calculate target coverage and out-of-bounds line spill percentages.

Section 06

Gameplay Flow

Conceptual gameplay flow based on the supplied ChildGame architecture. It connects touch input, data-driven tool configuration, procedural canvas updates, and continuous accuracy evaluation.

STEP 01

Select template and tool

The player chooses a drawing template and an available brush, pencil, eraser, or fill tool.

STEP 02

Load level data

ScriptableObject assets provide the template masks, waypoints, brush configuration, and authorized palette.

STEP 03

Track touch input

Single or simultaneous multi-touch input is converted into canvas coordinates and stroke commands.

STEP 04

Paint or fill the canvas

The procedural painting pipeline updates the dynamic texture using brush stamps, interpolated strokes, or flood fill.

STEP 05

Evaluate coverage and spill

Pixel-mask comparisons calculate coloring progress and out-of-bounds spill for live feedback.

STEP 06

Provide feedback or undo

Tracing feedback, particles, HUD scores, and command-based undo or redo support the next player action.

Section 07

Technical Implementation

I engineered the gameplay and rendering subsystems needed to deliver an intuitive, responsive, and data-driven drawing experience.

01

Data-Driven Level Pipeline (ScriptableObjects)

Created a modular asset pipeline where LevelDataSO stores line-art textures, fill masks, star waypoint vectors, and authorized color palettes, allowing rapid level authoring in the Inspector without scene modifications.

02

Procedural Multi-Touch Painting & Blit Pipeline

Implemented brush-stamp splatting and line-interpolation algorithms that map touch coordinates to UV space on a dynamic RenderTexture, enabling multiple simultaneous pencils to draw smoothly without jagged gaps.

03

Pixel-Accurate Boundary Fill & Spill Calculator

Developed a multi-threaded pixel evaluation routine that compares canvas RGB buffers against pre-rendered stencil masks, outputting live Color % target-fill and Spill % out-of-bounds metrics in the HUD.

04

Memory-Efficient Command-Based Undo/Redo

Constructed an Undo/Redo stack using compressed texture delta buffers and stroke command objects, capping runtime heap allocations while allowing full history reversal across pencils, brushes, and paint buckets.

Section 07

Technical Deep Dive

Procedural multi-touch painting

Problem

Touch input can produce separated samples during fast movement or simultaneous strokes, resulting in jagged or incomplete lines if each sample is painted independently.

Solution

Map touch positions into canvas UV space, interpolate between samples, and apply brush stamps to the dynamic RenderTexture so continuous strokes remain visually connected.

Trade-off: Higher sampling and larger brush buffers improve continuity but increase texture work, so the pipeline must balance stroke quality with mobile rendering budgets.

Pixel-accurate coverage and spill feedback

Problem

A child-friendly drawing game needs immediate feedback about how much of a target is colored and whether the player has crossed outside its boundaries.

Solution

Compare canvas RGB buffers against pre-rendered stencil masks and expose live target coverage and boundary-spill values to the HUD.

Trade-off: Pixel analysis provides useful precision but can become expensive on large textures, making efficient buffers and appropriate evaluation strategies important for touch devices.

Section 08

Validation & Known Checks

Guided tracing

Method: Trace through star waypoint sequences using slow and fast touch movement.

Result: The evaluator should track progressive waypoint connectivity and provide the intended snap or feedback behavior.

Multi-touch painting

Method: Draw with simultaneous fingers across the dynamic canvas.

Result: Multiple brush strokes should remain responsive without visible gaps or incorrect input ownership.

Coverage and spill calculation

Method: Color inside and outside template boundaries while observing the live HUD metrics.

Result: Color coverage and out-of-bounds spill percentages should update from the canvas and stencil masks.

Undo and redo

Method: Reverse and restore sequences containing pencils, brushes, and paint-bucket actions.

Result: The command history should restore the expected canvas state without unnecessary texture-state duplication.

Section 09

Results & Key Learnings

Outcomes

  • Engineered a modular ScriptableObject level architecture that reduced new drawing template setup time to under 5 minutes.
  • Maintained a rock-solid 60 FPS on mobile devices with zero touch input latency during simultaneous multi-touch pencil strokes.
  • Implemented 4 distinct interactive tool modes: Guided Star Tracing, Tap-to-Fill Bucket, Freehand Pencils/Brushes, and Precision Eraser, backed by live accuracy scoring.

Key Learnings

  • How to structure game systems around ScriptableObjects to cleanly decouple designers' data authoring from runtime gameplay code.
  • Best practices for managing dynamic RenderTextures and GPU blits to avoid CPU readback bottlenecks in real-time painting games.
  • Techniques for implementing multi-touch gesture disambiguation and spatial interpolation for smooth drawing inputs.
  • How to write lightweight pixel comparison algorithms using downsampled alpha masks for instantaneous gameplay feedback.

Explore more engineering work.

View other projects or get in touch.