2021SC@SDUSC
1 综述
“Flax Engine is a complete suite of game development tools made by game developers, for game developers. Our goal is to create the most powerful game engine in the industry and to give creators all across the globe the tools to harness this power to create world-class gaming experiences, no matter their budget or team size.”
Flax是一个强大的开源游戏引擎,吸取了unity和unreal的优点。实际上,它整体的架构与unity都有许多相似之处。隐私政策:https : //flaxengine.com/privacy
根据文档,flax engine具有很多优点:
支持C#、C ++脚本
自动绘制、批量实例化
异步IO
跨平台
GPU Lightmaps功能
视效脚本
VFX工具
多样化的预设
本地化工具
支持网络多人游戏
开放世界工具
编辑器中热重载C#/ C ++
完整开源
可以直接和开发者交流(这也算优点吗?随便哪个小项目都能做到和开发者直接沟通吧)
轻量级开发
官网:https://flaxengine.com/
我们可以直接去git把代码拉下来。
两大部分,一个是引擎代码本体,一个是文档。
文档下下来,先build一下,然后run,就能在本地访问整个文档网站了。
可以看到分两个部分,一部分是引擎的使用指南,第二个就是API。
先进到manual里看看。
每一个模块都分的非常清楚,每一级菜单点进去还有很多次级菜单,层次清楚。如果后面看源码的时候,有一些和实际功能相关的部分不清楚,就可以用到。
然后就是API。
对源码里重要的API做了简短的说明。
Enum InputGamepadIndex
The input gamepad index.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
[Tooltip("The input gamepad index.")]public enum InputGamepadIndex
Fields
Name | Description |
All | All detected gamepads. |
Gamepad0 | The gamepad no. 0. |
Gamepad1 | The gamepad no. 1. |
Gamepad2 | The gamepad no. 2. |
Gamepad3 | The gamepad no. 3. |
Gamepad4 | The gamepad no. 4. |
Gamepad5 | The gamepad no. 5. |
例如,上面就给出了一个数据类型枚举类InputGamepadIndex,属于FlaxEngin命名空间。六种不同的Gamepad类型,同时还有一个all类型代表全部gamepad。
现在给出源代码的结构
Source/ - source code lcoation
- Editor/ - Flax Editor source code
- Engine/ - Flax Engine source code
- Platforms/ - per-platform sources and dependency files
- DotNet/ - C# dependencies
- Editor/ - Flax Editor binaries
- PlatformName/ - per-platform files
- Binaries/ - per-platform binaries
- Game/ - Flax Game binaries
- Mono/ - Mono runtime files and data
- ThirdParty/ - prebuild 3rd Party binaries
- Binaries/ - per-platform binaries
- Shaders/ - shaders source code
- ThirdParty/ - 3rd Party source code
- Tools/ - development tools source code
Source/ - 源代码
- Editor/ - 编辑器
- Engine/ - 引擎
- Platforms/ - 平台与依赖文件
- DotNet/ - C# 依赖
- Editor/ - Flax 编辑器源代码
- PlatformName/ - 平台文件
- Binaries/ - 平台源码
- Game/ - Flax Game 源码
- Mono/ - Mono源码
- ThirdParty/ - 第三方库
- Binaries/ - 平台源码
- Shaders/ - 着色器
- ThirdParty/ - 第三方库
- Tools/ - 开发工具源码
我的计划是看Engine部分中的若干重要部分,先把每一部分的功能搞清楚,再看核心内容。像根目录下的第三方库,内容复杂,同时并不属于flax自身的核心,那么就了解一下调用了哪些库,发挥了什么功能即可。
Flax的优点主要在继承了unity的小巧方便,又提升了速度,强化了功能。Flax是如何实现引擎的核心功能,又是如何在源码的级别上优化的,这是之后分析的重点。