本文へスキップ

AIventure

AIventure は、既存の Angular + Phaser ゲームを全面的に書き換えずに Vifu へ適応する例です。

Example を開く

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

何を設定しているか

AIventure は Angular のバンドルプロジェクトで、ゲームプレイは Phaser が担当します。

  • npm run build-nolog がブラウザー成果物をビルドします。
  • dist/template-angular/browser がデプロイ出力です。
  • index.html が出力内の実行入口です。
  • Vifu AI を NPC 会話とゲームアクションに使います。
  • assets/gamedata/** をランタイムに同梱します。
  • 外部 AI への直接呼び出しは Vifu SDK に置き換えます。

重要な設定値は次の通りです。

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/**"]
  }
}

デプロイ

bash
vifu deploy

デプロイ検査は、リモートの実行コードやブラウザーから外部 AI プロバイダーへの直接呼び出しをブロックします。モデル呼び出しは Vifu.ai の後ろに置き、ゲームがプラットフォームの AI サービスを使うようにします。