{"id":9533102,"url":"https://github.com/XGameSolutions/XGame","last_synced_at":"2025-08-23T19:31:07.839Z","repository":{"id":239506415,"uuid":"127537190","full_name":"XGameSolutions/XGame","owner":"XGameSolutions","description":"一套适用于大型团队的Unity游戏解决方案。","archived":false,"fork":false,"pushed_at":"2023-04-05T03:23:29.000Z","size":24256,"stargazers_count":69,"open_issues_count":0,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-16T23:15:21.218Z","etag":null,"topics":["game","solutions","unity"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XGameSolutions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-31T14:03:04.000Z","updated_at":"2024-10-08T05:46:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"1f461e07-8b06-4dbb-84da-822c9184e1c7","html_url":"https://github.com/XGameSolutions/XGame","commit_stats":null,"previous_names":["xgamesolutions/xgame","monitor1394/xgame"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/XGameSolutions/XGame","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XGameSolutions%2FXGame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XGameSolutions%2FXGame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XGameSolutions%2FXGame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XGameSolutions%2FXGame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XGameSolutions","download_url":"https://codeload.github.com/XGameSolutions/XGame/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XGameSolutions%2FXGame/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271746755,"owners_count":24813580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game","solutions","unity"],"created_at":"2024-05-12T23:39:24.970Z","updated_at":"2025-08-23T19:31:07.555Z","avatar_url":"https://github.com/XGameSolutions.png","language":"Python","funding_links":[],"categories":["Frameworks"],"sub_categories":[],"readme":"# XGame\n\nXGame旨在提供一套完整的大型游戏开发解决方案，包括前后端、底层驱动、配置数据等。采用`C++`、`C#`、`Lua`、`Python`等语言开发。\n\nXGame模拟大项目团队管理流程，为了方便项目管理、多部门协作、权限划分、避免版本管理错乱等，将工程拆分成多个仓库。不同的开发角色可以迁出不同的仓库组合所需的最小工程，提高开发效率，减少冗余错误，降低维护成本。\n\nXGame对人数百人以上，资源量30G以上的团队具有一定的参考意义。小团队小游戏的话可以考虑更简洁的方案。\n\n本方案重点放在整体框架设计和资源管理上，有些功能只是简单实现，特别是底层驱动和服务器部分，没有具体参考意义。\n\n## 方案组成\n\n| 仓库 | 描述 |\n| ------------------------------------------------------------------------------------------------- | -- |\n| [XGame-XClientLua](https://github.com/monitor1394/XGame-XClientLua.git)                           | XGame游戏解决方案：客户端Lua代码 |\n| [XGame-XConfig](https://github.com/monitor1394/XGame-XConfig.git)                                 | XGame游戏解决方案：配置数据 |\n| [XGame-XCommon](https://github.com/monitor1394/XGame-XCommon.git)                                 | XGame游戏解决方案：前后端共用的Lua代码 |\n| [XGame-XDriver](https://github.com/monitor1394/XGame-XDriver.git)                                 | XGame游戏解决方案：底层C++驱动代码，前后端共用 |\n| [XGame-XServer](https://github.com/monitor1394/XGame-XServer.git)                                 | XGame游戏解决方案：服务端Lua代码 |\n| [XGame-XClient-Packages](https://github.com/monitor1394/XGame-XClient-Packages.git)               | XGame游戏解决方案：Unity客户端的Packages目录 |\n| [XGame-XClient-ProjectSettings](https://github.com/monitor1394/XGame-XClient-ProjectSettings.git) | XGame游戏解决方案：Unity客户端的ProjectSettings目录 |\n| [XGame-XClient-iOS](https://github.com/monitor1394/XGame-XClient-iOS.git)                         | XGame游戏解决方案：Unity客户端的ResAB下的iOS目录 |\n| [XGame-XClient-Editors](https://github.com/monitor1394/XGame-XClient-Editors.git)                 | XGame游戏解决方案：Unity客户端的Assets下的Editors目录，用于放工具类或不用打包的代码 |\n| [XGame-XClient-Plugins](https://github.com/monitor1394/XGame-XClient-Plugins.git)                 | XGame游戏解决方案：Unity客户端的Assets下的Plugins目录，用于放第三方插件代码 |\n| [XGame-XClient-ResData](https://github.com/monitor1394/XGame-XClient-ResData.git)                 | XGame游戏解决方案：Unity客户端的Assets下的ResData目录，用于放程序和策划资源数据 |\n| [XGame-XClient-ResPublic](https://github.com/monitor1394/XGame-XClient-ResPublic.git)             | XGame游戏解决方案：Unity客户端的Assets下的ResPublic目录，公共资源 |\n| [XGame-XClient-ResEffect](https://github.com/monitor1394/XGame-XClient-ResEffect.git)             | XGame游戏解决方案：Unity客户端的Assets下的ResEffect目录，特效资源 |\n| [XGame-XClient-ResModel](https://github.com/monitor1394/XGame-XClient-ResModel.git)               | XGame游戏解决方案：Unity客户端的Assets下的ResModel目录，角色模型资源 |\n| [XGame-XClient-ResScene](https://github.com/monitor1394/XGame-XClient-ResScene.git)               | XGame游戏解决方案：Unity客户端的Assets下的ResScene目录，场景资源 |\n| [XGame-XClient-ResSceneModel](https://github.com/monitor1394/XGame-XClient-ResSceneModel.git)     | XGame游戏解决方案：Unity客户端的Assets下的ResSceneModel目录，场景模型资源 |\n| [XGame-XClient-ResUI](https://github.com/monitor1394/XGame-XClient-ResUI.git)                     | XGame游戏解决方案：Unity客户端的Assets下的ResUI目录，UI资源 |\n| [XGame-XClient-Runtime](https://github.com/monitor1394/XGame-XClient-Runtime.git)                 | XGame游戏解决方案：Unity客户端的Assets下的Runtime目录，运行时或打包用的代码 |\n\n## 迁出参考\n\n√√ 表示需要迁出仓库，可以提交仓库\n\n√x 表示需要迁出仓库，不能提交仓库\n\n|             仓库               | 打包 | 程序 | 程序 | 策划 | QA | QA | 美术 | 角色 | 场编 | 场模 | 特效 | UI |\n| ----------------------------- | -  | -  | -  | -  | -  | -  | -  | -  | -  | -  | -  | -  |\n| XGame-XClientLua              | √√ | √√ | √√ | √x | √x |\n| XGame-XConfig                 | √√ | √x | √x | √√ | √x |\n| XGame-XCommon                 | √√ | √√ | √√ | √x | √x |\n| XGame-XDriver                 |    | √√ |\n| XGame-XServer                 |    | √√ | √√ | √x | √x |\n| XGame-XClient-Packages        | √√ | √√ | √√ | √x | √x | √x | √x | √x | √x | √x | √x | √x |\n| XGame-XClient-ProjectSettings | √√ | √√ | √√ | √x | √x | √x | √x | √x | √x | √x | √x | √x |\n| XGame-XClient-ResAB           | √√ | √x | √x | √x | √x | √x | √x | √x | √x | √x | √x | √x |\n| XGame-XClient-Editors         |    | √√ | √√ | √x | √x | √x | √x | √x | √x | √x | √x | √x |\n| XGame-XClient-Plugins         | √√ | √√ | √√ | √x | √x | √x | √x | √x | √x | √x | √x | √x |\n| XGame-XClient-Runtime         | √√ | √√ | √√ | √x | √x | √x | √x | √x | √x | √x | √x | √x |\n| XGame-XClient-ResData         | √√ | √√ |    | √√ | √x |    | √x | √x | √x | √x | √x | √x |\n| XGame-XClient-ResEffect       | √√ | √√ |    | √√ | √x |    | √√ |    |    |    | √√ |    |\n| XGame-XClient-ResModel        | √√ | √√ |    | √√ | √x |    | √√ | √√ |    |    |    |    |\n| XGame-XClient-ResScene        | √√ | √√ |    | √√ | √x |    | √√ |    | √√ | √x |    |    |\n| XGame-XClient-ResSceneModel   | √√ | √√ |    | √√ | √x |    | √√ |    | √x | √√ |    |    |\n| XGame-XClient-ResUI           | √√ | √√ | √√ | √x | √x |    | √√ |    |    |    |    | √√ |\n| XGame-XClient-ResPublic       | √√ | √√ | √√ | √√ | √x |    | √√ | √√ | √√ | √√ | √√ | √√ |\n\n## 参考方案\n\n* [打包方案](#打包方案)\n* 首包分包方案\n* 多语言包方案\n* 多工程多版本的资源同步方案\n* 自动化首包资源抽取方案\n\n## 主要功能\n\n| 功能 | 完成情况 |\n| ----------------------------------- | ----- |\n| `C++`和`Lua`交互方案                  | 已完成 |\n| `XLua`                              | 已完成 |\n| 基于`RecastNavigation`的导航网格寻路   | 已完成 |\n| 基于`Libuv`的网络通信                 | 已完成 |\n| 自动化打包                           | 开发中 |\n| AB浏览和管理工具                      | 开发中 |\n| Editor-Phone远程调试工具              | 开发中 |\n| Shader和变体管理工具                  | 开发中 |\n| 资源加载和管理                        | 待开发 |\n| Patch和热更                          | 待开发 |\n| `LuaBT`行为树`AI`方案                | 待开发 |\n| 数据库存储和读写方案                   | 待开发 |\n| 日志输出和收集                        | 待开发 |\n| `SFM`影子跟随移动                     | 待开发 |\n| 战斗同步                             | 待开发 |\n\n## 开发环境\n\n* MacOS 10.15.6\n* Unity2019.4.39f1\n\n## 使用教程\n\n1. 将本仓库`clone`或下载到本地，放到一个新目录，如`XGameSolutions`下。\n2. 运行`XGame`里面的`project_pull_clone_developer.bat`或`project_pull_clone_developer.sh`脚本`Clone`工程，如果工程已`Clone`则进行更新。\n3. 用`Unity`打开`XUnity`下的`UnityForCoder`工程即可运行。\n\n## 目录结构\n\n``` text\n.\n├── XGameSolutions\n.   ├── XClientLua\n    ├── XConfig\n    ├── XDriver\n    ├── XGame\n    ├── XCommon\n    ├── XServer\n    └── XUnity\n        ├── UnityForCoder\n        |   ├── Assets\n        |   |   ├── Editors\n        |   |   ├── Plugins\n        |   |   ├── ResEffect\n        |   |   ├── ResModel\n        |   |   ├── ResScene\n        |   |   ├── ResSceneModel\n        |   |   ├── ResUI\n        |   |   ├── ResPublic\n        |   |   └── Runtime\n        |   ├── Packages\n        |   ├── ProjectSettings\n        |   └── ResAB\n        ├── UnityForArt\n\n```\n\n## 打包方案\n\n### 规则\n\n* 需要手动设置ABName的资源：要用的.unity场景文件，要用的模型prefab，要用的特效prefab。其他的资源不要手动设置ABName，脚本会自动分析依赖设置。\n* AB加前缀，方便分类查看，如 model_prefabname, scene_scenename, scene_dep_texturename。\n* 自动分析的依赖AB加明显标志，方便每次重新分析设置时清理，如：_dep_。\n* AB的名字只能由小写字母、数字和下划线组成，不能包含其他特殊字符，统一将 `[^a-zA-Z0-9]`替换为`_`。\n* 清理依赖AB时，有时候Unity里看不到ABName了但meta文件里还存在，可以通过读取meta文件清除ABName。\n* 所有Lua代码都打到一个同一个AB里。\n* 所有配置表都打到同一个AB里。\n* 【UI】UI按目录自动设置AB，同一个系统的UI可都打到同一个AB里。\n* 【UI】大图单独打包，一张大图一个AB。\n* 【UI】贴图和预设分离打包，减少热更量和避免循环依赖。\n* 【Shader】Shader单独打包，方便热更，避免打包冗余。\n* 【Shader】Shader变体手动维护。\n* 【Shader】代码要用的Shader统一放到同一个AB，自定义Shader加载，不能直接用Shader.Find。\n* 【Shader】非代码用的shader不要手动设ABName，通过依赖分析自动设置，避免把不再使用的Shader打进包里。\n* 【模型】只需给要用的prefab手动设置ABName，其他资源的ABName由依赖分析自动设置。\n* 【模型】模型中用到的材质球和它用到的贴图单独打包。\n* 【模型】如果贴图被多个材质球共用，贴图抽离出来单独打包。如果贴图很小（如小于50KB），可统一打到一个公共的模型贴图包里。\n* 【场景】只需给要用的.unity场景手动设置ABName，其他资源的ABName由依赖分析自动设置。\n* 【场景】场景中用到的材质球和它用到的贴图单独打包。\n* 【场景】如果贴图被多个材质球共用，贴图抽离出来单独打包。如果贴图很小（如小于50KB），可统一打到一个公共的场景贴图包里。\n* 【场景】场景中用到的prefab和它引用到的资源单独打包（shader除外，已设ABName的资源除外）。\n\n### 依赖设置ABName流程\n\n1. 清空meta文件里的依赖ABName。\n2. 获取所有ABName的依赖资源。\n3. 清空依赖资源的ABName。\n4. 有些目录强设ABName。\n5. 模型的材质球单独设置ABName。\n6. 场景的材质球单独设置ABName。\n7. 场景的Prefab单独设置ABName。\n8. 其他依赖资源设置ABname。\n9. Shader引用的资源打包到对应的Shader里。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXGameSolutions%2FXGame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FXGameSolutions%2FXGame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXGameSolutions%2FXGame/lists"}