Ron Bronson

Blog

Bringing AX to life: Building a content schema for browser games developed with agents

I have been experimenting with HTML5 game development through Coalition, a small browser game. My previous games were larger and were not browser-playable. This has been a useful hobby project for learning a different way to build.

Working with agents exposed a content architecture problem. I wanted to keep the game's narrative coherent as scenes were added, while giving interface text the same attention to structure and readability that I would give a website.

That led to an idea worth extracting from the game: a reusable schema for organizing PBBG content so agents can understand which kind of material they are changing and which rules apply to it.

Separate the content by responsibility

The game already has separate simulation, interface and rendering files. Its content needs a more explicit structure within that architecture.

Narrative text establishes the world and communicates through characters. Interface text helps the player navigate and act. Game rules determine which actions are available and what happens afterward. Each has a different responsibility.

A character's account can be incomplete or dishonest. An interface explanation of a cost needs to be accurate. Changing dialogue should not change the calculation behind a dice roll.

The proposed structure separates those concerns:

Content What belongs there
Interface Navigation, buttons, instructions, status labels and application errors
Narrative Scene descriptions, dialogue, character voice and story events
Game definitions Requirements, costs, effects, dependencies and progression
Content policy Writing guidance, terminology and presentation rules for each content type

These categories can share references without sharing ownership. An action's interface description can obtain its time cost from the game definition. Its narrative response can describe the result after the simulation resolves it.

Putting everything in a data file would not establish those distinctions. The schema needs to identify what each field means and how it relates to the other fields.

Model the narrative architecture

Coalition's story involves moving through several locations while other people arrange help elsewhere. Those activities overlap. Earlier decisions affect later cooperation.

To preserve that structure, a scene needs more than a title and a paragraph. It needs an identity, conditions for entry, available interactions and references to what can follow. Dialogue may depend on an earlier promise. An outcome may create an obligation that persists into another scene.

An agent adding a scene should be able to find those relationships in the data. Otherwise it has to reconstruct them from scattered code and prose, or fill the gaps with something that sounds plausible.

A possible scene interaction could reference each concern separately:

{
  "id": "salta.board",
  "sceneRef": "salta",
  "narrativeRef": "salta.board.description",
  "interface": {
    "pattern": "action",
    "labelRef": "salta.board.label"
  },
  "actionRef": "board_freight"
}

This illustrates the proposed structure, not the current runtime format. The narrative entry describes boarding. The interface entry supplies the label. The action definition owns the requirements, roll and effects.

The same principle applies to ongoing arrangements. A promise to arrange an aircraft and a confirmed aircraft need distinct states. Narrative can explain the difference, but the wording must not determine which state the game has reached.

The structure also needs to represent what a character can know. A report available to the government player can describe a suspected location. The actual location belongs to the simulation. Linking narrative to the appropriate view helps keep a new passage from revealing information before the story permits it.

Encode familiar website content principles

Much of this comes from established website and application practice: structured content, consistent terminology, semantic components and writing guidance tied to a particular use.

Atlassian's button guidance describes how labels should communicate actions. GitLab Pajamas distinguishes terminology, component guidance and general writing style. Mailchimp's structured-content guidance explains how reusable content types can be derived from the parts and purpose of an effective example.

A browser game benefits from that same specificity. A button label and a character's speech should not inherit an identical set of writing rules.

For an action label, the policy might call for a specific verb, sentence case and no terminal period. A scene description needs different guidance about length, useful detail and voice. An instruction needs to preserve requirements and consequences. Navigation can use stable nouns such as “Phone” and “Route.”

The schema would identify the content type. A separate policy would supply its editorial rules. That lets another game use the same structure with a different voice, vocabulary or presentation.

Typography belongs in that relationship too. Content intended for reading should map to the reading style. A decorative title face should not spread to dialogue because an agent reused a heading component. The content type and component should make the intended use explicit.

Make the structure usable by agents

Agents need a clear route through the material. They should be able to locate a scene, follow its references and determine which fields can change without altering the mechanics.

That is where this becomes an agent experience primitive. The schema makes the structure inspectable. Content policies make the writing expectations available at the point of editing. Examples show how the pieces fit together.

Validation supports that architecture. It can catch a missing speaker, an unresolved action reference or a content entry without a declared type. Simulation tests can check that narrative changes leave state transitions intact. Editorial review still needs to address voice and repetition, and player testing needs to establish whether instructions make sense.

The goal is to reduce the amount an agent has to infer and the amount of prior conversation it has to remember. Adding a scene should extend the existing narrative structure. Editing a label should follow the interface policy for that kind of control.

Extract the reusable structure

The initial specification describes content patterns and proposed checks. The schemas and runtime integration still need to be implemented.

I want to release the structure separately so other PBBG projects can use it: content types, relationships, scoped writing policies and examples of how a game loads and displays them. Coalition's characters and setting can remain specific to the game.

The part worth sharing is the application of ordinary content architecture to browser games developed with agents. It gives narrative, interface language and mechanics defined places in the system, so further development can preserve the relationships between them.