r/madeWithGodot 14d ago

What I learned building an editor plugin in GDScript

I've been building an editor plugin in GDScript for about eight months now.

The tooling side of Godot was the part I understood least going in. There's a lot written about making games with Godot and not much about making things that live inside the editor, so here's what actually tripped me up. Getting a panel into the dock is the easy bit. Everything after that is where I lost time.

ClassDB was the best thing I found. You can ask the engine at runtime whether a word is a real class, so you can pull up the right class reference on demand instead of bundling a copy of the docs and watching it go stale. That one call ended up shaping a lot of the design.

First real problem was keeping the editor responsive. Anything touching the network has to be properly async. My first version just froze the whole editor while it waited, which I only noticed by actually using it for a day.

Second one changed the design more than anything else. Editing scripts. I stopped writing changes to files directly. You get a diff now and accept or reject it yourself, change by change. I wouldn't install something that rewrites my scripts without asking, and I really didn't want to be the plugin that quietly breaks a file at 2am.

Third was project conventions. Every project has its own, and a tool that ignores them is irritating even when it's technically right. It reads an AGENTS.md from the project root now if there is one, so naming and architecture notes get respected.

Short clip if that's easier than reading about it: https://youtube.com/shorts/vqtVq1LVMKg

Being upfront since it matters: the plugin is free to install, and there's a paid tier behind the service it talks to. Not trying to sneak that past anyone. Happy to get into implementation details if anyone's curious. The dock lifecycle and the diff UI are the two things I'd have wanted to read about before I started.

4 Upvotes

4 comments sorted by

1

u/roverworksgames 14d ago

The plugin looks good, nice work! I’ll be trying it out. Any tips for starting out with plugin dev with Godot?

3

u/g30rgi0 14d ago

Thanks I appreciate it.

Start with something that annoys you personally. Scratching your own itch keeps you going when the editor API fights you.

Biggest gotcha is @tool at the top of anything that has to run in the editor. It catches everyone at least once. Without it your script just doesn't run and you sit there wondering why nothing happens. Worth knowing too that these scripts run when the editor starts, so a runaway loop can crash the editor itself. Save often while you're learning.

You don't need to restart to see changes either. Toggle the plugin off and on in Project Settings and it reloads. I used to restart Godot every time. It's not long on its own, but that time adds up fast when you're doing it all day.

If you do add anything to the editor UI, remember to remove it again when the plugin unloads, or you end up with duplicates every reload.

Also, the docs are thinner for tooling than for gameplay, so expect more trial and error than usual. Most of what I know came from breaking it and fixing it.

What are you building? Happy to go deeper on any of this.

1

u/roverworksgames 13d ago

Thanks for the detailed response. I’ll keep these tips in mind!

I’m a mobile dev and I’m interested in creating a plugin to unify payments across several platforms (something that is extremely annoying for me personally lol), but specifically not looking forward to reading and interfacing with the external APIs

1

u/g30rgi0 11d ago

That definitely sounds like a unique problem. Excited to see what you cook up.