// TRANSMITTED: MAY 30, 2026 3 min read

Developing Pattern Recognition in Godot 4.4 Part 1

Game Development

A few days ago, I tried the doodle games from Google. Originally, I was just playing the Champion Island game, where a cat competes in different sports. But there’s also an easter egg in it — a simple one actually, which leads to another Google game: the Halloween game.

Image

What makes the Halloween game unique is its approach. Since the main character is a witch, to cast spells, you have to move her wand, and then the spell comes out. The gameplay is similar to Typer Shark, but instead of typing, you’re drawing.

As a soon-to-be unemployed game developer (since I’m about to graduate, lol), I figured why not try remaking this project? It could be a good portfolio piece and hopefully help me land a job quickly.

My first idea was: since this is drawing and the output is classification, just use a CNN. Why CNN right away? Because back in college, whenever we had an AI topic, the answer was always “deep learning.”

But there’s a problem with using CNN directly:

Will it even run in Godot? Are there libraries like TensorFlow or PyTorch that can run inside Godot? If the trained model is too heavy, then it won’t run optimally in the game. Meanwhile, the Halloween game can run even on a potato phone. After googling around (and arguing with ChatGPT, lol), I remembered that in the AI hierarchy, deep learning is the innermost layer. But there are simpler machine learning algorithms above it that are still worth trying.

Note: I also remembered that even a program that calculates averages technically counts as AI. My understanding of AI got messed up because I kept seeing advanced generative AI and forgot the basics.

Anyway, I found a lightweight algorithm called “One Dollar Recognizer.” At first, I thought it was some paid plugin (and no way I’d pay, lol). I chose Godot in the first place because if I succeed as a game dev, I won’t have to pay royalties like with Unity or Unreal.

Image

But turns out, it’s free. It’s called “One Dollar” because the algorithm is cheap and lightweight.

There are variations like $P, $Q, and so on, but for now I’m trying just the One Dollar algorithm.

Here’s how it works:

  • The drawn stroke is represented as a set of joints (an array of Vector2).
  • Resample → Normalize the number of joints to a fixed count (e.g., 64 points evenly spaced).
  • Rotate → Rotate the stroke so it’s aligned to 0 degrees.
  • Scale → Normalize it to fit into a fixed dimension box.
  • That’s enough for building the template.

    For recognition, there’s one extra step:

    Compare the processed stroke (steps 1–3) against all templates and find which one has the smallest distance between points. I already built this pipeline.

    And the result was…

    Totally inaccurate :’)

    At first, I thought maybe it was because I only had a few templates. But even after adding 50 templates, it actually got worse. I have no idea why.

    Image

    The algorithm itself, I copied straight from the pseudocode in the paper (with ChatGPT’s help to convert pseudocode into GDScript, lol). Maybe I missed something because I was too lazy to read the full paper, and just jumped to the pseudocode, skipping over the details.

    Next, I’ll probably try other variations of the algorithm. And if those don’t work, maybe then I’ll finally move to CNN.

    If anyone with more experience has advice, I’d really appreciate it. Thanks!

    References

    Paper: One Dollar Unistroke Recognizer https://depts.washington.edu/acelab/proj/dollar/index.html

  • Repository: Draw Magic Symbolhttps://github.com/keriz21/draw-magic-symbol

  • Reza Ali Nirwansyah

    REZA ALI NIRWANSYAH

    // UNIT-01 PROTOCOL ENGINEER

    REZA ALI NIRWANSYAH

    Full-stack engineer & game developer. Building highly mechanical digital experiences.


    © 2026 REZA ALI NIRWANSYAH. ALL RIGHTS RESERVED. BUILT WITH SVELTE 5 & TAILWIND V4 • UNIT-01 PROTOCOL