Building a Game Around Handwritten Art

Most people think calligraphy games are just about drawing pretty letters on a touchscreen. The actual implementation is significantly more complex because stroke evaluation, timing, and pressure sensitivity all need to work together without making the player feel like they are playing a spelling test rather than a game. I spent about three weeks prototyping an early version where the scoring was based purely on pixel-perfect overlap against a reference character. It was unplayable. Anyone with shaky hands or a slightly different writing style would get scored at 40% even when the letter looked correct to the human eye. The core loop usually breaks down into three parts: the input capture, the stroke validation, and the reward feedback. For the input side you need gesture recognition that handles different pen thicknesses and variances in how quickly a player writes. The validation piece is where most projects fail. You cannot simply compare a live trace to a stored template. Calligraphy has directionality, stroke order, and weight variation that matter to the art form but break simple collision-based scoring systems. I ended up using a weighted graph approach where each stroke is broken into segments and compared not just on position but on the angle and velocity profile. A reference brush stroke in calligraphy starts slow, builds pressure in the middle, and lifts with a tapered finish. If the player matches that velocity envelope even loosely the stroke registers as acceptable. If they write it at a constant speed the system flags it as flat and uncontrolled. This is what actually separates a game that feels good from one that feels punishing for no reason.

For the reward layer you want immediate visual feedback that reinforces the skill being practiced. A common mistake is dumping all the score information at the end of a round. Players need to see their stroke quality in real time. I layered the feedback so the ink color shifts from dull gray to saturated black as the stroke quality improves, and the character outline pulses gently when a segment meets the threshold. This takes about ten minutes of tuning per letter set but it saves hours of player frustration later.

Tools and Technical Approach

Unity with the Input System package works well for this if you are targeting both mobile and desktop. The built-in touch tracking gives you position, velocity, and pressure data out of the box. For stroke comparison I used a modified Dynamic Time Warping algorithm adapted for pen input. DTW is normally used for audio signal comparison but it works surprisingly well for matching two sequences of coordinates that may vary in speed or length. The open-source version I modified runs in under two milliseconds per stroke on a mid-range phone, which keeps the loop responsive enough that the player never notices the computation happening. If you are going mobile you need to handle screen protector interference and palm rejection. A cheap tempered glass protector can add enough capacitance noise to make the pressure readings jump erratically. I solved this by adding a sliding window average filter over the raw pressure values. The filter smooths out the spikes without introducing noticeable lag because the window is only six frames and the frame rate is locked at 60fps. Without it the stroke evaluation gets noisy and players complain the game is randomly penalizing them.

Get the Full Details

How to make your own calligraphy worksheets – Artofit
How to make your own calligraphy worksheets – Artofit

Design Pitfalls That Waste Time

One thing beginners consistently mess up is over-scoring the technical accuracy at the expense of fun. A calligraphy game where every stroke has to be within five percent of the reference feels like practicing for an exam. The sweet spot is usually around sixty to seventy percent accuracy tolerance depending on the target audience. Casual players want to feel like they are getting better, not fail repeatedly because their handwriting does not match a professional standard. Another issue is stroke order enforcement. In many Asian calligraphy traditions the order matters fundamentally, and enforcing it incorrectly breaks the game flow. I ran into a case where the validation rejected a valid alternative stroke order that was accepted in the source text I was using as reference. The fix was to build a list of permissible order variations per character rather than a single hardcoded sequence. It adds about twenty percent more development time upfront but prevents the edge case where a player who knows the art form gets scored lower than someone who just happens to write in the exact expected order by chance.

What This Approach Cannot Do

The system described here works well for cursive and running script styles where continuous strokes dominate. It struggles with block lettering and heavily segmented scripts because the velocity profile becomes unpredictable when the pen lifts frequently between strokes. If your game targets those styles you need a different evaluation model, probably one based on individual stroke shape comparison rather than continuous gesture matching. I discovered this the hard way when trying to apply the same engine to printed typeface practice and getting garbage scores on anything that required deliberate pen lifts. There is also the problem of right-to-left scripts. The DTW comparison and angle calculations assume a left-to-right writing direction by default. Flipping the coordinate system works for basic positioning but the pressure modeling breaks because the natural writing motion is reversed. You need to mirror both the reference data and the input processing pipeline, not just the display. Skipping this step produces asymmetric scoring where one hand direction gets unfairly penalized.

What Actually Works in Practice

The version I shipped ended up using a tiered difficulty system where new players start with guided traces that fade into freehand mode. The guided portion uses a slightly wider tolerance band and provides a moving highlight that the player follows. Once they complete five strokes above the threshold the guide fades and the tolerance tightens to normal levels. This reduces the initial failure rate from about sixty percent to under fifteen percent in my testing, which is the difference between a player sticking around and deleting the app after the first session. For monetization and retention the unlock system works best when tied to script variety rather than cosmetic items. Players who learn one style tend to want to try another. Unlocking different alphabets or historical script types gives them a reason to return without requiring you to build entirely new game mechanics for each one. The stroke engine stays the same. You just swap in new reference data and adjust the tolerance curves per style. Building something functional takes roughly six to eight weeks for a minimum viable product if you already have experience with gesture recognition and Unity. Most of that time goes into tuning the evaluation thresholds and fixing the edge cases I mentioned above. The core engine itself is maybe two weeks of work. The rest is making sure the scoring feels fair across dozens of different handwriting styles without becoming so loose that accuracy does not matter at all.

How to Make Calligraphy Guidelines | Pen and paper, Lettering ...
How to Make Calligraphy Guidelines | Pen and paper, Lettering ...