> ## Content Index
> Fetch the complete content index at: https://devlog.bujingames.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Moondog, day 9 (27 Oct): one big refactor, and making it run again
- URL: https://devlog.bujingames.com/moondog-day-9-27-oct-one-big-refactor-and-making-it-run-again/
- Published: 2026-10-28T04:00:00.000Z
- Updated: 2026-12-01T19:49:13.000Z
- Description: The days before this were quieter. On the 23rd I laid the data groundwork for ranged combat: stamina, projectiles, ranged weapons and ammo. Then on the 25th came one huge commit that split the server into about 40 files and moved the client onto autoloads.
- Author: Jin
- Tags: moondog, devlog

The days before this were quieter. On the 23rd I laid the data groundwork for ranged combat: stamina, projectiles, ranged weapons and ammo. Then on the 25th came one huge commit that split the server into about 40 files and moved the client onto autoloads.

## The big split

The server had grown into a few enormous files. It's now modules: caches for items, node types and creatures; a session manager; and separate systems for combat, AI, parties, guilds, housing, the economy, quests, world events, crafting and spawning, wired together through a small service provider. On the client, networking, game state, input, combat, inventory, crafting and the rest each became an autoload, and scenes got a proper folder layout. The same commit roughed in parties, trading, guilds, housing, quests and world events. Those are skeletons for now.

The web panels also got twinkling stars in the header.

## Making it run again

A refactor that size breaks things, and the 27th was mostly finding what:

- Code was still looking up `/root/Network`, but Network.gd sits on the `Main` node. Every one of those paths was wrong.
- Some RPC annotations were lost in the move, so a few client calls quietly stopped reaching the server.
- Non-network code moved out of Network.gd into the autoloads it belonged in. The GM undo stack, for one, now lives with the GM tools.
- **Two worlds.** The main scene had its own inline terrain and never used the World scene, so the world was loading twice. Now there's one, and the terrain has grass.

## A debug overlay

A read-only overlay with build, mode, packet age, round trip, telemetry status and the live input state. It started on F9, moved to F8, and then to **F7**, because F8 is the Godot editor's "stop running project" key and kept killing the game while I tested. The old always-on debug label in the corner now only flashes when something changes.

The day ended with creature combat and inventory reconnected through the new systems.