资源
通用
| 资源类型 |
前缀 |
后缀 |
| Level / Map |
|
|
| Level (Persistent) |
|
_P |
| Level (Audio) |
|
_Audio |
| Level (Lighting) |
|
_Lighting |
| Level (Geometry) |
|
_Geo |
| Level (Gameplay) |
|
_Gameplay |
| Blueprint |
BP_ |
|
| Material |
M_ |
|
| Static Mesh |
SM_ |
|
| Skeletal Mesh |
SK_ |
|
| Texture |
T_ |
_* |
| Particle System |
PS_ |
|
| Widget Blueprint |
WBP or WB |
|
动作
| 资源类型 |
前缀 |
| Aim Offset |
AO_ |
| Aim Offset 1D |
AO_ |
| Animation Blueprint |
ABP_ |
| Animation Composite |
AC_ |
| Animation Montage |
AM_ |
| Animation Sequence |
AS_ |
| Blend Space |
BS_ |
| Blend Space 1D |
BS_ |
| Level Sequence |
LS_ |
| Morph Target |
MT_ |
| Paper Flipbook |
PFB_ |
| Rig |
Rig_ |
| Skeletal Mesh |
SK_ |
| Skeleton |
SKEL_ |
AI
| 资源类型 |
前缀 |
| AI Controller |
AIC_ |
| Behavior Tree |
BT_ |
| Blackboard |
BB_ |
| Decorator |
BTDecorator_ |
| Service |
BTService_ |
| Task |
BTTask_ |
蓝图
| 资源类型 |
前缀 |
| Blueprint |
BP_ |
| Blueprint Function Library |
BPFL_ |
| Blueprint Interface |
BPI_ |
| Blueprint Macro Library |
BPML_ |
| Enumeration |
E |
| Structure |
F |
| Widget Blueprint |
WBP_ |
材质
| 资源类型 |
前缀 |
| Material |
M_ |
| Material (Post Process) |
PP_ |
| Material Function |
MF_ |
| Material Instance |
MI_ |
| Material Parameter Collection |
MPC_ |
| Subsurface Profile |
SP_ |
| Physical Materials |
PM_ |
纹理
| 资源类型 |
前缀 |
后缀 |
| Texture |
T_ |
|
| Texture (Diffuse) |
T_ |
_D |
| Texture (Albedo) |
T_ |
_D |
| Texture (Base Color) |
T_ |
_D |
| Texture (Normal) |
T_ |
_N |
| Texture (Roughness) |
T_ |
_R |
| Texture (Alpha/Opacity) |
T_ |
_A |
| Texture (Ambient Occlusion) |
T_ |
_AO |
| Texture (Bump) |
T_ |
_B |
| Texture (Emissive) |
T_ |
_E |
| Texture (Mask) |
T_ |
_M |
| Texture (Specular) |
T_ |
_S |
| Texture (Packed) |
T_ |
_* |
| Texture Cube |
TC_ |
|
| Media Texture |
MT_ |
|
| Render Target |
RT_ |
|
| Cube Render Target |
RTC_ |
|
| Texture Light Profile |
TLP |
|
杂项
| 资源类型 |
前缀 |
后缀 |
| Animated Vector Field |
VFA_ |
|
| Camera Anim |
CA_ |
|
| Color Curve |
Curve_ |
_Color |
| Curve Table |
Curve_ |
_Table |
| Data Asset |
*_ |
|
| Data Table |
DT_ |
|
| Float Curve |
Curve_ |
_Float |
| Foliage Type |
FT_ |
|
| Force Feedback Effect |
FFE_ |
|
| Landscape Grass Type |
LG_ |
|
| Landscape Layer |
LL_ |
|
| Matinee Data |
Matinee_ |
|
| Media Player |
MP_ |
|
| Object Library |
OL_ |
|
| Redirector |
|
|
| Sprite Sheet |
SS_ |
|
| Static Vector Field |
VF_ |
|
| Touch Interface Setup |
TI_ |
|
| Vector Curve |
Curve_ |
_Vector |
2D
| 资源类型 |
前缀 |
| Paper Flipbook |
PFB_ |
| Sprite |
SPR_ |
| Sprite Atlas Group |
SPRG_ |
| Tile Map |
TM_ |
| Tile Set |
TS_ |
物理
| 资源类型 |
前缀 |
| Physical Material |
PM_ |
| Physical Asset |
PHYS_ |
| Destructible Mesh |
DM_ |
声音
| 资源类型 |
前缀 |
后缀 |
| Dialogue Voice |
DV_ |
|
| Dialogue Wave |
DW_ |
|
| Media Sound Wave |
MSW_ |
|
| Reverb Effect |
Reverb_ |
|
| Sound Attenuation |
ATT_ |
|
| Sound Class |
SoundClasses/ |
|
| Sound Concurrency |
|
_SC |
| Sound Cue |
A_ |
_Cue |
| Sound Mix |
Mix_ |
|
| Sound Wave |
A_ |
|
界面
| 资源类型 |
前缀 |
| Font |
Font_ |
| Slate Brush |
Brush_ |
| Slate Widget Style |
Style_ |
| Widget Blueprint |
WBP_ |
目录
一个示例:
|-- Content
|-- GenericShooter
|-- Art
| |-- Industrial
| | |-- Ambient
| | |-- Machinery
| | |-- Pipes
| |-- Nature
| | |-- Ambient
| | |-- Foliage
| | |-- Rocks
| | |-- Trees
| |-- Office
|-- Characters
| |-- Bob
| |-- Common
| | |-- Animations
| | |-- Audio
| |-- Jack
| |-- Steve
| |-- Zoe
|-- Core
| |-- Characters
| |-- Engine
| |-- GameModes
| |-- Interactables
| |-- Pickups
| |-- Weapons
|-- Effects
| |-- Electrical
| |-- Fire
| |-- Weather
|-- Maps
| |-- Campaign1
| |-- Campaign2
|-- MaterialLibrary
| |-- Debug
| |-- Metal
| |-- Paint
| |-- Utility
| |-- Weathering
|-- Placeables
| |-- Pickups
|-- Weapons
|-- Common
|-- Pistols
| |-- DesertEagle
| |-- RocketPistol
|-- Rifles
- 使用 PascalCase 大小写规范。
- 不要使用非 ASCII 字符。
- 使用顶级目录来保存所有工程资源。
- 测试用资源放在 Developers 目录下。
- Maps 目录存储所有的地图文件。
- Core 目录存储系统蓝图资源以及其他系统资源。
- MaterialLibrary 目录存储材质库。
- 不要创建名为 Assets 或者 AssetTypes 的目录(如 Textures )。
- 超大资源要有自己的目录结构。
蓝图 & C++
蓝图尽量保持连线对齐。
编译
确保编译 0 Warnings 和 0 Errors 。
不要提交断开的孤立蓝图节点。
变量
C++ 下的变量前缀:
| 类型 |
前缀 |
| Template |
T |
| UObject |
U |
| AActor |
A |
| SWidget |
S |
| Interface |
I |
| Enum |
E |
| Class |
F |
| Struct |
F |
- 使用 PascalCase 大小写规范。
- 所有非布尔类型的变量必须使用简短、清晰并且意义明确的名词作为变量名。
- 布尔变量需要前缀 b 。
- 复杂状态应该考虑枚举表示而不是多个布尔组合。
- 考虑上下文,如在 BP_PlayerCharacter 中使用 Score 而不是 PlayerScore 。
- 数组名使用复数描述。
- 视可编辑类型的变量作为 Public 类型变量,视不可编辑的变量作为 Protected 类型变量。
- 尽量用 protected ,而不是 private 。
- 如果一个变量可以被编辑,但通常不会有人碰到,那么就把它标记为 Advanced Display 。
- Transient 表示初始值为 0 或者 nullptr 的 运行时 & 无需序列化 的变量。
函数 & 委托
- 所有函数的命名都应该是动词,如 IsEnemy 而不是 Enemy 。
- 属性的状态变化响应函数应该命名为 OnRep_Variable 。
- 委托和响应函数应以 On 开头而不是 Handle ,然后遵守动词规则,过去式应移到最后。
- RPC 函数应该用目标作为前缀,Server、 Client 或者 Multicast 。
- 所有函数都应该 return ,即便是蓝图。
更多规范