Logo
Published on

Charm Editor for Math Frenzy

Authors
  • avatar
    Name
    Ryan Flores
    Twitter

Math Frenzy is a math game where you answer arithmetic questions against the clock, and it gets crazy fast. To keep runs interesting, we added charms, which are items that bend the rules a little bit. Grab a charm and suddenly multiplication questions are worth double score, or you get an extra life, or the clock slows down by 15%.

Each charm is a bundle of data. Rarity, levels, effects, values, drop rate, and an icon. And like any good Unity project, they lived as ScriptableObjects.

The Problem: Death by a Thousand Assets

Here's what tuning a charm used to look like: find the asset in the project window, by searching for it by name, or finding it in a folder path (possibly misplaced), double-click it, tweak a value, find the next asset, repeat. Creating a new charm meant the same treasure hunt in reverse, plus making sure you didn't forget to wire anything up.

It worked, but it was slow for us to iterate on.

The Fix: One Window for All Charms

So I built a Charm Editor using Odin Inspector. Instead of hunting through the project window, we got a single all-in-one place to manage every charm in the game.

Open the editor, and you see all your charms, browse by icon or by name, click the one you want, and edit it right there. Creating a new charm happens in the same window.

Odin did most of the heavy lifting for rendering, which meant I could focus on the layout and workflow instead of fighting Unity's default inspector drawing. Speaking of which...

Bonus: A Friendlier Inspector

While I was at it, I customized the ScriptableObject inspector drawing itself. The default view was functional but ugly, and we were going to be staring at these assets a lot. A little customization went a long way toward making the whole thing feel like a real tool instead of a database with a UI stapled on.

It's a small thing, but when a tool looks nice, people actually want to use it, and a tool nobody wants to open is barely a tool at all.

Why This Mattered

The Charm Editor didn't add a single feature to the game. No player will ever see it. But it changed how fast we could iterate on game feel, tweak a drop rate, adjust an effect value, add a new charm idea in minutes instead of "we'll do it later."

This is my favorite kind of work. Building the thing that makes other developers faster, making a designer's life easier, reducing friction and manual work.

Every charm in Math Frenzy passed through that little editor window, and I think the game is better for it.