Skip to content

Structure Personality

Moti Barski edited this page Aug 22, 2026 · 3 revisions

Personality Structure

The personality structure is a plug-and-play minimalist LivinGrimoire directory structure for programming languages that don't support dynamic dispatch (e.g. C#, Swift).

Paste in the livingrimoire packet directory, a DLC directory, and the main file.

Personality Structure

While in Structure Supreme a skill can be added by only copy-pasting files into the DLC directory, in the personality structure the only method is by editing the personality file.


Merits

  • Centralized skill overview — every active skill is listed in one Personality file, so you can see the whole skill set at a glance instead of it being scattered across DLC files.
  • Easy packaging — a complete set of skills can be handed off as a single Personality file plus its skill files, ready to paste in as one unit.
  • No dynamic dispatch required — works in languages where runtime module loading/hot-plugging (as Structure Supreme relies on) isn't available or practical.

Walkthrough: Adding Skills via Personality Structure

  1. Paste in the skill files. Add the skill files (e.g. DiHelloWorld, DiTime, DiSysOut) into the DLC directory.
  2. Open the Personality file. This is the single centralized file that lists every skill the brain uses.
  3. Add a line per skill. Call brain.AddSkill(new Di...()) for each skill you want active, inside Personality.LoadSkills(brain).
  4. To disable a skill, comment out or delete its line in the Personality file — there's no separate config file to touch.
  5. Run the main file. Personality.LoadSkills(brain) runs once at startup and wires every listed skill into the Brain — no runtime loading involved.

🔄 Comparison: Personality vs. Structure Supreme

Feature Structure Personality Structure Supreme
Skill Addition Manual (edit personality) Automatic (drop-in DLC files)
Centralized Skill Overview ✅ Yes ❌ No
Packaging Skills ✅ Easy ⚠️ Manual grouping
Language Compatibility ✅ Works without dynamic dispatch (e.g. C#, Swift) ❌ Requires dynamic dispatch
Runtime Skill Loading ❌ Not supported ✅ Hot-plugging via DLC

Main Example (C#)

using System;
using System.Threading;
using System.Threading.Tasks;

class Program
{
    static Brain brain = new Brain();

    static void Main(string[] args)
    {
        Personality.LoadSkills(brain);

        // Start tick loop in background
        Task.Run(() => TickLoop());

        // Start input loop
        BrainLoop();
    }

    static void BrainLoop()
    {
        while (true)
        {
            string message = Console.ReadLine() ?? "";
            brain.ThinkDefault(message);
            if (message.ToLower() == "exit")
            {
                Console.WriteLine("Exiting...");
                Environment.Exit(0);
            }
        }
    }

    static void TickLoop()
    {
        DateTime nextTick = DateTime.Now;
        while (true)
        {
            if (DateTime.Now >= nextTick)
            {
                Task.Run(() => brain.Think());
                nextTick = nextTick.AddSeconds(brain.getTickInterval());
            }
            Thread.Sleep(10);
        }
    }
}

Example Personality File (C#)

public class Personality
{
    public static void LoadSkills(Brain brain)
    {
        brain.AddSkill(new DiHelloWorld());
        brain.AddSkill(new DiTime());
        brain.AddSkill(new DiSysOut());
        // brain.Chained(new DiHelloWorld()).Chained(new DiTime()).Chained(new DiSysOut());
    }
}

Clone this wiki locally