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:
| Approach | What the AI does | Best for | Page |
|---|---|---|---|
| 1. Browser agent | drives the live editor: creates entities, writes scripts, imports files, presses Play, checks results | "build this for me", testing, repetitive edits | Browser agents, the tgDebug API |
| 2. Text authoring | writes .tgscene, .tgscript, .uidoc, .tgtilemap files that you import | designing levels and logic in a chat window | Scenes, Scripts |
| 3. Generative art | paints sprites and textures from a prompt, inside the Pixel Art editor | art you don't want to draw by hand | Pixel 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.tgDebuglets code select, create, load, save, play, stop and inspect, and it answers in JSON.window.tgInputpresses keys.window.tgImportimports 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.