Working with AI

Working with AI

The three ways an AI can help you build in Trisgine, and which one to pick.

The editor has no chat panel built in. Instead, Trisgine is easy for any AI to work with, because everything in it is either plain text or reachable through a JavaScript API in the page. There are three ways to use that:

ApproachWhat the AI doesBest forPage
1. Browser agentdrives the live editor: creates entities, writes scripts, imports files, presses Play, checks results"build this for me", testing, repetitive editsBrowser agents, the tgDebug API
2. Text authoringwrites .tgscene, .tgscript, .uidoc, .tgtilemap files that you importdesigning levels and logic in a chat windowScenes, Scripts
3. Generative artpaints sprites and textures from a prompt, inside the Pixel Art editorart you don't want to draw by handPixel art generation

You can mix them: ask a chat AI for a script, paste it into the Script Editor's Text tab, and let an agent attach it to twenty objects.

Why it works well

  • Scenes are text. A whole level is a short, indented list of entities and components (format). Models read and write it reliably.
  • Scripts are text too. A visual script round-trips through a JavaScript-like text form, so an AI writes the text and you get a real node graph.
  • The editor exposes its own controls. window.tgDebug lets code select, create, load, save, play, stop and inspect, and it answers in JSON. window.tgInput presses keys. window.tgImport imports files. This is the same surface the engine's own automated tests use.
  • Errors are explicit. Script compilation returns refusals with reasons, and import returns what it accepted and what it refused. An agent can read its mistakes and fix them.

Give your AI the context

Point the AI at the prompt library. It has ready-made system prompts that describe the formats and the limits, so the model doesn't invent features. For agents that can fetch URLs, /llms.txt is a compact index of this wiki, and /llms-full.txt has every page in one file.

A complete example

An agent builds the RPG takes the whole Village Gate tutorial and does it with one script and one prompt.