Skip to content

feat(build): add editor-to-player packaged game builds - #46

Merged
Yang-Junjie merged 3 commits into
mainfrom
feat/building-system-v1
Nov 20, 2026
Merged

Yang-Junjie merged 3 commits into
mainfrom
feat/building-system-v1

Conversation

@Yang-Junjie

Copy link
Copy Markdown
Contributor

Editor 项目此前只能在编辑器内运行。本 PR 增加首版构建流程:保存开启场景和输出目录后,Editor 调用 vulcal_build <project.vproj> <vulcal_player>,生成游戏 .vpak 并复制 Player;Player 从包内按逻辑路径加载场景、cooked 资产和 Lua。

主要变更

  • 新增 Build Settings / Build 菜单、可选 build_info 配置,以及同目录优先、PATH 回退的程序查找和 SDL 子进程启动。
  • 新增 DirectoryProvider / PakProvider、miniz 依赖和 cooked 资产字节读取入口;场景序列化下沉到 Engine,Lua 从 Provider 读取源码后在内存执行,保留现有目录 API。
  • 新增 vulcal_build 与 vulcal_player,包含 manifest、显式/自动选包、临时产物与备份恢复、UTF-8 路径、输出别名校验,以及 snake 示例构建配置。
  • 增加 Provider、构建 pipeline、场景/脚本包内执行、Unicode 路径和发布失败回滚测试。使用方式、实现假设及原文差异记录在 docs/building_system_v1.md。

验证

  • Windows / clang-cl Debug:cmake --build build --parallel 8 成功。
  • ctest --test-dir build --output-on-failure 运行 279 项:267 通过、6 跳过,6 项现有 ViewportTest 在 SDL_WINDOW_INPUT_FOCUS 断言处失败;ctest --test-dir build --rerun-failed --output-on-failure 复跑这 6 项全部通过。窗口焦点测试仍存在环境相关的不稳定性。
  • 跳过项为 Windows 无 symlink 权限的测试和 POSIX 执行权限测试;Building System 专项测试均通过。
  • 实际构建并启动 snake 与中文/emoji 路径的 sandbox 副本:无参数自动选包和显式选包均进入主循环,无错误日志;sandbox 从包内载入网格、材质和纹理。
  • git diff --check 与新增 C++ 文件的 clang-format 检查通过。

首版边界与设计差异

依据 Design Building System。使用仓库现有 assets_path 字段,manifest 格式版本为整数 1,引擎版本为 0.0.5。为兼容现有 Editor,额外打包项目资源目录外的 Lua;直接写临时 ZIP,不先复制完整散文件目录。

构建使用已保存的场景、脚本及已有 cooked 资产;不重新导入、不校验资源引用完整性、不加密、不做场景/Lua 二进制化或交叉构建。逻辑路径精确匹配大小写,构建遇到 symlink 或输出位于 cooked 目录时明确失败。

当前只复制 Player 可执行文件,没有自动收集 DLL、系统运行库或新增 SDK 发行打包流程。本机动态 SDL 与 Debug C++ 运行库仍是依赖,因此本地启动验证不代表两个产物可直接发布到干净电脑。

@Yang-Junjie Yang-Junjie self-assigned this Nov 20, 2026
@Yang-Junjie Yang-Junjie added enhancement New feature or request slop Identify junk code labels Nov 20, 2026
@Yang-Junjie Yang-Junjie added this to the Vulcal Engine v0.1.0 milestone Nov 20, 2026
@Yang-Junjie Yang-Junjie linked an issue Nov 20, 2026 that may be closed by this pull request
- remove the root .clang-format and the comment-language rule in CONTRIBUTING
- delete docs/building_system_v1.md and the README link that pointed to it
- reuse base::path_to_utf8 instead of per-file UTF-8 conversions in apps,
  assets and the scene serializer
- rename apps::application_paths to apps::app_paths and
  executable_directory() to running_executable_directory()
- extract project-relative/scene path validation into
  apps/common/project_paths.h and reuse it in the editor and build tool
- add Scene::find_by_id and base::to_upper
- restore the app_paths test after the namespace rename

@Yang-Junjie Yang-Junjie left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approve but slop still

@Yang-Junjie
Yang-Junjie merged commit cd0863f into main Nov 20, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in MiniEngine Roadmap Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request slop Identify junk code

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Feature] 实现打包功能

1 participant