Skip to content

AIventure

AIventure shows how to adapt an existing Angular + Phaser game to Vifu without rewriting the whole project.

Open The Example

bash
git clone --recurse-submodules https://github.com/vifu-labs/vifu-examples
cd vifu-examples/02_external_ai_games/aiventure
npm install

What It Configures

AIventure is a bundled Angular project with Phaser gameplay:

  • npm run build-nolog builds the browser artifact.
  • dist/template-angular/browser is the deploy output.
  • index.html is the runtime entry inside that output.
  • Vifu AI is enabled for NPC dialogue and game actions.
  • Game data under assets/gamedata/** is bundled with the runtime.
  • Direct external AI calls are replaced by the Vifu SDK.

The important setup values are:

json
{
  "name": "AIventure",
  "main": {
    "url": "index.html",
    "engine": "phaser"
  },
  "build": {
    "command": "npm run build-nolog",
    "output": "dist/template-angular/browser"
  },
  "ai": {
    "dialogue": {
      "role": "npc",
      "tools": "game-actions"
    },
    "budget": {
      "mode": "demo",
      "turns": 8
    },
    "fallback": "deterministic"
  },
  "bundle": {
    "include": ["assets/gamedata/**"]
  }
}

Deploy It

bash
vifu deploy

The deploy check blocks remote executable code and direct browser calls to external AI providers. Keep model calls behind Vifu.ai so the game uses the platform AI service.