Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/build_self_hosted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: hutb Windows CI/CD

on:
push:


jobs:
windows-dev:
name: Windows CI/CD
timeout-minutes: 1440
runs-on: self-hosted:windows
env:
UE4_ROOT: C:\workspace\engine
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat

steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: build
run: |
call setEnv64.bat
call Setup.bat
.\GenerateProjectFiles.bat
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\bin\MSBuild.exe Engine\Intermediate\ProjectFiles\UE4.vcxproj"
shell: cmd
118 changes: 118 additions & 0 deletions Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# 设置项目标题
PROJECT_NAME = engine

# 设置文档输出目录
OUTPUT_DIRECTORY = Doxygen

# 设置文档输出语言
OUTPUT_LANGUAGE = Chinese

# 为每个类创建子目录
CREATE_SUBDIRS = YES

# 不显示文件的完整路径
FULL_PATH_NAMES = NO

# 使用JavaDoc风格注释作为描述
JAVADOC_AUTOBRIEF = YES

# 设置缓存大小
LOOKUP_CACHE_SIZE = 3

# 提取所有类和文件
EXTRACT_ALL = YES

# 提取私有成员
EXTRACT_PRIVATE = YES

# 提取静态成员
EXTRACT_STATIC = YES

# 类名和文件名大小写敏感
CASE_SENSE_NAMES = YES

# 按字母顺序排序描述
SORT_BRIEF_DOCS = YES

# 不警告未记录的类或文件
WARN_IF_UNDOCUMENTED = NO

# 警告信息输出到日志文件
WARN_LOGFILE = Doxygen/warnings.log

# 指定要扫描的文件路径
INPUT = Engine\Source\Runtime

# 指定要扫描的文件类型
FILE_PATTERNS = *.cpp *.h *.hpp *.cc

# 排除特定文件
EXCLUDE =

# 递归扫描目录
RECURSIVE = YES

# 包含源代码浏览视图
SOURCE_BROWSER = YES

# 保留源代码中的注释
STRIP_CODE_COMMENTS = NO

# 显示函数的被引用关系
REFERENCED_BY_RELATION = YES

# 显示函数的引用关系
REFERENCES_RELATION = YES

# 不生成字母排序的索引
ALPHABETICAL_INDEX = NO

# 支持HTML文档动态显示和隐藏
HTML_DYNAMIC_SECTIONS = YES

# 不生成索引页
DISABLE_INDEX = YES

# 不生成树状视图
GENERATE_TREEVIEW = NO

# 数学公式字体大小
FORMULA_FONTSIZE = 12

# 不生成LaTeX文档
GENERATE_LATEX = NO

# 预处理宏展开
MACRO_EXPANSION = YES

# 仅展开预定义的宏
EXPAND_ONLY_PREDEF = YES

# 包含文件的搜索路径

# 仅包含指定类型的文件
INCLUDE_FILE_PATTERNS = *.h *.hpp

# 不隐藏未记录的关系
HIDE_UNDOC_RELATIONS = NO

# 启用dot工具生成图表
HAVE_DOT = YES

# 生成类模板关系图
TEMPLATE_RELATIONS = YES

# 生成函数调用图
CALL_GRAPH = YES

# 生成函数调用者图
CALLER_GRAPH = YES

# 图像格式为SVG
DOT_IMAGE_FORMAT = svg

# 支持交互的SVG图像
INTERACTIVE_SVG = YES

# 允许dot工具生成多个图像目标
DOT_MULTI_TARGET = YES
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
包含 Carla 补丁的虚幻引擎
[模拟器](https://github.com/OpenHUTB/hutb) 的引擎
=============

## 构建步骤
1. 在终端中,导航到要保存虚幻引擎的位置并克隆虚幻引擎仓库
1. 在终端中,导航到要保存引擎的位置并克隆引擎仓库
```shell
git clone https://github.com/OpenHUTB/engine.git
```
注意:尽可能使虚幻引擎文件夹靠近根目录,因为如果路径超过一定长度,则会在步骤 2 中的 `Setup.bat` 返回错误。
注意:尽可能使引擎文件夹靠近根目录,因为如果路径超过一定长度,则会在步骤 2 中的 `Setup.bat` 返回错误。

2. 运行配置脚本:
```shell
Expand All @@ -22,7 +22,7 @@ GenerateProjectFiles.bat

4.编译解决方案后,可以打开引擎,通过启动可执行文件 `Engine\Binaries\Win64\UE4Editor.exe` 来检查所有内容是否已正确安装。

笔记:如果安装成功,虚幻引擎的版本选择器应该能够识别。可以通过右键单击任何 `.uproject` 文件并选择 `Switch Unreal Engine version` 来检查这一点。应该会看到一个弹出窗口,显示`Source Build at PATH`,这里 PATH 是选择的安装路径。如果您在右键单击文件 `.uproject` 时看不到此选择器 `Generate Visual Studio project files`,则虚幻引擎安装出现问题,可能需要重新正确安装(双击运行`engine/Engine/Binaries/Win64/UnrealVersionSelector-Win64-Shipping.exe`能达到同样的效果)。
笔记:如果安装成功,引擎的版本选择器应该能够识别。可以通过右键单击任何 `.uproject` 文件并选择 `Switch Unreal Engine version` 来检查这一点。应该会看到一个弹出窗口,显示`Source Build at PATH`,这里 PATH 是选择的安装路径。如果您在右键单击文件 `.uproject` 时看不到此选择器 `Generate Visual Studio project files`,则引擎安装出现问题,可能需要重新正确安装(双击运行`engine/Engine/Binaries/Win64/UnrealVersionSelector-Win64-Shipping.exe`能达到同样的效果)。

重要:到目前为止发生了很多事情。强烈建议在继续之前重新启动计算机。

Expand All @@ -40,11 +40,13 @@ GenerateProjectFiles.bat


## 发布安装版本
参考[链接](https://github.com/chiefGui/ue-from-source?tab=readme-ov-file#step-by-step-1) 进行虚幻引擎的发布
参考[链接](https://github.com/chiefGui/ue-from-source?tab=readme-ov-file#step-by-step-1) 进行引擎的发布

1. 使用 Visual Studio 打开 `UE4.shn` 。
2. 在右侧边栏,您应该会看到一个`解决方案资源管理器`面板。展开`Programs`文件夹并找到`AutomationTool`项目(`Engine\Source\Programs\AutomationTool`):

![Image](Engine/Documentation/fig/AutomationTool.png)

3. 右键单击它并选择`生成(Build)`,应该很快。

### 运行安装软件的构建脚本
Expand All @@ -55,6 +57,16 @@ GenerateProjectFiles.bat
如果一切顺利,您应该会看到`LocalBuilds`与该文件夹处于同一级别的`Engine`文件夹,并且控制台中没有错误。(还包括一个 InstalledDDC 文件夹:DerivedDataCache)。


### 文档

1. [下载](https://www.doxygen.nl/download.html)并安装doxygen;
2. 打开终端,进入引擎项目主目录,执行:
```shell
cd engine
doxygen
```


### 问题
```text
ERROR: Visual Studio 2017 must be installed in order to build this target.
Expand All @@ -75,7 +87,7 @@ Unable to find installation of PDBCOPY.EXE


## 内容
虚幻引擎源码的构成
引擎源码的构成

### 编译
[编译配置参考](https://docs.unrealengine.com/4.26/zh-CN/ProductionPipelines/DevelopmentSetup/BuildConfigurations/)
Expand All @@ -92,7 +104,7 @@ Unable to find installation of PDBCOPY.EXE
* 右键`.uproject`文件没有`Switch Unreal Engine version...`
解决:双击`Engine\Binaries\Win64\UnrealVersionSelector-Win64-Shipping.exe`,出现`Register this directory as an Unreal Engine installation?`后点击`是(Y)`。

* 增加`matlab`插件进行虚幻引擎编译,导致启动虚幻编辑器启动失败,原因不明。
* 增加`matlab`插件进行引擎编译,导致启动编辑器启动失败,原因不明。


## 参考链接
Expand Down
1 change: 1 addition & 0 deletions Setup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ if not exist .\Engine\Binaries\Win64\UnrealVersionSelector-Win64-Shipping.exe go
rem 安装先决条件...
echo Installing prerequisites...
start /wait Engine\Extras\Redist\en-us\UE4PrereqSetup_x64.exe /quiet
echo Prerequisites installed.

rem 完成!
goto :end
Expand Down
36 changes: 36 additions & 0 deletions Util/filter_ue4_macros.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!env python3
import re
import sys


# This is from https://stackoverflow.com/questions/5454322/python-how-to-match-nested-parentheses-with-regex
def paren_matcher (n):
# poor man's matched paren scanning, gives up
# after n+1 levels. Matches any string with balanced
# parens inside; add the outer parens yourself if needed.
# Nongreedy.
return r"[^()]*?(?:\("*n+r"[^()]*?"+r"\)[^()]*?)*?"*n

# Check we have the right number of args
if len(sys.argv) != 2:
print("Usage: filter_ue4_macros <C++ Filename>", file=sys.stderr)
sys.exit(1)

# Get the filename from args
filename = sys.argv[1]

# Slurp file into a single string
file = open(filename, 'r')
if file.closed:
print("Cannot read file", file=sys.stderr)
sys.exit(1)
content = file.read()

# Do a regular expression to replace all UE4 macros, include balanced params
# TODO: Remove C++ comments!
regex = '^(\s*)((?:UFUNCTION|UCLASS|UPROPERTY|UENUM)\s*\('+paren_matcher(25)+'\))'

content = re.sub(regex, r'\1/* UE4 Macro: \2 */', content, flags=re.MULTILINE)

# Output the content
print(content, end='')
36 changes: 36 additions & 0 deletions filter_ue4_macros.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!env python3
import re
import sys


# This is from https://stackoverflow.com/questions/5454322/python-how-to-match-nested-parentheses-with-regex
def paren_matcher (n):
# poor man's matched paren scanning, gives up
# after n+1 levels. Matches any string with balanced
# parens inside; add the outer parens yourself if needed.
# Nongreedy.
return r"[^()]*?(?:\("*n+r"[^()]*?"+r"\)[^()]*?)*?"*n

# Check we have the right number of args
if len(sys.argv) != 2:
print("Usage: filter_ue4_macros <C++ Filename>", file=sys.stderr)
sys.exit(1)

# Get the filename from args
filename = sys.argv[1]

# Slurp file into a single string
file = open(filename, 'r')
if file.closed:
print("Cannot read file", file=sys.stderr)
sys.exit(1)
content = file.read()

# Do a regular expression to replace all UE4 macros, include balanced params
# TODO: Remove C++ comments!
regex = '^(\s*)((?:UFUNCTION|UCLASS|UPROPERTY|UENUM)\s*\('+paren_matcher(25)+'\))'

content = re.sub(regex, r'\1/* UE4 Macro: \2 */', content, flags=re.MULTILINE)

# Output the content
print(content, end='')