← Back One Week In: Building the Core Systems

One Week In: Building the Core Systems

26/1/2026

It’s been a week since I decided which engine to use for my new game, and I want to share what I’ve been working on during that time. Long story, short: I spent the entire week building systems.

As I mentioned in a previous article, this game is a visual novel. If I had gone with a niche engine like Ren’Py, I could’ve jumped straight into writing content in the first week. But since I chose Godot, I had to build most of the underlying systems myself.

Some friends suggested using plugins like Dialogic 2 to handle the VN side of things. I seriously considered it, but in the end I decided against it. I didn’t want to risk conflicts with other systems I planned to implement, so I chose to build the core engine from scratch.

Luckily, Godot has autoloads, which are perfect for global variables, state management, and shared functionality. By leveraging autoloads, I was able to design the core as a reusable API. If I ever build a similar game in the future, I can reuse most of this code—or even evolve it into a standalone plugin, similar in spirit to Dialogic.

As of writing this, the Core Engine is basically done. Below are the main systems included in the core, followed by a brief explanation of each.

Core Systems Overview

1. Condition — Condition Evaluation System

Purpose:
Evaluates conditions for events, endings, and VN nodes.

Key Features:

  • Supports stats.* (numeric stats) with comparison operators
  • Supports flags.* (boolean flags)
  • Operators: >, <, >=, <=, !=, and exact value checks

2. Data — Data Management & Caching

Purpose:
Loads and caches JSON files.

Key Features:

  • Dictionary-based cache to avoid repeated loading
  • JSON loading with validation
  • Used by all other systems as the main data source

3. EndingManager — Ending Management

Purpose:
Evaluates and applies story endings based on conditions.

Key Features:

  • Checks all endings defined in endings.json
  • Applies the first ending whose conditions are met
  • Fallback to a default ending
  • Supports two ending types: VN-based or static text

4. Events — Scheduled Event System

Purpose:
Checks and triggers events based on context.

Key Features:

  • Events sorted by priority
  • Supports once events (trigger only once)
  • Uses the Condition system
  • Effects can modify flags and stats
  • Can trigger VN scenes or apply effects directly

5. Flags — Global Boolean State System

Purpose:
Stores global boolean states.

Key Features:

  • Dictionary-based flag storage
  • flag_changed signal for reactivity
  • Serialization/deserialization for save/load
  • Example flags: event_[id], ending_[id]

6. Game — Main Game State Machine

Purpose:
Controls the main game flow and state transitions.

Key Features:

  • Four states: SCHEDULE, VN, EVENT, EVALUATION
  • New game initialization
  • Schedule action processing
  • Automatic state transitions
  • Ending evaluation trigger

7. SaveManager — Save & Load System

Purpose:
Handles saving and loading game progress.

Key Features:

  • Saves to user://save.json
  • Stores Time, Stats, Flags, and Game State
  • JSON-based serialization

8. Stats — Character Statistics System

Purpose:
Manages numeric character stats.

Key Features:

  • Dictionary-based values
  • stat_changed signal for reactivity
  • Apply effects (increase/decrease stats)
  • Load default values from JSON
  • Serialization for save/load

9. Time (GlobalTime) — Game Time System

Purpose:
Manages in-game time progression.

Key Features:

  • Day and phase system (morning, noon, evening, night)
  • Four phases per day
  • Signals for day/phase changes
  • Serialization for save/load

10. VN — Visual Novel Engine

Purpose:
Runs visual novel scenes.

Key Features:

  • Graph-based VN nodes
  • Condition support per node
  • Auto-advance for nodes without choices
  • Effect application
  • Loop detection using MAX_AUTO_STEPS

Closing Thoughts

Overall, this system feels solid for a VN / life-sim hybrid with scheduling mechanics, stat management, and branching narratives driven by conditions. There’s still room for improvement and expansion, but even at this stage, I can already build a proper vertical slice—UI or not.

And honestly, that’s a good place to be after just one week.

Comments