跳到正文

AIventure

AIventure 是 bebechien/AIventure 的 Angular + Phaser 游戏。VifuHub/Agent Runtime 集成在保留游戏结构和身份的同时,让它进入 VifuHub 公开项目与 Agent Runtime。Agent Runtime 提供模型驱动 NPC 玩法及游戏可用宿主管理能力的统一游戏运行接口。

打开游戏

bash
git clone --recurse-submodules https://github.com/vifudotdev/awesome-open-source-ai-native-games
cd awesome-open-source-ai-native-games/games/aiventure
npm install

它使用了什么

AIventure 是带打包流程的 Angular 项目,玩法由 Phaser 驱动:

  • npm run build 构建浏览器成果物。
  • dist/template-angular/browser 是部署输出目录。
  • index.html 是输出目录里的运行入口。
  • Agent Runtime 通过 VifuHub SDK,将宿主管理的 AI agent / tool、game state、runtime resource、world session、event 和已批准 capability 连接到游戏。
  • AIventure 使用该接口实现 NPC 对话和游戏工具。
  • 当前可见的 NPC / 游戏交互会作为带 execute 的工具传给 hub.ai.generateText(...)
  • 模型路由由宿主 session 选择,游戏不需要硬编码 provider id。
  • 游戏不嵌入直接的提供方凭据或宿主传输代码。

manifest 用于标识游戏。VifuHub CLI 会从项目及其 VifuHub 调用解析 Angular 构建命令、输出目录、运行入口和可用宿主能力。

json
{
  "name": "AIventure"
}

只有项目需要覆盖检测到的默认值或关闭宿主能力时,才去看 manifest 参考

部署

bash
vf deploy

部署检查会阻止远程可执行代码和浏览器直连外部 AI 提供方。模型调用应放在 hub.ai.generateText(...)hub.run(...) 后面,让游戏使用运行环境的 AI 服务。