Files
UnrealEngine/Engine/Source/Runtime/AIModule/AICodingStandard.md
2025-05-18 13:04:45 +08:00

44 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## AI Teams coding standard extension
_In all cases [Epics coding standard](https://docs.unrealengine.com/en-US/ProductionPipelines/DevelopmentSetup/CodingStandard/index.html) has higher priority. AI Teams coding standard needs to remain compatible and act as an extension and clarification where Epics is unclear or leaves room for interpretation._
#### Code organization and naming
##### cpp files
* If a source file has implementation of multiple structs/classes, use the following header to mark the beginning of each class/struct to make it super clear when new implementation begins.
```
//----------------------------------------------------------------//
// FMyTypeName
//----------------------------------------------------------------//
```
* Keep member functions of a given type together, avoid interlacing functions of multiple types.
##### Subsystems
`WorldSubsystem`-derived classes need to have a `Subsystem` postfix, while other subsystem-y classes that are not related with any of the engine's subsystem classes get a `Manager` postfix.
#### Namespaces
[Unreal Engine standard here](https://docs.unrealengine.com/en-US/ProductionPipelines/DevelopmentSetup/CodingStandard/index.html#namespaces).
**Nested namespaces** declaration should be done in a single line, like so:
```c++
namespace UE::Mass::Debug
{
//...
} // namespace UE::Mass::Debug
```
#### Debug-time code
Debugging-related member function names should start with Debug prefix.
___
### FAQ
*add things that can be best explained as a simple answer to a simple question. These things can be reflected above as well. This section needs to remain last at all times.*
**Q**: What do I do when the thing?
**A**: You do the thing.