From 6be7664ca8f10eb6ac866bf26b76d759591e913d Mon Sep 17 00:00:00 2001 From: tinqs-limited Date: Mon, 25 May 2026 22:41:40 +0100 Subject: [PATCH] Initial blog repo: 5 posts, 5 skills, CC BY 4.0 Blog posts covering agentic workflows, Gitea fork, Godot optimisation, studio CLI, and fal.ai image generation for game dev. Skills: image-generation (fal.ai), concept-art-pipeline, sora2-video, tripo-browser-workflow, blog authoring. Co-Authored-By: Claude Opus 4.6 (1M context) --- LICENSE | 13 ++ README.md | 31 +++++ posts/agentic-workflow.md | 100 ++++++++++++++ posts/fal-image-generation.md | 169 ++++++++++++++++++++++++ posts/forking-gitea.md | 81 ++++++++++++ posts/godot-optimisation.md | 124 ++++++++++++++++++ posts/studio-cli.md | 93 +++++++++++++ skills/blog.md | 57 ++++++++ skills/concept-art-pipeline.md | 162 +++++++++++++++++++++++ skills/image-generation.md | 218 +++++++++++++++++++++++++++++++ skills/sora2-video.md | 163 +++++++++++++++++++++++ skills/tripo-browser-workflow.md | 157 ++++++++++++++++++++++ 12 files changed, 1368 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 posts/agentic-workflow.md create mode 100644 posts/fal-image-generation.md create mode 100644 posts/forking-gitea.md create mode 100644 posts/godot-optimisation.md create mode 100644 posts/studio-cli.md create mode 100644 skills/blog.md create mode 100644 skills/concept-art-pipeline.md create mode 100644 skills/image-generation.md create mode 100644 skills/sora2-video.md create mode 100644 skills/tripo-browser-workflow.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..722b555 --- /dev/null +++ b/LICENSE @@ -0,0 +1,13 @@ +Creative Commons Attribution 4.0 International (CC BY 4.0) + +Copyright (c) 2026 Tinqs Ltd + +You are free to: +- Share: copy and redistribute the material in any medium or format +- Adapt: remix, transform, and build upon the material for any purpose, even commercially + +Under the following terms: +- Attribution: You must give appropriate credit, provide a link to the license, + and indicate if changes were made. + +Full license text: https://creativecommons.org/licenses/by/4.0/legalcode diff --git a/README.md b/README.md new file mode 100644 index 0000000..6275edc --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# Tinqs Blog + +Engineering and game development blog from [Tinqs](https://tinqs.com) --- a 4-person indie studio building Ariki, a survival colony sim set in a Polynesian archipelago. + +## Posts + +- [How a 4-Person Indie Studio Runs on AI Agents](posts/agentic-workflow.md) (2026-03-06) +- [One Binary to Rule Them All: Building a Studio CLI](posts/studio-cli.md) (2026-05-18) +- [Why We Forked Gitea and Built Our Own Git Platform](posts/forking-gitea.md) (2026-05-20) +- [Streaming a 12km Archipelago in Godot 4](posts/godot-optimisation.md) (2026-05-22) +- [AI Art at Scale: Using fal.ai Flux for Game Asset Generation](posts/fal-image-generation.md) (2026-05-25) + +## Skills + +Reusable AI agent playbooks from our workflow. Each skill is a markdown file that teaches an AI agent (Cursor, Claude Code, etc.) a specific procedure. + +- [Image Generation with fal.ai](skills/image-generation.md) --- Generate game art using fal.ai Flux models with structured prompts +- [Concept Art Pipeline](skills/concept-art-pipeline.md) --- End-to-end 2D concept art to 3D model workflow +- [Sora 2 Video Generation](skills/sora2-video.md) --- Generate trailer clips and game footage with OpenAI Sora 2 +- [3D Model Generation with Tripo](skills/tripo-browser-workflow.md) --- Text-to-3D and image-to-3D via Tripo Studio +- [Blog Authoring](skills/blog.md) --- Write and publish markdown blog posts + +## What are skills? + +Skills are structured markdown files that give AI coding assistants (like Cursor or Claude Code) step-by-step procedures for complex workflows. Instead of explaining the same process every session, you write it once as a skill and the agent follows it. + +Think of them as runbooks for AI agents --- same idea as ops runbooks, but the reader is an LLM, not a human. + +## License + +Content is [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Use it, adapt it, credit us. diff --git a/posts/agentic-workflow.md b/posts/agentic-workflow.md new file mode 100644 index 0000000..81d3a8a --- /dev/null +++ b/posts/agentic-workflow.md @@ -0,0 +1,100 @@ +--- +title: "How a 4-Person Indie Studio Runs on AI Agents" +slug: agentic-workflow +date: "2026-03-06" +description: "We gave our AI a name, a soul file, and a seat at the table. Here's how Singularity, Sentinel, and three machines keep Tinqs running with a team of four humans and zero DevOps." +og_description: "Soul files, autonomous daemons, and one repo to rule them all." +og_image: "https://www.tinqs.com/blog/img/agentic-workflow-architecture.png" +excerpt: "We gave our AI a name, a soul file, and a seat at the table. Here's how Singularity, Sentinel, and three machines keep Tinqs running with a team of four humans and zero DevOps." +author: "Ozan Bozkurt" +author_initials: "OB" +author_role: "CTO & Developer, Tinqs" +--- +We gave our AI a name, a soul file, and a seat at the table. This is the story of how Tinqs --- four humans making a survival colony sim --- built an agentic workflow that lets us operate like a studio ten times our size. + +![Architecture diagram showing Tinqs agentic workflow --- team members, Singularity in Cursor IDE, Sentinel daemon, three machines (Forge, Siren, Kraken), and connected services](img/agentic-workflow-architecture.png) + +## The Problem Every Small Studio Knows + +When you're four people building a game, there's no room for a dedicated DevOps person, a full-time PM tool chain, or someone whose job it is to "keep things organized." Everyone wears five hats. Documentation drifts. Issues pile up. The left hand doesn't know what the right hand shipped. + +We tried the usual tools --- Notion, Trello, shared Google Docs. They all had the same problem: they're passive. They sit there and wait for a human to update them. In a team of four where the CTO is also the sole developer, that human never has time. + +So we built something different. We gave an AI agent a persistent identity, connected it to our entire knowledge base, and let it become a working member of the team. + +## Meet Singularity + +**Singularity** is our primary AI agent. It lives inside [Cursor IDE](https://cursor.com) and has access to our entire documentation repository --- the game design document, backlog, meeting notes, company operations, everything. It's not a chatbot. It's a persistent team member with a title (Chief Intelligence Officer), a soul file that defines its personality and values, and a memory file that persists across sessions. + +The key insight: **all knowledge lives in markdown files in one repo**. No databases, no SaaS dashboards, no proprietary formats. Plain text, version-controlled, readable by humans and agents alike. When anyone on the team opens the docs repo in Cursor, Singularity wakes up with full context of who they are, what machine they're on, and what's been happening. + +### What Singularity actually does + +- Triages and grooms the issue backlog across GitHub and Gitea +- Keeps documentation in sync with the actual game state +- Processes bug reports from testers and creates structured issues +- Drafts team announcements, reviews PRs, and manages cross-repo coordination +- Generates concept art, voice acting, sound effects, and video using integrated API skills +- Conducts competitive research --- analyzing Steam pages, player reviews, pricing strategies + +The team talks to Singularity through voice. Cursor's built-in microphone transcribes and auto-translates (our CTO thinks in Turkish, our PM speaks French). The agent is trained to interpret messy voice-to-text artifacts and act on intent, not grammar. + +*Note (31 Mar 2026): Sentinel has since been retired and its functionality merged into the Gateway.* + +## Meet Sentinel --- The Night Watch + +Singularity only runs when someone opens Cursor. But a studio doesn't sleep --- bugs get reported at midnight, issues go stale, and the team chat fills up while everyone's away. That's where **Sentinel** comes in. + +Sentinel is an autonomous daemon that runs 24/7 on our Mac (codename: Kraken). It's a Node.js process managed by pm2, ticking every 15 minutes. It uses a three-tier model strategy --- cheap models for routine checks, medium for analysis, and premium (Opus) only when it needs deep reasoning. The whole thing costs about $15/day. + +### What Sentinel handles + +- **Google Chat monitoring** --- polls every 3 minutes, responds to commands, reacts with a shield emoji to messages it's read +- **Bug intake** --- when our tester reports a bug in chat, Sentinel creates a structured GitHub issue automatically +- **Stale issue detection** --- flags issues that haven't been touched, nudges the team +- **Daily summaries** --- posts a morning digest of what happened overnight +- **Self-learning** --- Sentinel creates its own skill files when it discovers better ways to do things + +The two agents coordinate through the docs repo itself. Sentinel writes, Singularity reads. No API calls between them, no message queue. Just git. + +## Three Machines, One Brain + +The diagram shows three colored machines: **Forge** (the Windows hub for game development and Unity), **Siren** (Ozlem's PC for design work), and **Kraken** (the Mac that hosts documentation and runs Sentinel). Each machine runs Cursor with the docs repo, so any team member can summon Singularity wherever they are. + +The game code lives on a self-hosted Gitea server (Git Studio) --- not GitHub, not a shared cloud provider. That's a deliberate security choice. Our game assets and source code never leave our network. The docs repo is on GitHub because it's pure text and needs to be accessible from anywhere, but the game itself stays local. + +Browser automation ties it all together. Mixamo for character rigging, Tripo for 3D model generation, Steam store page analysis --- the agents drive the browser directly through Cursor's MCP (Model Context Protocol), so they can see and interact with web pages the way a human would. + +## The Skill System + +Agents don't just have instructions --- they have **skills**. Each skill is a markdown file that teaches the agent a specific workflow: how to generate concept art through our pipeline, how to use the ElevenLabs API for voice acting, how to conduct competitive research on Steam, how to post to Google Chat. + +When someone asks Singularity to do something that matches a skill, it reads the skill file and follows the procedure. This means we can teach the agent new capabilities without changing any code --- just write a new markdown file. Sentinel even creates its own skills when it figures out better approaches to recurring tasks. + +## What We've Learned + +**Plain text is the universal API.** Every tool, every agent, every human can read a markdown file. We store everything --- design documents, meeting notes, company financials, agent memory, team contacts --- as .md files in one repository. This sounds almost too simple, but it eliminates an entire class of integration problems. + +**Identity matters.** Giving the agent a name, a role, and a soul file isn't theater. It creates consistency across sessions. Singularity remembers what it learned, adapts to who's asking, and maintains the same values whether it's triaging bugs or drafting a Steam page description. The soul file is the agent's constitution. + +**Cheap models for routine, expensive models for thinking.** Sentinel's three-tier approach keeps costs manageable. Most of what an autonomous agent does is pattern matching and text formatting --- you don't need Opus for that. Save the expensive tokens for decisions that actually require reasoning. + +**The human stays in the loop for decisions.** The agents can file issues, draft announcements, and generate assets --- but they don't merge code, deploy builds, or post to public channels without explicit approval. The workflow is designed so the AI handles the grunt work while humans make the calls that matter. + +**Voice input changes everything.** When your CTO can describe a bug while looking at the game screen, and the agent transcribes, translates, interprets, and files an issue --- that's a workflow that didn't exist two years ago. It collapses the distance between noticing a problem and tracking it. + +## The Numbers + +- **Team size:** 4 humans + 2 AI agents +- **Sentinel cost:** ~$15/day (~$450/month) +- **Singularity cost:** Usage-based through Cursor Pro + Anthropic API key +- **Repos:** 1 docs repo (GitHub), 1 game repo (Git Studio), 1 Sentinel repo (GitHub) +- **Knowledge files:** 200+ markdown documents +- **Skills:** 15+ agent skill files and growing +- **Infrastructure:** 3 machines, 0 cloud servers, 0 DevOps engineers + +--- + +We're not claiming this is how every studio should work. But for a team of four trying to build something ambitious, having AI agents that actually understand the project --- not just answer questions about it --- has been transformative. The agents don't replace anyone on the team. They make it possible for four people to do the work of forty. + +Ariki is a survival colony sim set in a Polynesian-inspired archipelago. If you're curious about the game itself, head to the [main site](/) or sign up for updates. diff --git a/posts/fal-image-generation.md b/posts/fal-image-generation.md new file mode 100644 index 0000000..0152c09 --- /dev/null +++ b/posts/fal-image-generation.md @@ -0,0 +1,169 @@ +--- +title: "AI Art at Scale: Using fal.ai Flux for Game Asset Generation" +slug: fal-image-generation +date: "2026-05-25" +description: "How we use fal.ai Flux models to generate concept art, trailer frames, and UI assets for our game --- with a 4-layer prompt pattern that actually works." +og_description: "fal.ai Flux for game art: 4-layer prompts, $0.01/image, and a pipeline that replaced our concept art bottleneck." +og_image: "https://www.tinqs.com/img/og-cover.jpg" +excerpt: "We generate concept art, trailer frames, and UI icons with fal.ai Flux models at $0.01 per image. Here's the prompt engineering pattern that makes it work for game dev." +author: "Ozan Bozkurt" +author_initials: "OB" +author_role: "CTO & Developer, Tinqs" +--- +We're a 4-person indie studio building a survival colony sim. We don't have a concept artist on staff. Every piece of character art, trailer frame, and UI icon in our game was generated with fal.ai Flux models --- at roughly a penny per image. + +## The Problem with AI Art for Games + +Most AI image generators produce beautiful images that are completely useless for game development. They look great on Twitter but fall apart when you need consistency: the same character from four angles, a UI icon that reads at 64x64, a trailer frame that matches your game's art style rather than whatever Midjourney thinks looks cool today. + +The issue isn't the models --- Flux is genuinely good. The issue is prompting. When you write "Polynesian warrior on a beach," you get a different art style every time. Different skin tones, different proportions, different lighting. You can't build a game from that. + +We spent three months iterating on prompt patterns before we found something that works consistently. The result is a 4-layer system that anchors the model to your art direction and produces images you can actually ship. + +## Why fal.ai + +We evaluated Midjourney, DALL-E 3, Stable Diffusion (self-hosted), and fal.ai. The decision came down to: + +**API-first.** Midjourney is Discord-only. DALL-E's API works but the model makes everything look like a stock photo. Stable Diffusion self-hosted means maintaining GPU infrastructure. fal.ai gives you Flux models behind a simple REST API --- POST a prompt, GET an image URL. + +**Cost.** $0.01 per image with `flux-2-pro`. $0.004 with `schnell` for rapid iteration. A full character design session --- 12 variants across 3 rounds of refinement --- costs $0.12. A 20-frame trailer storyboard costs $0.20. At these prices, the bottleneck is creative direction, not budget. + +**Speed.** `flux/schnell` returns an image in 4 seconds. `flux-2-pro` in 15 seconds. Fast enough that the AI agent can generate, display, get feedback, and regenerate in a single conversation turn. + +**No subscription.** Pay per image. No monthly fee, no credit packs that expire, no tier-gated features. + +## The 4-Layer Prompt Pattern + +This is the pattern that made AI art actually usable for our game. Each layer adds specificity, and the combination anchors the model to a consistent output. + +### Layer 1: Design Context + +This is the most important layer and the one most people skip. It sets the overall art direction for everything that follows: + +``` +Art direction: stylized 3D render for a survival colony sim set in a +Polynesian archipelago. Warm earthy palette — browns, tans, dark reds, +cream, ocean blues. Carved wood textures, koru spirals, woven pandanus +patterns. Moana-meets-Valheim aesthetic. Game engine quality, not +photorealistic. +``` + +This paragraph appears at the start of every prompt. It's the same paragraph whether we're generating a character, a landscape, or an icon. It anchors the model to our art style. + +**The key insight:** write this once, paste it everywhere. It's your art bible compressed into 50 words. Every time we skipped it --- "just a quick test" --- the output drifted into generic fantasy art. + +### Layer 2: Scene Description + +Describe exactly what should appear, element by element: + +``` +Full body character in T-pose, front view. Young Polynesian woman, +mid-20s. Wearing a woven pandanus wrap skirt (mid-thigh length) and +a fitted tapa cloth top. Cowrie shell necklace with a carved bone +pendant. Single bone bracelet on left wrist. Hair swept back over +right shoulder, decorated with a red hibiscus. Bare feet. +Matte skin, warm brown tones. Neutral confident expression — +not smiling, not angry. Dark grey background. +``` + +Notice the specificity. Not "tribal clothing" but "woven pandanus wrap skirt." Not "jewelry" but "cowrie shell necklace with a carved bone pendant." Not "looks determined" but "neutral confident expression --- not smiling, not angry." + +Vague prompts produce vague results. Specific prompts produce usable assets. + +### Layer 3: Negative Prompt + +Always include what you don't want: + +``` +Do not include: cartoon style, anime style, photorealistic render, +extra text or taglines, watermark, deformed elements, modern or +sci-fi, European crown or castle motifs. No extra fingers, no +merged limbs, no floating accessories. +``` + +We extend this per-subject. For characters: "no grass skirts, no feather headdresses, no Disney-adjacent designs." For environments: "no modern buildings, no metal structures." The negative prompt is as important as the positive one. + +### Layer 4: Reference Images + +When you need consistency across multiple images --- the same character from different angles, or a new character matching an existing one --- pass a reference image: + +```python +result = fal_client.subscribe("fal-ai/flux-2-pro", arguments={ + "prompt": "Same character, side view, same clothing and accessories...", + "image_url": "https://your-approved-front-view.png", + "image_size": "square_hd", +}) +``` + +This is how we maintain consistency. The first approved image becomes the reference for all subsequent views. Without it, you get a different person every time. + +## The Model Lineup + +We use four models for different purposes: + +| Model | Cost | Speed | When | +|-------|------|-------|------| +| `flux-2-pro` | $0.01 | ~15s | Final art. Our default for anything we'll ship. | +| `flux/schnell` | $0.004 | ~4s | Exploration and iteration. Generate 5 variants fast. | +| `ideogram/v2` | $0.008 | ~5s | Anything with readable text --- logos, UI, posters. | +| `flux-pro/v1.1-ultra` | $0.015 | ~8s | Highest quality, but can hang. We mostly avoid it. | + +The workflow: explore with `schnell`, refine with `flux-2-pro`, add text with `ideogram/v2`. + +## How This Fits Our Pipeline + +We don't use fal.ai in isolation. It's the first step in a pipeline that goes from idea to in-game asset: + +``` +Brief → fal.ai (2D concept art) → Tripo Studio (3D model) → Blender (decimate) → Godot (in-game) +``` + +1. **Brief.** The designer describes the character: "Young woman, navigator role, practical clothing, distinctive hair." +2. **2D generation.** We generate 3 variants with `flux-2-pro`, score each on a rubric (style match, cultural accuracy, silhouette, expression, technical animatability), and pick the best. +3. **Reference sheet.** We generate front, side, three-quarter, and head closeup views using the winner as a reference image. +4. **3D model.** The approved front-view concept art goes into Tripo Studio for image-to-3D generation. Tripo outputs a ~1.5M face mesh with full PBR textures. +5. **Decimation.** Blender CLI decimates to 25,000 faces for LOD0. +6. **Rigging.** Mixamo auto-rigs the body (hair separated first if it's large). +7. **In-game.** Import into Godot, set up materials, done. + +The entire pipeline from "I want a character" to "character walking around in the game" takes about 2 hours. No concept artist required. No 3D modeller required. The quality isn't AAA, but for an indie game with a stylised art style, it's more than good enough. + +## What We Learned + +**The design context layer is everything.** Without it, every image is a one-off. With it, every image belongs to the same game. We tried generating without the context block "just to see what happens." The result was beautiful art that looked nothing like our game. The 50-word context block is worth more than the rest of the prompt combined. + +**Negative prompts prevent drift.** AI models have strong defaults --- they want to make things shiny, symmetrical, and photorealistic. If your game isn't those things, you need to say so explicitly. Our "no metallic sheen, no Disney-adjacent, no photorealistic" negatives are load-bearing. + +**Score and iterate, don't accept the first output.** We generate 3 variants, score each on 5 criteria (style, culture, expression, silhouette, technical), and only approve scores of 8+. The first generation is rarely the best. Three attempts at $0.01 each is $0.03 --- cheaper than the time spent working around a mediocre image. + +**Reference images are the consistency mechanism.** Without them, every generation is independent. With them, every generation builds on the last approved output. This is how you get a roster of 10 characters that look like they belong in the same game. + +**Fast models for exploration, quality models for output.** `schnell` at $0.004 and 4 seconds is perfect for "what if we tried..." iterations. `flux-2-pro` at $0.01 and 15 seconds is for "yes, this is the one." Never use your final model for exploratory work. + +**The AI agent is the art director.** We don't manually craft prompts. Our AI agent (running in Cursor) has a skill file that encodes the entire 4-layer pattern, our art style guide, and our cultural guardrails. We tell the agent "design a navigator character" and it writes the full prompt, generates the images, displays them inline, and asks for scores. The human's job is creative direction: "more asymmetric accessories, less jewelry, hair over the other shoulder." The agent handles the prompt engineering. + +## The Numbers + +- **Characters designed:** 10 (full roster for early access) +- **Total images generated:** ~400 across all iterations +- **Total cost:** ~$6 in fal.ai credits +- **Time per character:** ~30 minutes from brief to approved reference sheet +- **Pipeline time:** ~2 hours from approved concept art to in-game model +- **Models used:** flux-2-pro (80%), schnell (15%), ideogram/v2 (5%) + +## Publishing Our Skills + +We've open-sourced the skill files that power this workflow. A skill is a markdown document that teaches an AI agent a specific procedure --- like a runbook, but the reader is an LLM. + +You can find them in our [blog repo](https://tinqs.com/tinqs/blog): + +- **[Image Generation](https://tinqs.com/tinqs/blog/src/branch/main/skills/image-generation.md)** --- the fal.ai integration with the 4-layer prompt pattern +- **[Concept Art Pipeline](https://tinqs.com/tinqs/blog/src/branch/main/skills/concept-art-pipeline.md)** --- the full 2D-to-3D workflow +- **[Tripo 3D](https://tinqs.com/tinqs/blog/src/branch/main/skills/tripo-browser-workflow.md)** --- text-to-3D and image-to-3D model generation +- **[Sora 2 Video](https://tinqs.com/tinqs/blog/src/branch/main/skills/sora2-video.md)** --- trailer clip generation + +Drop any of these into your `.cursor/skills/` directory and your AI agent can follow them. Adapt the design context block to your game's art style and you're good to go. + +--- + +AI image generation isn't magic and it isn't free. But at a penny per image, with the right prompt structure, it replaces the most expensive bottleneck in indie game development: the gap between "I know what this should look like" and "I have an image I can actually use." For a team of four with no dedicated artist, that gap used to be weeks. Now it's minutes. diff --git a/posts/forking-gitea.md b/posts/forking-gitea.md new file mode 100644 index 0000000..724e5f6 --- /dev/null +++ b/posts/forking-gitea.md @@ -0,0 +1,81 @@ +--- +title: "Why We Forked Gitea and Built Our Own Git Platform" +slug: forking-gitea +date: "2026-05-20" +description: "Game studios need git hosting that understands large files, 3D assets, and team workflows. We forked Gitea and built tinqs-git --- here's why and how." +og_description: "Game studios need git that understands LFS, 3D previews, and team workflows. We built tinqs-git." +og_image: "https://www.tinqs.com/img/og-cover.jpg" +excerpt: "GitHub doesn't understand game dev. We forked Gitea to build tinqs-git --- with 3D asset preview, LFS-first workflows, and project management for game teams." +author: "Ozan Bozkurt" +author_initials: "OB" +author_role: "CTO & Developer, Tinqs" +--- +GitHub is built for web developers. Game studios need something different --- LFS that works, 3D asset previews in the browser, and project management that understands sprints and milestones. So we forked Gitea and built tinqs-git. + +## The Problem with GitHub for Game Dev + +We used GitHub for two years. It was fine for the docs repo --- small files, text diffs, pull requests. But the game repo was a different story. + +A single character model with textures and animations is 50--200MB. A terrain heightmap is 16MB. An island's vegetation data is another 10MB. Our game repo was 12GB in LFS alone, growing every week. GitHub's LFS bandwidth limits, slow clone times, and $5/50GB pricing made it untenable. + +More importantly, nobody on the team could **see** what changed. A PR that modifies a GLB file shows a binary diff. You can't preview it. You can't compare before and after. The artist pushes a model, the developer approves it blindly, and three days later someone notices the normals are inverted. + +## Why Self-Host, and Why Gitea + +We evaluated GitLab, Forgejo, Gogs, and Gitea. The decision came down to: + +- **Single binary.** Gitea compiles to one Go binary with SQLite support. No PostgreSQL, no Redis, no Docker compose with 7 services. Just copy the binary, write an app.ini, and run it. +- **Resource usage.** Our Gitea instance runs on a single EC2 instance alongside four other services. It uses about 200MB RAM. GitLab needs 4GB minimum. +- **LFS built-in.** Gitea includes a full LFS server. No external LFS store, no S3 configuration for basic use. Files are stored locally. We added S3 backend later when we wanted it, but it works out of the box. +- **Forkable.** Gitea is MIT-licensed, written in Go, with a clean codebase. We can modify it without worrying about license restrictions or CLA headaches. + +We ran vanilla Gitea for six months. It solved the cost and bandwidth problems immediately. But the UX gaps for game development were still there. + +## What We're Adding: tinqs-git + +tinqs-git is our fork. It tracks upstream Gitea (currently v1.26.1) on the `main` branch and keeps all Tinqs customisations on `tinqs/main`. We rebase onto upstream releases periodically, fix conflicts, and push. + +### 3D Asset Preview + +The headline feature. When you open a PR that contains a `.glb`, `.gltf`, or `.fbx` file, you see a 3D viewer directly in the browser. Rotate, zoom, check materials. No downloads, no external tools. We integrated Online 3D Viewer (O3DV), which supports 22 file formats including STL, OBJ, 3DS, and PLY. + +This changes the review process fundamentally. The artist pushes a model, the lead rotates it in the browser, leaves a comment about the UV seam on the shoulder, and the artist fixes it --- all without leaving the git platform. + +### LFS-First Workflows + +Vanilla Gitea treats LFS as an afterthought. You configure `.gitattributes` manually. There's no dashboard showing LFS usage, no way to see which files are tracked, no warnings when someone commits a large file without LFS. + +tinqs-git adds auto-LFS tracking on repository creation. Game file extensions (`.fbx`, `.glb`, `.png`, `.wav`, `.ogg`, `.tscn`, `.tres`) are tracked by default. An API endpoint exposes LFS storage stats per repo. The goal: LFS should be invisible. It should just work. + +### Tinqs Branding and Landing Page + +Every string that says "Gitea" is replaced with "tinqs-git". Custom amber/gray/black theme using CSS variables (no Fomantic-UI fork needed). Custom logo, favicon, and a landing page that explains what this is and who it's for. + +### Platform Integration + +tinqs-git will integrate with our Team Tool for project management --- issues, sprints, time tracking --- and with the Tinqs platform via OAuth2 SSO. One login for git, the game, and the tools. + +## The Branching Strategy + +Staying close to upstream is critical. We don't want to maintain a full fork that diverges forever. The strategy: + +- `main` tracks upstream `go-gitea/gitea`. We never commit to it directly. +- `tinqs/main` is our production branch. All customisations live here. +- Feature branches (`tinqs/phase-1`, `tinqs/phase-2`, etc.) merge into `tinqs/main`. +- When upstream releases a new version, we merge `main` into `tinqs/main`, resolve conflicts, test, deploy. + +We deliberately limit what we touch. We modify templates, locale strings, CSS variables, and a handful of Go packages. We **never** touch the database models --- schema is owned by upstream, and we ride their migrations. This keeps rebasing manageable. + +## What We Learned + +**Self-hosting git is surprisingly easy.** The hard part isn't running Gitea --- it's convincing yourself that you're allowed to. After years of GitHub being the default, it feels transgressive to host your own git. But a single Go binary on a $10/month server handles a team of 8 with room to spare. + +**LFS changes everything for game repos.** Our clone times went from 45 minutes to 3 minutes. Developers only download the LFS objects they need. CI only pulls what changed. The bandwidth savings alone paid for the server. + +**Forking is maintenance, not rebellion.** The romantic version is "we forked Gitea and built our own platform." The reality is we changed 200 lines of Go, 50 template strings, and a CSS file. 99.5% of the code is upstream's. We're just customising the last half-percent for our use case. + +**3D preview is a game changer.** We expected it to be a nice-to-have. It turned out to be the feature that made the rest of the team actually use git. When the artist can see their work rendered in the browser, they stop asking the developer to "check if it looks right." + +--- + +tinqs-git is built for game teams that are tired of paying GitHub for LFS bandwidth and reviewing binary diffs blind. We're building it for ourselves first, but the plan is to make it available as a standalone product. If you're a game studio that self-hosts, we'd love to hear what features you need. diff --git a/posts/godot-optimisation.md b/posts/godot-optimisation.md new file mode 100644 index 0000000..ee63097 --- /dev/null +++ b/posts/godot-optimisation.md @@ -0,0 +1,124 @@ +--- +title: "Streaming a 12km Archipelago in Godot 4" +slug: godot-optimisation +date: "2026-05-22" +description: "How we built four streaming layers, async resource loading, and memory-safe caches to run a 12km open world in Godot 4 with C# --- without a single memory leak." +og_description: "Four streaming layers, async loading, and zero memory leaks --- how we optimise Godot for a survival colony sim." +og_image: "https://www.tinqs.com/img/og-cover.jpg" +excerpt: "Four streaming layers, async resource loading, memory-safe caches, and zero leaks. How we optimise Godot to run a 12km open world with C# and Terrain3D." +author: "Ozan Bozkurt" +author_initials: "OB" +author_role: "CTO & Developer, Tinqs" +--- +Godot has no built-in asset streaming. Our game is a 12km x 12km archipelago with 9 islands, thousands of trees, hundreds of buildings, and an ocean that never ends. Here's how we made it run. + +## The Problem + +Ariki is a survival colony sim set across 9 islands in a Polynesian-inspired archipelago. The total world is roughly 12km x 12km. Each island is 4km across with its own terrain heightmap, biome textures, vegetation prototypes, and building grids. The player can travel between islands by canoe. + +Godot 4 is a fantastic engine, but it wasn't designed for this scale. There's no terrain streaming, no asset LOD pipeline, no distance-based loading. If you load everything at startup, you run out of VRAM before the player sees the main menu. So we built four streaming layers on top of Godot, all in C#. + +## Layer 1: Terrain3D Regions + +We use **Terrain3D** for our heightmaps --- a GDExtension that gives us a clipmap renderer with 7 LOD levels. Internally, Terrain3D divides each island into 512m x 512m regions. A 4km island has 64 internal regions. Across 9 islands, that's 576 regions total. + +The key insight: **don't create all 9 Terrain3D nodes at startup.** Each node allocates a clipmap mesh, collision structures, and materials even when hidden. Our original code created all 9 in `_Ready()` and just toggled visibility. This wasted hundreds of megabytes on islands the player hadn't visited yet. + +The fix was lazy instantiation. We create the current island's terrain on startup and defer the rest to `TravelToIsland()`. When the player gets in a canoe and sails to a new island, we create that island's Terrain3D node on demand, import the heightmap, and start async texture loading --- all while a loading screen covers the transition. + +## Layer 2: Vegetation Chunks (128m Grid) + +This is the main prop streaming system and where most of the complexity lives. Every island's vegetation --- trees, rocks, grasses, shrubs --- is divided into a spatial grid of 128m x 128m chunks. + +The camera position is checked every 0.5 seconds. When it crosses a chunk boundary, we calculate which chunks should be active within a 400m radius (roughly 39 chunks in a circle), `QueueFree` chunks that fell out of range, and build new chunks that entered range. + +Each chunk groups vegetation instances by prototype, creates a **MultiMesh** per group, and places instances using Terrain3D height queries. This means a chunk with 50 palm trees and 30 rocks becomes 2 MultiMesh draw calls, not 80 individual nodes. + +### The cache problem + +Vegetation meshes and materials are cached in dictionaries keyed by prototype name or texture path. The problem: these caches are **append-only**. Visit all 9 islands and you accumulate every mesh and material variant permanently. With 155 unique prototypes across the archipelago, that's a lot of GPU memory that never gets freed. + +The fix is island-scoped eviction. When the player leaves an island via `TravelToIsland()`, we call `ClearCaches()` on the vegetation grid. Meshes and materials for the departed island are released. If the player returns, they reload from disk (a cache miss, not a crash). The loading screen covers this cost. + +## Layer 3: Async Resource Loading + +Godot's `GD.Load()` is synchronous. It blocks the main thread. When you call it during gameplay, the frame freezes. We audited the entire codebase and found **26 resource load calls across 13 files**, and only 1 was async. + +The worst offender was `VegetationGrid.GetMeshForProto()`. As the player walks across an island for the first time, every new vegetation prototype triggers a synchronous `ResourceLoader.Load()` call. With 155 prototypes, the first traversal stutters visibly. + +We addressed this in two ways: + +- **Pre-warm during loading screens.** When an island is imported, we kick off background loads for all known prototypes. By the time the player gains control, most meshes are already cached. +- **Async loading for biome textures.** Terrain3D textures use `ResourceLoader.LoadThreadedRequest()` with `_Process()` polling. The terrain renders immediately with autoshader colours, and biome textures pop in when ready. The player never notices. + +### The Godot ResourceLoader cache trap + +On top of our own caches, Godot maintains an internal resource cache. Every `GD.Load()` call caches the result globally. There's no API to query the cache size or evict entries. + +This means if you load an FBX as a `PackedScene`, instantiate it to extract a mesh, then free the instance --- the PackedScene **stays cached**. The mesh you extracted is fine (it's a Resource, not a Node), but the discarded scene wastes memory forever. + +The rule: use `ResourceLoader.Load(path, "", CacheMode.Ignore)` for one-shot loads where you extract data and discard the container. Use `GD.Load()` only for things that should persist (shaders, shared textures). + +## Layer 4: Entity Rendering + +Dynamic entities --- colonists, animals, buildings, VFX --- are event-driven, not streamed. They update when the sim pushes new state, not per frame. + +- **Crowd rendering:** Single MultiMesh for up to 2000 colonists. Positions lerped per frame from pre-allocated arrays. Labels distance-culled, capped at 20. This is how you do crowds in Godot --- no individual nodes, no per-frame allocation. +- **Animals:** One MultiMesh per type (boar, deer, bird, fish). Max 500 per type. Updates only on state change, not per frame. +- **Buildings:** Tracked by ID from sim state. `QueueFree` when the sim says they're gone. Self-cleaning. +- **VFX:** Capped at 50 active particle systems. Worst case: 10,000 GPU particles. Trivial for modern hardware. + +## Memory Safety: Zero Leaks + +We audited every `QueueFree()` call in the codebase --- 47 calls across 17 files. **Zero `RemoveChild()` calls without a corresponding `QueueFree()`.** The codebase is clean. + +Three patterns we follow everywhere: + +**Pattern 1: Chunk streaming with spatial grid** + +Deactivate out-of-range chunks by iterating the active dict, calling `QueueFree()`, collecting keys to remove, then removing them after iteration. Never modify a dictionary while iterating it. + +**Pattern 2: Extract data from PackedScene** + +Instantiate a scene, extract the mesh or data you need, `QueueFree()` the temporary instance. The mesh survives because it's a Resource, not a Node. Used by VegetationGrid, TreeTypeRegistry, TreeRenderer, PlayerController. + +**Pattern 3: UI rebuild** + +`QueueFree()` all children, then build new content. Safe because `QueueFree` is deferred --- new children are added in the same frame before old ones are freed. + +## What Runs Every Frame + +We're strict about what goes in `_Process()`. Here's the complete list: + +- **VegetationGrid:** Camera chunk check (0.5s throttle, early-exits if same chunk) +- **Terrain3DManager:** Poll async texture loads (loop pending list, check status) +- **CrowdRenderer:** Lerp 2000 colonist positions (math-only, pre-allocated arrays) +- **DayNightController:** Rotate sun, adjust light energy +- **ThirdPersonCamera:** Follow + zoom smoothing +- **SimBridge:** Drain WebSocket message queue + +Total per-frame overhead is dominated by the crowd lerp and the message queue drain. No heap allocation in any of these. + +## Shaders We Watch + +Two of our 6 custom shaders are flagged as performance-sensitive: + +**Ocean shader** --- 4 Gerstner wave calculations in the vertex stage, applied to a 12,000m plane with 16,641 vertices. Fragment stage does depth reconstruction, caustics (4x sin ops), foam masking, and two normal map lookups. It looks beautiful but it's the heaviest thing in the render pipeline. We pre-warm it during the loading screen to avoid shader compilation stutter on first frame. + +**Wind sway shader** --- 6 trig ops per vertex on every vegetation mesh within 400m. The sway is invisible beyond 100m but the shader runs at full cost regardless. Future optimisation: disable sway on distant chunks or switch to a single-axis approximation. + +## The Target: RTX 3060 + +Our early access target is an RTX 3060 with 8GB VRAM. The rule is simple: + +- If main island + full vegetation < 4GB VRAM --- ship it, we have 4GB headroom +- If approaching 6--8GB --- implement lazy terrain nodes + cache eviction +- If exceeding 8GB --- implement everything through vegetation LOD and region-level streaming + +**Always measure before optimising.** We added VRAM logging before writing a single line of optimisation code. Half the "problems" we expected turned out to be non-issues. The other half were worse than expected. Profiling isn't optional. + +--- + +Godot 4 can handle open worlds at this scale, but it won't do it for you. You need to build streaming, manage your own caches, audit your resource loading, and be disciplined about what runs per frame. The engine gives you the primitives --- MultiMesh, `LoadThreadedRequest`, `QueueFree` --- and it's up to you to wire them into a system that scales. + +We're building Ariki with these systems and shipping to early access. If you're building something large-scale in Godot, we hope this is useful. diff --git a/posts/studio-cli.md b/posts/studio-cli.md new file mode 100644 index 0000000..e009bc6 --- /dev/null +++ b/posts/studio-cli.md @@ -0,0 +1,93 @@ +--- +title: "One Binary to Rule Them All: Building a Studio CLI" +slug: studio-cli +date: "2026-05-18" +description: "We built tinqs-cli --- a single Go binary that handles machine identity, screenshots, cloud vision, health checks, and agent coordination across every machine in the studio." +og_description: "A single Go binary for machine identity, screenshots, cloud vision, and agent coordination." +og_image: "https://www.tinqs.com/img/og-cover.jpg" +excerpt: "tinqs-cli is a single Go binary that handles machine identity, screenshots, cloud vision, health checks, and agent coordination. One install, every machine, human or AI." +author: "Ozan Bozkurt" +author_initials: "OB" +author_role: "CTO & Developer, Tinqs" +--- +Every machine in our studio runs the same Go binary. It knows who you are, what machine you're on, and what services are reachable. It takes screenshots, sends them to cloud vision, runs health checks, and coordinates AI agents. This is how we built tinqs-cli. + +## Why Build a CLI + +When you have 9 machines across 5 people, two operating systems, and AI agents that need context about the environment they're running in, the glue becomes the hardest part. Which machine is this? What services are reachable? Is the game running? Can I take a screenshot of what the developer is looking at? + +We tried shell scripts. We had a `setup.sh` for Mac, a `setup.ps1` for Windows, a `check-services.sh` for health, and a `screenshot.py` that never worked on Windows. They drifted. They broke. Nobody updated them. + +So we built one Go binary that does everything. + +## The Identity System + +The most important command is `tinqs-cli identity`. When an AI agent starts a new session --- Cursor, Claude Code, any tool --- the first thing it does is call this command. The output tells the agent: + +- **Who you are.** The SOUL --- the agent's persistent identity, values, and operating principles. +- **What company this is.** Team members, roles, contact info. +- **What machine you're on.** Hostname, OS, which repos are cloned, what services are running. +- **What siblings exist.** Other repos in the ecosystem and their purpose. +- **What URLs are live.** Git platform, game server, bot, gateway --- with reachability status. + +This solves a fundamental problem with AI agents: **cold starts.** Every new chat window, every new agent tab, every new session is a blank slate. The agent doesn't know what project this is, who's asking, or what infrastructure exists. `tinqs-cli identity` gives it full context in one call. + +The data lives in markdown files in the docs repo. The CLI reads them over the network via a private Tailscale mesh --- the docs repo is the source of truth, and any machine on the mesh can read it. + +## Screenshots and Vision + +`tinqs-cli screenshot --window "Ariki"` captures the game window from outside the process. No in-game overlay, no rendering pipeline integration. It uses the OS-level window capture API --- works on Windows (via GDI+) and Mac (via screencapture). + +`tinqs-cli photo --window "Ariki"` does the same thing but sends the screenshot to Amazon Bedrock's Nova Lite model for analysis. The agent says "take a photo of the game" and gets back a description of what's on screen: "The player character is standing near a half-built hut. There are 3 palm trees to the left. The terrain has a visible seam between two biomes." + +This is how our CTO files bugs without typing. He looks at the game, tells the agent what's wrong, and the agent takes a screenshot, describes what it sees, and creates an issue with both the description and the image attached. + +## Health Checks + +`tinqs-cli doctor` runs a comprehensive health check across the studio: + +- Is Tailscale connected? (Required for all inter-machine communication) +- Is the git platform reachable? Can we authenticate? +- Is the game simulation server running? +- Is the bot service responding? +- Are all expected repos cloned and on the right branch? +- Is the Go version correct? Is Node.js installed? + +The output is a green/yellow/red table. If something's wrong, the agent knows immediately and can diagnose or escalate. + +## Cross-Machine Coordination + +The studio has machines in London, and a server in AWS eu-west-1. They're connected via a Tailscale mesh network. tinqs-cli uses this mesh for everything --- reading identity files, checking service health, even routing agent commands. + +When the CTO is on the Windows machine (Forge) and needs to check something on the Mac (Kraken), the agent doesn't SSH. It uses tinqs-cli to query the relevant service over Tailscale. The mesh is flat --- every machine can reach every other machine by hostname. + +## Installation + +One command per platform: + +- **Windows:** `irm https://bot.arikigame.com/cli/install.ps1 | iex` +- **Mac/Linux:** `curl -fsSL https://bot.arikigame.com/cli/install.sh | sh` + +The install script downloads the latest binary from S3, places it in the PATH, and verifies the checksum. Updates are the same command --- idempotent, no package manager required. + +## Why Go + +Go compiles to a single static binary with no runtime dependencies. No Python virtualenvs, no Node.js version managers, no DLL hell on Windows. The same binary runs on the CTO's gaming PC, the designer's MacBook, and the CI runner in AWS. + +Cross-compilation is trivial. We build Windows, Mac (arm64 + amd64), and Linux binaries from a single GitHub Actions workflow. The release process is: push a tag, CI builds all three, uploads to S3, done. + +The binary is 15MB. It starts in under 100ms. It has zero runtime dependencies. For a tool that AI agents call on every session start, speed matters. + +## What We Learned + +**The CLI is the API for AI agents.** When we started, tinqs-cli was a convenience tool for humans. It became the primary interface for AI agents. The `identity` command was originally "nice to have" --- now it's the single most important function in our stack. Every agent session starts with it. + +**One binary beats ten scripts.** Scripts rot. They have different shells, different PATH assumptions, different error handling. A compiled binary either works or it doesn't. It ships with its dependencies baked in. It doesn't care if your Python is 3.9 or 3.12. + +**Tailscale makes networking disappear.** We spent zero time on VPN configuration, port forwarding, or firewall rules. Install Tailscale, join the mesh, done. Every machine is addressable by hostname. The CLI doesn't need to know about IPs, DNS, or network topology. + +**Cloud vision is underrated for game dev.** Sending a screenshot to a vision model and getting back a structured description sounds gimmicky. In practice, it's the fastest way to document visual bugs. "The tree is floating 2m above the terrain" is much faster to write when the AI is looking at the same screen you are. + +--- + +tinqs-cli is at v0.3.1 and growing. Every time we find ourselves writing a script that needs to work on multiple machines, we add a subcommand instead. The goal is simple: one binary that makes the studio work, whether the operator is human or AI. diff --git a/skills/blog.md b/skills/blog.md new file mode 100644 index 0000000..8a448c4 --- /dev/null +++ b/skills/blog.md @@ -0,0 +1,57 @@ +# Skill: Blog Authoring + +Write and publish markdown blog posts with YAML frontmatter. This skill teaches an AI agent how to create well-structured blog posts for a static site built from markdown. + +## Post Format + +Create a markdown file in `posts/.md` with this frontmatter: + +```yaml +--- +title: "Your Post Title" +slug: your-post-slug +date: "2026-05-22" +description: "Full meta description for SEO (150-160 chars ideal)." +og_description: "Shorter OG/Twitter description." +og_image: "https://your-domain.com/img/og-cover.jpg" +excerpt: "Card text shown on the blog index page." +author: "Author Name" +author_initials: "AN" +author_role: "Role, Company" +--- +``` + +## Writing Guidelines + +- **First paragraph** becomes the lead (displayed prominently below the title, separate from the body) +- **Everything after the first blank line** is the post body +- Use standard markdown: `## Headings`, `**bold**`, `*italic*`, `[links](url)`, `- lists`, fenced code blocks +- Images on their own line become `
` elements with captions +- Use `---` for section breaks +- Em dashes: `---` renders as — + +## Structure + +A good technical blog post follows this pattern: + +1. **Lead paragraph** --- what this post is about, in one sentence +2. **The Problem** --- what pain point or question motivated this work +3. **The Approach** --- what you built or decided, and why +4. **Technical Details** --- how it works, with code/diagrams +5. **What We Learned** --- insights, surprises, trade-offs +6. **Closing** --- what's next, or an invitation to the reader + +## SEO Checklist + +- [ ] Title under 60 characters +- [ ] Description 150-160 characters +- [ ] og_image set +- [ ] Meaningful excerpt for index card +- [ ] Internal links where relevant + +## Conventions + +- Slugs are kebab-case, matching the filename: `my-post.md` -> slug `my-post` +- Dates are ISO format: `2026-05-22` +- Canonical URLs: `https://your-domain.com/blog/` +- Don't edit generated HTML --- edit the markdown, then rebuild diff --git a/skills/concept-art-pipeline.md b/skills/concept-art-pipeline.md new file mode 100644 index 0000000..08eda5a --- /dev/null +++ b/skills/concept-art-pipeline.md @@ -0,0 +1,162 @@ +# Skill: Concept Art Pipeline + +End-to-end workflow for creating game character art --- from design brief through 2D concept art to 3D model export. This skill covers everything before the game engine. + +## Overview + +| Phase | What | Output | +|-------|------|--------| +| 1 --- Design | 2D concept art via AI image generation | Approved PNG(s) | +| 2 --- Model | 3D generation via Tripo Studio | GLB/FBX export | +| 3 --- Handoff | Reference file for the dev team | Markdown spec | + +## Phase 1: 2D Concept Art + +### Locking Your Art Style + +Before generating anything, define your art style once and enforce it everywhere. Write it down. Here's an example for a stylised game: + +- **Stylised 3D render**, anime-influenced but not full anime +- **Matte skin**, no metallic sheen, warm earthy tones +- **Neutral confident expression** --- calm determination, not fierce or smiling +- **Earthy palette**: browns, tans, dark reds, cream, black +- **Asymmetric accessories** --- different on left vs right +- **Dark grey background** for all concept art (consistent, easy to composite) + +### Hard Rules (define yours) + +Every project should have a "do not" list. Examples: + +- NO Disney-adjacent designs (if you're going for something grittier) +- NO overly shiny or metallic materials (unless your game's style calls for it) +- NO hair falling forward over chest (won't animate well in-engine) +- NO culturally inappropriate elements (research your references) + +### Cultural Direction + +If your game draws from real cultures, create an approved/rejected table: + +| Approved | Rejected | +|----------|----------| +| Woven natural fibres, shell jewelry | Generic "tribal" patterns | +| Specific cultural motifs (research them) | Stereotypical elements from wrong cultures | +| Natural materials (bone, wood, stone) | Modern materials that break the setting | + +### Generation Steps + +1. **Get the brief** --- gender, role, distinctive features, or "surprise me within the style" +2. **Generate 3 variants** using your image generation tool (see [Image Generation skill](image-generation.md)) + - T-pose, front view, consistent background + - Naming convention: `character__front_full_v01.png` +3. **Score each variant** using a rubric (see below) +4. **Generate reference sheet** for the winner --- front, side, three-quarter, head closeup +5. **Save with metadata** --- prompt, model used, date, score + +### Scoring Rubric (0--10) + +| Score | Meaning | Action | +|-------|---------|--------| +| 9-10 | Perfect match to art style and brief | Approve, generate reference sheet | +| 8 | Strong, minor tweaks needed | Approve with notes, iterate once | +| 6-7 | Interesting but needs changes | Note what works, regenerate | +| 4-5 | Wrong direction, some salvageable elements | Extract what works, fresh prompt | +| 0-3 | Off-target | Drop, adjust approach | + +**Score on:** style match, cultural accuracy, expression, silhouette (distinctive at distance?), technical (T-pose clean? animatable?) + +### Layered Design + +Design characters in separable layers for future equipment/customisation: + +1. **Base body** --- simple underwear, no accessories +2. **Lower garment** --- baked into character mesh +3. **Upper garment** --- baked or swappable +4. **Hair** --- separate asset (swappable) +5. **Accessories** --- equipment slots (necklaces, bracelets, headwear) +6. **Cape/cloak** --- separate equipment piece + +Generate the full character for the overall look, but keep separation in mind for 3D. + +## Phase 2: 3D Model Generation + +### Using Tripo Studio + +[Tripo Studio](https://studio.tripo3d.ai) generates 3D models from text or images. + +1. Open Tripo Studio +2. Text-to-3D or paste your approved concept art for image-to-3D +3. Use **Ultra quality**, latest model version, **Texture ON** (~35-50 credits) +4. Export as **GLB** (preferred --- preserves PBR textures) or FBX +5. Save to your project's asset pipeline + +Tripo outputs ~1.5M faces with full PBR textures (basecolour, normal, ORM). You'll decimate to your target polygon budget in Blender or your engine. + +### Large Hair Problem + +Auto-riggers (like Mixamo) break when the mesh includes big hair --- wrong arm poses, face distortion, rig artifacts. + +**Rule:** For characters with large or complex hair: +- Export a **body-only version** (no hair) for rigging +- In Tripo: use **Segment** to split hair from body, export body-only +- Hair is added back as a separate mesh after rigging + +### Polygon Budget + +Define your LOD targets. Example: + +| LOD | Face Count | Use | +|-----|-----------|-----| +| LOD0 | 25,000 | Close-up, player character | +| LOD1 | 10,000 | Medium distance NPCs | +| LOD2 | 2,500 | Crowd/background characters | + +### Texture QA Checklist + +Before handoff, verify: + +- [ ] PBR textures present --- basecolour, normal, roughness/metallic maps +- [ ] No UV seams on prominent areas (face, hands) +- [ ] Skin tone matches the approved concept art +- [ ] No texture stretching on limbs or torso +- [ ] Accessories have distinct materials +- [ ] Resolution 2K minimum for hero characters +- [ ] No generation artifacts (floating geometry, merged fingers, extra limbs) + +## Handoff + +Create a handoff document for each approved character: + +1. **Character identity** --- name, role, description +2. **Concept art files** --- paths to approved PNGs +3. **3D model files** --- path to GLB/FBX exports +4. **Art direction notes** --- what to keep, what to change +5. **Technical requirements** --- shader, rig type, LOD targets, scale +6. **Known issues** --- large hair flag, texture problems, etc. + +## Batch Generation + +When generating multiple characters: + +1. Prepare all briefs upfront +2. Generate in priority order (ship-soonest first) +3. Use free retries before spending credits +4. Score as you go --- don't batch review +5. Track credits per generation +6. Export immediately after approval (don't leave work in the cloud tool) + +## Common Mistakes + +| Problem | Cause | Fix | +|---------|-------|-----| +| Characters look generic | No art style lock | Define and enforce your style guide | +| Inconsistent across characters | No reference images | Use your best character as image-to-image reference | +| Metallic skin sheen | Default material settings | Use matte keywords, check PBR roughness | +| Symmetric accessories | Generation default | Explicitly describe left vs right in prompt | +| Auto-rigger fails | Large hair in mesh | Segment and export body-only | +| Low-poly look in engine | PBR textures missing | Always generate with Texture ON + PBR ON | + +## Related Skills + +- [Image Generation](image-generation.md) --- fal.ai Flux models and prompt patterns +- [Tripo 3D](tripo-browser-workflow.md) --- detailed Tripo Studio workflow +- [Sora 2 Video](sora2-video.md) --- animate concept art into video diff --git a/skills/image-generation.md b/skills/image-generation.md new file mode 100644 index 0000000..b749b16 --- /dev/null +++ b/skills/image-generation.md @@ -0,0 +1,218 @@ +# Skill: Image Generation with fal.ai Flux + +Generate game art, concept art, icons, logos, trailer frames, and marketing visuals using fal.ai Flux models. This skill teaches an AI agent how to call fal.ai's API with structured prompts optimised for game development. + +## Overview + +[fal.ai](https://fal.ai) hosts Flux image generation models with a simple API. You describe what you want, pick a model and size, and get back a URL to the generated image. Costs range from $0.004 to $0.015 per image. + +## Models + +| Model | Quality | Cost/img | Speed | Use | +|-------|---------|---------|-------|-----| +| `fal-ai/flux-2-pro` | High | ~$0.01 | ~15s | **Default.** Final art, icons, trailer frames. Most reliable. | +| `fal-ai/flux/schnell` | Fast | $0.004 | ~4s | Quick mockups, iteration, exploration | +| `fal-ai/flux-pro/v1.1-ultra` | Ultra | $0.015 | ~8s | Highest quality, but can be slow. Fall back to flux-2-pro if it hangs. | +| `fal-ai/ideogram/v2` | Typography | $0.008 | ~5s | Logos with readable text, posters, banners | + +**How to pick:** Use `flux-2-pro` for most work. Use `schnell` when iterating fast. Use `ideogram/v2` when you need readable text in the image. + +## Sizes + +| Value | Dimensions | Use | +|-------|-----------|-----| +| `square` | 512x512 | Icons, favicons | +| `square_hd` | 1024x1024 | App icons, logos, character portraits | +| `landscape_16_9` | 1024x576 | Trailer frames, hero images, Steam banners | +| `portrait_16_9` | 576x1024 | Steam capsules, posters, mobile splash screens | + +## API Usage + +### Python (fal-client) + +```python +import fal_client + +result = fal_client.subscribe("fal-ai/flux-2-pro", arguments={ + "prompt": "Your detailed prompt here", + "image_size": "landscape_16_9", + "num_images": 1, +}) + +image_url = result["images"][0]["url"] +print(image_url) +``` + +### JavaScript + +```javascript +import * as fal from "@fal-ai/serverless-client"; + +const result = await fal.subscribe("fal-ai/flux-2-pro", { + input: { + prompt: "Your detailed prompt here", + image_size: "landscape_16_9", + num_images: 1, + }, +}); + +console.log(result.images[0].url); +``` + +### cURL + +```bash +curl -X POST "https://queue.fal.run/fal-ai/flux-2-pro" \ + -H "Authorization: Key $FAL_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "prompt": "Your detailed prompt here", + "image_size": "landscape_16_9", + "num_images": 1 + }' +``` + +### Image-to-image (reference images) + +Pass a reference image URL for guided generation: + +```python +result = fal_client.subscribe("fal-ai/flux-2-pro", arguments={ + "prompt": "Same scene but at sunset, warm golden light", + "image_url": "https://your-reference-image.png", + "image_size": "landscape_16_9", +}) +``` + +For dual-reference compositing (mixing elements from two images), pass comma-separated URLs and describe which elements come from which reference in the prompt. + +## Prompt Engineering --- the 4-Layer Pattern + +This pattern consistently produces the best results for game art. Each layer adds specificity. + +### Layer 1: Design context + +Set the overall art direction. This anchors the model's style. Example for a Polynesian survival game: + +``` +Art direction: stylized 3D render for a survival colony sim set in a Polynesian +archipelago. Warm earthy palette --- browns, tans, dark reds, cream, ocean blues. +Carved wood textures, koru spirals, woven pandanus patterns. Moana-meets-Valheim +aesthetic. Game engine quality, not photorealistic. +``` + +Adapt this to your game's art style. The key is being specific about palette, materials, and cultural references. + +### Layer 2: Scene description + +Describe exactly what should appear, element by element: + +- Camera angle and POV +- Characters (count, poses, clothing, expressions) +- Environment (time of day, weather, terrain, vegetation) +- Colours and lighting +- Technical style (stylised realism, cel-shaded, pixel art, etc.) + +**Be specific.** "A warrior standing on a beach" produces generic results. "A Polynesian warrior in a T-pose, front view, wearing tapa cloth wrap and cowrie shell necklace, matte skin, earthy tones, dark grey background" produces usable concept art. + +### Layer 3: Negative prompt + +Always include what you don't want: + +``` +Do not include: cartoon style, anime style, photorealistic render, extra text +or taglines, watermark, deformed elements, modern or sci-fi elements. +``` + +Extend with subject-specific negatives. For character art: "no extra fingers, no merged limbs, no floating accessories." + +### Layer 4: Reference images (optional) + +When you have existing art to match, pass it as `image_url`. Describe in the prompt which elements to keep: "Same character design but in a side view. Keep the clothing and hair style from the reference." + +## Game Dev Use Cases + +### Character concept art + +``` +Stylized 3D render of a young Polynesian woman in T-pose, front view. +Wearing woven pandanus skirt and tapa cloth top. Cowrie shell necklace, +bone bracelet on left wrist only. Hair swept back over one shoulder, +decorated with a hibiscus flower. Matte skin, warm brown tones. +Neutral confident expression. Dark grey background. +Size: square_hd (1024x1024) +``` + +### Trailer frames / key art + +``` +Wide cinematic shot of a coastal village at golden hour. Thatched-roof +huts on stilts along a turquoise lagoon. Outrigger canoes pulled up on +white sand. Volcanic mountain in the background with clouds wrapping +the peak. Warm orange sunlight, long shadows. Stylized game engine +quality, not photorealistic. +Size: landscape_16_9 (1024x576) +``` + +### UI icons + +``` +Game icon: a carved wooden fishing hook with a glowing blue thread +wrapped around the shaft. Dark background, subtle ambient occlusion. +Clean silhouette, suitable for a 64x64 game UI icon. +Size: square (512x512) +``` + +### Logo with text + +``` +Game logo: the word "ARIKI" in thick bold blocky capital letters. +Each letter carved from dark mahogany wood with distinct Polynesian +tribal patterns (koru spirals, chevrons, wave motifs) carved as +deep relief. Different pattern per letter. Warm directional lighting +from above-left. Dark background. +Size: square_hd (1024x1024) +Model: ideogram/v2 (for readable text) +``` + +## Best Practices + +| Do | Don't | +|----|-------| +| Be specific per-element | Write vague one-line prompts | +| Always include negative prompts | Skip negatives and hope for the best | +| Use `flux-2-pro` for final art | Default to the most expensive model | +| Use `schnell` for rapid iteration | Spend $0.01/img on throwaway drafts | +| Generate 2-3 variants and pick the best | Generate one and accept it | +| Save prompts alongside images | Lose track of what prompt made what | +| Match your game's art style in Layer 1 | Let the model pick a random style | +| Use reference images for consistency | Describe the same character differently each time | + +## Cost Tracking + +| Scenario | Cost | +|----------|------| +| 1 quick mockup (schnell) | $0.004 | +| 1 final frame (flux-2-pro) | ~$0.01 | +| 10-iteration design session | ~$0.10 | +| Full character sheet (4 views x 3 variants) | ~$0.12 | +| 20-frame trailer storyboard | ~$0.20 | + +At these prices, the bottleneck is creative direction, not budget. + +## Common Mistakes + +| Mistake | Fix | +|---------|-----| +| Generic one-line prompts | Use the 4-layer pattern | +| No art direction context | Always set Layer 1 for your game's style | +| No negative prompt | Always include what you don't want | +| Using the wrong model for text | Use `ideogram/v2` for logos with readable text | +| Not iterating | Generate 2-3 variants, pick the best, refine | +| Inconsistent character designs | Use reference images to anchor style across generations | + +## Related Skills + +- [Concept Art Pipeline](concept-art-pipeline.md) --- full 2D-to-3D character workflow +- [Sora 2 Video](sora2-video.md) --- animate your generated art into trailer clips +- [Tripo 3D](tripo-browser-workflow.md) --- turn 2D concept art into 3D models diff --git a/skills/sora2-video.md b/skills/sora2-video.md new file mode 100644 index 0000000..a861bac --- /dev/null +++ b/skills/sora2-video.md @@ -0,0 +1,163 @@ +# Skill: Video Generation with OpenAI Sora 2 + +Generate trailer clips, gameplay-style footage, and cinematic sequences using OpenAI's Sora 2 API. This skill covers the API workflow, prompting patterns, and cost management for game development use. + +## Overview + +Sora 2 generates 5-20 second video clips from text prompts or still images. For game studios, it's useful for: + +- Trailer pre-visualisation (storyboard frames as video) +- Marketing clips before the game is playable +- Concept videos to test art direction +- Social media content + +## Prerequisites + +- OpenAI API key with Sora access +- Set `OPENAI_API_KEY` environment variable + +## API Reference + +### Create a video + +```bash +curl -X POST "https://api.openai.com/v1/videos/generations" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "sora-2", + "prompt": "Your prompt here", + "size": "1920x1080", + "duration": 10, + "n": 1 + }' +``` + +Response includes a generation ID. Video generation takes 2-10 minutes. + +### Check status + +```bash +curl "https://api.openai.com/v1/videos/generations/{generation_id}" \ + -H "Authorization: Bearer $OPENAI_API_KEY" +``` + +Poll until `status` is `"completed"`. The response includes a download URL. + +### Download + +```bash +curl -o output.mp4 "{video_download_url}" +``` + +### Image-to-video + +Animate a still image: + +```bash +curl -X POST "https://api.openai.com/v1/videos/generations" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "sora-2", + "prompt": "Camera slowly pulls back, revealing the full village. Waves lap at the shore.", + "image": "{base64_or_url_of_image}", + "size": "1920x1080", + "duration": 5 + }' +``` + +This is powerful for animating your generated concept art or key art frames. + +## Models + +| Model | Quality | Speed | Cost | +|-------|---------|-------|------| +| `sora-2` | High | 2-5 min | ~$0.10-0.20/clip | +| `sora-2-pro` | Highest | 5-10 min | ~$0.50-1.00/clip | + +Use `sora-2` for iteration and pre-vis. Use `sora-2-pro` for final trailer clips only. + +## Prompting for Game Trailers + +### Structure + +``` +[Camera movement] + [Subject action] + [Environment] + [Lighting/mood] + [Style] +``` + +### Example: Opening shot + +``` +Slow aerial drone shot descending toward a cluster of thatched-roof huts +on a tropical island shoreline. Crystal clear turquoise water, white sand +beach, palm trees swaying gently. Golden hour sunlight, long shadows. +Stylised 3D game engine quality, warm colour palette. No text overlays. +``` + +### Example: Character reveal + +``` +Medium shot of a young Polynesian woman standing on a cliff edge, looking +out over an ocean dotted with volcanic islands. Wind blowing her hair. +She turns to face the camera with a calm, determined expression. Sunset +light behind her. Stylised 3D render, game cinematic quality. +``` + +### Example: Action sequence + +``` +Wide shot of three outrigger canoes racing across open ocean toward a +volcanic island. Waves crashing, spray in the air. Warriors paddling +in unison. Storm clouds building on the horizon. Dynamic camera +tracking the lead canoe. Stylised game engine quality. +``` + +## Cultural Guardrails + +If your game draws from real cultures, set explicit rules: + +- **No anachronistic elements** (modern objects, wrong architectural styles) +- **Research your references** --- use authentic building styles, clothing, tools +- **Avoid stereotypes** --- specific cultural elements, not generic "exotic" +- **No sacred symbols used decoratively** without understanding their meaning + +## Workflow for Trailer Storyboards + +1. **Write the storyboard** --- list each shot with description, duration, and camera movement +2. **Generate key frames** using image generation (see [Image Generation skill](image-generation.md)) +3. **Animate key frames** using Sora 2's image-to-video +4. **Generate original clips** for shots that don't need a specific starting frame +5. **Review and iterate** --- regenerate clips that don't match the vision +6. **Compile** in a video editor (DaVinci Resolve, Premiere, etc.) + +## Cost Management + +| Scenario | Estimated Cost | +|----------|---------------| +| 1 test clip (sora-2, 5s) | ~$0.10 | +| 10-clip exploration session | ~$1.00 | +| 20-clip trailer storyboard | ~$2-4 | +| Final 5-clip trailer (sora-2-pro) | ~$2.50-5.00 | + +**Tips:** +- Use `sora-2` (not pro) for all iteration +- Keep clips to 5-10 seconds --- shorter clips have better coherence +- Generate 2-3 variants per shot and pick the best +- Only use `sora-2-pro` for the final selected shots + +## Common Mistakes + +| Mistake | Fix | +|---------|-----| +| Overly long prompts | Keep under 200 words. Focus on what's visible. | +| Requesting specific text/UI | Sora can't render readable text. Add text in post. | +| Not specifying art style | Always end with style direction ("stylised 3D", "game engine quality") | +| Using sora-2-pro for iteration | Expensive and slow. Use sora-2 until you're happy with the prompt. | +| Ignoring cultural accuracy | Set guardrails before generating. Review outputs for stereotypes. | +| Not tracking costs | Log every generation with model, duration, and cost. | + +## Related Skills + +- [Image Generation](image-generation.md) --- create key frames to animate with Sora +- [Concept Art Pipeline](concept-art-pipeline.md) --- character and asset design workflow diff --git a/skills/tripo-browser-workflow.md b/skills/tripo-browser-workflow.md new file mode 100644 index 0000000..5f60741 --- /dev/null +++ b/skills/tripo-browser-workflow.md @@ -0,0 +1,157 @@ +# Skill: 3D Model Generation with Tripo Studio + +Generate 3D models from text descriptions or 2D images using [Tripo Studio](https://studio.tripo3d.ai). This skill covers the workflow for game-ready 3D assets. + +## Overview + +Tripo Studio is a web-based text-to-3D and image-to-3D tool. You describe a character, prop, or environment piece --- or upload concept art --- and Tripo generates a textured 3D model in ~60 seconds. + +**Output:** GLB or FBX with full PBR textures (basecolour, normal, ORM/metallic/roughness). + +**Cost:** ~25-50 credits per generation. Free tier: 150 credits/month. + +## When to Use + +- You have approved 2D concept art and need a 3D model +- You need a quick 3D prototype from a text description +- You're generating props, characters, or environment pieces for a game +- You need multiple variants of the same object + +## Workflow + +### Text-to-3D + +1. Open [Tripo Studio](https://studio.tripo3d.ai) +2. Click **Create** -> **Text to 3D** +3. Enter your prompt (see prompt tips below) +4. Settings: + - Quality: **Ultra** + - Model: **v3.1 Best Quality** (or latest) + - Texture: **ON** (critical --- generates PBR maps) +5. Click Generate (~35-50 credits, ~60s) +6. Review the model in the 3D viewer --- rotate, check materials +7. Export as **GLB** (preferred) or FBX + +### Image-to-3D + +1. Upload your approved concept art (front view, T-pose for characters) +2. Settings: same as text-to-3D +3. Generate +4. Review --- check if the back and sides match your expectations +5. Export + +## Prompt Tips for Game Assets + +### Characters + +``` +Full body character, T-pose, front facing. Young Polynesian woman wearing +woven pandanus skirt and tapa cloth top. Shell necklace, flower in hair. +Stylized game character, not photorealistic. Clean topology. +``` + +**Key rules:** +- Always specify **T-pose** for characters (needed for rigging) +- Mention **clean topology** to reduce mesh artifacts +- Describe clothing and accessories explicitly +- Specify art style (stylized, realistic, low-poly, etc.) + +### Props + +``` +Carved wooden fishing spear with bone tip. Wrapped handle with +woven cord. Polynesian style, game prop, stylized. +``` + +### Environment pieces + +``` +Thatched-roof hut on wooden stilts. Open sides with woven wall panels. +Polynesian longhouse style. Game-ready, stylized 3D. +``` + +## Post-Generation Tools + +Tripo offers several refinement tools after generation: + +| Tool | Purpose | When to Use | +|------|---------|-------------| +| **Segment** | Split model into parts | Characters with large hair (split hair from body for rigging) | +| **Retopo** | Retopologize mesh | When face count is too high or topology is bad | +| **Texture** | Regenerate textures | When colours don't match concept art | +| **Animate** | Add basic animations | Quick previews (not production quality) | +| **Edit** | Modify the model | Remove artifacts, adjust proportions | + +## Export Options + +| Format | Use | +|--------|-----| +| **GLB** | Preferred. Single file, preserves PBR textures, works everywhere | +| **FBX** | When your pipeline requires it (Unity, some Blender workflows) | +| OBJ | Legacy. Loses PBR data. Avoid. | +| USD | For USD-based pipelines | +| STL | 3D printing only. No textures. | + +## Polygon Budget + +Tripo outputs ~1.5M faces by default. You'll need to decimate: + +| LOD | Target Faces | Method | +|-----|-------------|--------| +| LOD0 | 25,000 | Blender Decimate modifier or CLI | +| LOD1 | 10,000 | Same | +| LOD2 | 2,500 | Same | + +Use Tripo's built-in **Retopo** tool for a quick reduction, or decimate in Blender for more control. + +## The Large Hair Problem + +Auto-riggers (Mixamo, Godot's skeleton system) break when character meshes include large or complex hairstyles. The rig misidentifies the hair volume as part of the body. + +**Solution:** +1. After generation, use Tripo's **Segment** tool +2. Select the hair and split it from the body +3. Export the **body-only** mesh for rigging +4. Export hair separately +5. Reattach hair after rigging in Blender or your engine + +Flag this in your handoff document for every character with big hair. + +## Batch Generation + +When generating multiple assets in one session: + +1. Prepare all prompts upfront +2. Generate in priority order +3. Use the 3 free retries per generation before spending more credits +4. Score and review each model immediately +5. Track remaining credits +6. Export approved models right away --- don't leave them only in the cloud + +## Credit Optimisation + +| Action | Credits | +|--------|---------| +| Standard quality generation | ~15-25 | +| Ultra quality generation | ~35-50 | +| Retopo | ~10-15 | +| Texture regeneration | ~10 | +| Segment | ~5 | + +**Tip:** Start with Standard quality for exploration, switch to Ultra only for final approved designs. + +## Common Mistakes + +| Problem | Fix | +|---------|-----| +| Model has no textures | Ensure Texture is ON before generating | +| Back of character looks wrong | Use image-to-3D with front AND back views, or add "detailed back view" to prompt | +| Mesh has floating geometry | Use Edit tool to clean up, or regenerate | +| Merged fingers | Common artifact. Regenerate or fix in Blender | +| Too many polygons for game use | Use Retopo tool or Blender Decimate | +| Hair breaks auto-rigger | Segment hair from body, rig body-only | + +## Related Skills + +- [Image Generation](image-generation.md) --- create 2D concept art to feed into Tripo +- [Concept Art Pipeline](concept-art-pipeline.md) --- full 2D-to-3D workflow