For everyone — The score stays the same, the orchestra can change

Think of a piece of sheet music. It contains the meaning of the work — the notes, the dynamics, the dialogue between instruments — but no sound comes out of the paper. To hear it, you need an orchestra to perform it; and the same score can be played by a string quartet tonight and by a symphony orchestra tomorrow. That is exactly the central idea of this article: describing a behavior (what a being does, what it means) separately from its execution (how, technically, you make it run). Just keep the recipe separate from the cooking: you can change ovens, the recipe remains valid.

Why does this matter? Because any software that grows eventually has to change: new needs, new technologies, new ideas. When description and execution are mixed together, every change forces a full rewrite. When they are separated — as on the Yokul project — you can evolve the ideas without breaking the tools, share and reuse behaviors, and even compose them without being a virtuoso programmer. The text illustrates this, amusingly, with a simple chat bot described in an "XBML" file (for eXtensible Behavior Model Language — the behavior description language), whose same descriptor could today be executed by a generative AI.

For Yokul, this is the heart of the house: it is this separation that makes it possible to add new individuals or new behaviors mid-simulation, to assemble building blocks like legos, and to keep alive what has already been built. And it doesn't stop at the game: an adaptive chatbot, an agent dedicated to a line of business, an entire simulated population are all described with the same grammar of actors — the descriptor itself never moves.

One final note, a tonal one: this article is written from practice, not from theory. The choices in it are explained as they were made — with their reasons, their wanderings, and their inventions (a reading of Frank Knight on risk and uncertainty, a few asides on complexity). If you're looking for a lecture course, move along: this is a construction journal talking.

The full text

Introduction

To simulate individuals — animals, plants, characters, but also places, planets, virtual worlds, or programs — we had to recognize very early in the project the need to program them, that is, to describe their behaviors in a form the machine knows how to execute. At first, in the most direct way: code and data. "Direct" is a compliment from today: back then, it was the only approach available — and it quickly showed its limits.

Before getting to that, a few basic notions, with a promise: no jargon without explanation, and everyday examples. If you're a seasoned software developer, you can skip, without guilt, straight to the section The description / execution separation.

The big concepts, plainly

What is a program

A program, in my everyday vocabulary, can be described as follows:

A program is a sequence, not necessarily linear — that is, a graph — of behaviors that change the state of a system according to the constraints observed from within that program.

Put plainly: a program watches what happens around it and reacts, one step at a time, modifying its data along the way. A beverage vending machine does exactly that: it waits for a coin, switches to "choose your drink" mode, serves, gives change, returns to waiting. Every moment is a state of the system; every action changes that state.

The schools of thought for organizing this decomposition have names — procedural, object-oriented, functional programming — but they share the same intuition: break things down to make them understandable. Small elements that know how to do one simple thing, with vocabularies matched to what they handle, compose more easily than one huge program that knows everything and tells nothing.

Giving yourself methods

In computing as in construction, you don't start from a blank page. There are design methods (Merise, UML, UP — three generations of the same ambition) that map out, before and alongside the code, all the information and processes that interact with the data and the actors — users first, but not only them — all the way down to how things get documented. The most accurate image is that of the architect's blueprint: nobody stacks bricks as they go, hoping to end up with a building. These blueprints serve as much to reach agreement as to build.

What can already be shared

Many behaviors have already been implemented, refined, and battle-tested by others — redoing them every time would be a waste. This sharing takes two main forms:

  • libraries — ready-made building blocks (writing logs, reading files, doing calculations; in the Java ecosystem: lombok, log4j, guava);
  • design patterns — proven assembly blueprints (visitor, decorator, facade — each names a recurring situation and the recognized way to handle it).

Services, then micro-services, extend the idea to the scale of entire systems. A side remark: these decompositions seem to add a non-trivial energy cost (I know of no formal study on the subject) — it deserves deeper investigation.

Using all of this requires only two things: knowing (or looking up) what already exists, and checking that it fits your problem. The second is the most often neglected — a poorly fitted building block costs more than no block at all.

Risk, uncertainty — and what it costs decision-makers

Here is the clinical observation that, implicitly, started this project: software that evolves to follow new demands almost systematically runs into maintenance difficulties — cost, time, bugs — in short, a slow death that can be predicted from the very idea, in almost every project.

Why? An initial inability to embrace a form of uncertainty, which I will try to define. An aside here is worth being slow about. In economics, Frank Knight (Risk, Uncertainty and Profit, 1921) distinguishes risk — whose possible cases and probability are known, as with dice: it can be insured, budgeted — from uncertainty in the strict sense, where you don't even know the possible cases. Risk can be quantified; uncertainty cannot be quantified, it can only be prepared for: by keeping slack — in time, architecture, budget — for what you cannot yet name.

Now, projects, in their vast majority, budget for risk and ignore uncertainty. Nobody is unaware that new — or simply unanticipated — technologies will arrive that could shift workloads: maintenance, evolutions. But on the investor's side (in time, in money, whether you answer to a boss or a client), since you can't know, you don't invest in that fuzzy direction. When the change arrives, there is neither margin nor architecture left to receive it: you rewrite.

I believe this is a fundamental flaw in the decisions of many executives, and I'm certain that this subject can and should be worked on, if it hasn't been already — I haven't, for that matter, yet found any research that addresses it head-on.

When complexity turns against the code

These natural evolutions, often tied to emerging needs, then bring a general difficulty: accumulating complexity, a global analysis that becomes arduous, a chaotic program — particularly the elements that interact with one another. On emerging needs, beyond decomposition methods, this remains my perception: once you see what you've built, you imagine the next step, you discover a new need, you understand better what would be useful. In most of the people I've met, this plays out in a few short iterations. You believe you're building on a plan; you discover while walking.

The idea that follows from it

The holistic approaches to design and project management are not wrong — they represent decades of experience, research, and hard-won confrontations, and they meet business objectives with predictable, clear paradigms: you aim at what you know at a given moment, for a controlled cost. For the bulk of projects, that's enough, and it would be absurd to disqualify them.

But it is not enough for a project of the Yokul type. The need there is long-term, global, systemic, and fast evolution, in an environment of complex interactions — without rewriting a thousand times a thousand different interactions. From these fundamental needs emerges a unique design requirement: model and simulate any program, individual, or thing from the real world, while preserving over time and across scope whatever has already been thought or done — and being able to evolve all of it, including along the way. In short, aim at what every human naturally seeks: maximum effect for minimum energy — especially when the accessible technologies keep changing.

On Yokul

From constraints to choices is a short step. During the initial design phases of the Yokul project, we identified the need to keep the lowest possible investment in time and to identify the useful patterns, and therefore to adapt existing methods. An equivalent requirement is added to it: the ability to embrace new "technologies" or new behaviors, and, pushed to its conclusion, the ability to accept new individuals and behaviors during the execution of the simulation or program (even the evolution of an individual while it runs). We constrained ourselves to allow this, first by looking for what usually blocked the conventional approaches.

For these reasons — a general model that is efficient in realization and evolution time, and simple in the passage from thought to execution — we evolved, over time, the implementation and the concepts answering that need. The rest of the article describes where this led.

The description / execution separation

To hold these constraints over the long term, Yokul's behavior modeling separates the semantic and conceptual part of systems (the ideas, the concepts) from their technical implementation (the code that concretely performs the action). A doctoral aside, while we're at it: the idea has a scholarly lineage — David L. Parnas, On the Criteria To Be Used in Decomposing Systems into Modules, Communications of the ACM, 1972, laid down there the golden rule of information hiding: decompose a system not according to the steps of the work, but according to the decisions you want to be able to change without touching the rest. Yokul applies that rule to behavior itself. Above all, the forms describing these two parts are manipulable by a program — and not, to put it briefly, a drawing on paper, as in UML — and that manipulation itself can be considered a behavior. This opens the path to AI-assisted design, a research field in its own right.

This approach offers several advantages, which reinforce one another:

  • Reuse: you reuse parts of conceptual behaviors, which makes development easier without requiring deep programming skills — "no code" or "low code" approaches become possible;
  • Design time savings: you implicitly rely on execution or behavior building blocks that already exist;
  • Mass generation: you can quickly produce examples of similar but individualized behaviors, adapted to each one's specifics;
  • Sharing: common behaviors are described once and are easily shared;
  • Context-driven execution: the choice of the elements that carry out the execution of a conceptual model depends on the context and the environment — you can choose on the fly the execution mode and what follows, taking inheritance and the constraints specific to each user into account;
  • Beyond the game: the same descriptor drives an adaptive chatbot, an agent dedicated to a line of business, or a complete simulated world — the domain's own logic remains described in the model, rather than being handed over entirely to the statistical logic of LLMs.

By adopting this approach, you focus on the meaning and intent of actions, rather than on how they are carried out. The gap between what you mean and what you have to write shrinks, and a complex set of micro-programs — so many unique individuals (entities, programs, places, any active thing) — remains understandable and evolvable, whatever their complexity and diversity.

Concretely, from version 2 through version 3 of the modeling, the serialized structure (and the corresponding code) relies on an XML syntax describing behavior graphs — XBML, for eXtensible Behavior Model Language: the language's name is plainly visible in the example at the end of the article, which opens with a <eXtensibleBehavior> root element. On the implementation side, the two conceptual models are merged through inversion of control (see Inversion of Control):

  • the description model, which holds the data describing a specific behavior: a response to a particular stimulus, an organization of behaviors in response to a type of stimulus, or an actor composed of all the possibilities and using them;
  • the execution model, which defines how to carry out the behavior (the effects, from the computing standpoint) when a stimulus is received.

The two models are assembled when created and can evolve when the "description" of a behavior in use changes within the inheritance graph. Conceptually, the execution models carry no state of their own: it is the actor model that holds the state — characteristics, memory, genome. A behavior is therefore executed with a context that encompasses the actors involved (oneself, possibly the stimulis emitter) and, above all, the stimulus itself.

To be honest: this separation, real both physically and conceptually, makes traditional debugging more complex. On the other hand, it seems to considerably reduce design defects, while speeding up changes and conceptual evolutions.

The next step, finally, will probably be the automatic generation of behavior sets according to specific objectives. Generative AIs, popularized since 2023, are particularly well suited to this evolution.

A little history

Historically, in version 1.0, behavior modeling — Yokul's flagship concept — was done through dynamic code generation. Over the iterations and the research aimed at solving the difficulties and security risks inherent in this approach (replacing classes in memory, compilation, code assembly), an evolution became necessary to better handle the many aspects of designing a behavior and transforming it into concrete execution.

From version 2.0 onward, a new approach therefore emerged, distinctly separating the conceptual and technical dimensions of the modeling. This break made it possible to move past the limits of code generation, static or dynamic. The serialized structure, which previously contained the computer code, was replaced by an XML syntax describing behavior graphs in a clearer and more understandable way; this is also where inversion of control was introduced, a crucial mechanism that made it possible to bring together the conceptual models of description and execution — a principle explored in depth in Inversion of Control.

This approach, consolidated up to version 3, delivers a real gain in reliability, reusability, and adaptability: fewer design errors, shorter development cycles, systems easier to evolve. Yokul's behavior modeling framework thus remains faithful to its raison d'être: favoring a clear separation between the semantic and technical dimensions, and keeping alive what has already been built rather than rewriting everything.

Kinships in hindsight — convergence, not lineage

A note of honesty, while we're at it: none of the above was drawn from a research program. The model emerged through iterations, version 1 then 2 then 3, under the pressure of the project's own constraints — not from a bibliography. It was later, upon discovering certain works, that the resemblance jumped out; and it must be said clearly: these are resonances, not sources. None of these references fed the initial design, and claiming descent would be a convenient reconstruction. What actually happened is rather an iterative emergence converging with parallel paths: when people confront, under different climates, the same problem — describing agent behaviors separately from their execution — they end up in neighboring plains. Here are these works, each lighting up one facet of the model:

  • Behavior-Oriented Design (BOD) — Joanna J. Bryson, Intelligence by Design: Principles of Modularity and Coordination for Engineering Complex Adaptive Agents, PhD thesis, MIT, 2001. Decomposing an agent into behaviors triggered by stimuli, arbitrating through action selection (the POSH reactive plans). Resonance: the granularity of stimulus-triggered behavior, and modularity. The choice of the word "behavior" as the design unit, which seems obvious here, was obvious there too — two answers to the same intuition.
  • Behavior Trees — Damian Isla, Handling Complexity in the Halo 2 AI, GDC 2005, then popularized by Michele Colledanchise and Petter Ögren, Behavior Trees in Robotics and AI: An Extended Introduction, CRC Press, 2018 (the behavior tree has since migrated from games to robotics). Resonance: modular, reactive behavior graphs, which support adding elements well. The deeper difference: XBML adds inheritance between types and, above all, the description/execution separation, where a BT remains an execution object.
  • Statecharts — David Harel, Statecharts: A Visual Formalism for Complex Systems, Science of Computer Programming, 1987. Hierarchizing state machines to tame the combinatorial explosion. Resonance: hierarchy as the answer to interaction complexity — XBML's inheritance graph is another variant of it, on other objects.
  • GOAP (Goal-Oriented Action Planning) — Jeff Orkin, Three States and a Plan: The AI of F.E.A.R., GDC 2006. Declaring actions by preconditions and effects, and letting a planner find the sequence suited to the context. Resonance: declare what you have and let the engine choose how to execute — the same declarative/executive separation, applied to the plan rather than to the behavior.

Alongside them, two older landmarks belong to the common foundation of all of this, of which this article is a practical variation: separation of concerns (Edsger W. Dijkstra, note EWD447, 1974) and model-driven modeling, which separates the model from its execution platform (the MDA movement, launched by the OMG in 2001). That family is so vast that everyone finds their place in it; the project is no exception — the question of separating the descriptor from the engine is the through-line of this article, and a dedicated article is devoted to it.

If one were to put it into words: kinship does not explain origin, it explains mutual readability. Reading these works today means recognizing problems the project solved through different detours — and, sometimes, finding in them the technical words that were missing from the words of the building site.

Example of a behavior descriptor (XBML)

Example of a concrete implication: the XML below describes a very simple chat bot. We react to stimuli — "hearing" sentences whose meaning is hello, work, goodbye, or that we don't understand (default behavior). When the stimulus is detected, we answer with mindless phrases.

For the most attentive readers: this is an actor type, "human", which means that all "human" actors or their descendants have this behavior.

This is the description version; its 2009 execution was a basic implementation, used to present the behavior engine at the opening of one of the projects, on which people then worked for a few years.

Today, the descriptor can be kept unchanged and implemented differently (I haven't done it yet!): you ask a generative AI for the best meaning given the ongoing conversation, then you propose a reply that matches the meaning of the dialogue prepared initially, but with a style adapted, in the details, to the emitting actor.

Example of a descriptor in XML (sanitized, and dating from 2010):

Two notes on this XML, one regrettable and one encouraging.

The regrettable one: the namespace URLs (http://xsd.yokul.org/...) point to the definitions of the syntax (XSD schemas, the language for defining XML vocabularies). They have no longer been publicly accessible since the emergence of AIs on the Internet. The namespace remains a valid identifier: these URLs, like the ISBN of a book, designate without necessarily being served.

The encouraging one: this XML works very well for the machine, but it remains a technical vocabulary — dating from the 2000s, when XML reigned supreme. One project I care about, for lack of having taken it up yet: using AI to translate this syntax into a more human one — a format as close as possible to intent, which the technical descriptor continues to carry. The descriptor and its execution are separated: nothing prevents inventing a base layer that converts one into the other, exactly as described above.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<eXtensibleBehavior name="human"
    xmlns="http://xsd.yokul.org/xbml/2.0"
    xmlns:ykd="http://xsd.yokul.org/memory_decision/1.0"
    xmlns:yk-ext="http://xsd.yokul.org/xbml-ext/2.0"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
    http://xsd.yokul.org/memory_decision/1.0    ../../cache/injected/xsd.yokul.org/memory_decision/1.0.xsd
    http://xsd.yokul.org/xbml/2.0   ../../cache/injected/xsd.yokul.org/xbml/2.0.xsd
    http://xsd.yokul.org/xbml-ext/2.0   ../../cache/injected/xsd.yokul.org/xbml-ext/2.0.xsd"
    >

    <parents>
        <id>live_being</id>
        <id>pnj_tactics</id>
        <id>action_bases</id>
    </parents>
    <domains>
        <aggregatableeXtensibleBehaviorDomain id="listening">
            <rule id="bonjour">
                <yk-ext:speak actor="self"
                    sentence="Bonjour l'ami. Vous avez besoin d'aide ?" />
            </rule>
            <rule id="travail">
                <yk-ext:speak actor="self"
                    sentence="Il faut parler au contremaître pour la tâche du jour." />
            </rule>
            <rule id="adieu">
                <yk-ext:speak actor="self"
                    sentence="À bientôt. Forcément." />
            </rule>
            <rule id="default">
                <yk-ext:speak actor="self"
                    sentence="C'est pas faux !" />

            </rule>
            <domains/>
        </aggregatableeXtensibleBehaviorDomain>
        <eXtensibleBehaviorDomain id="environnement">
            <rule id="vieillir">
            <!-- called often -->

            </rule>
            <rule id="mourrir">
                <yk-ext:speak actor="self" target="self" sentence="argggh" />
                <!--  un dernier cri avant la fin de vie :) -->
            </rule>
        </eXtensibleBehaviorDomain>
    </domains>
</eXtensibleBehavior>

Example of a behavior graph

The descriptor above belongs to an inheritance graph: each node inherits the behaviors of its parents and can specialize them.

Class model of the behavior simulation: Entity, LifeBeing and the citizens of Dizzi City.

Key takeaways

  • Describing and executing are two distinct activities: the descriptor (XBML, behavior graph) carries the meaning, the engine picks the execution according to the context.
  • Description and execution are assembled through inversion of control; state lives in the actor, not in the execution.
  • "No code" / "low code" approaches become possible: composing behaviors no longer requires being a virtuoso programmer.
  • There is a price to pay: traditional debugging is more complex, but you gain faster evolutions and fewer design defects.

See also