Unreal

Author

fp

Published

October 11, 2024

Various notes on Unreal Engine and its use in the VP program.

Unreal Engine Best Practices for Naming Things

In Unreal Engine, naming conventions are important for keeping projects organized, readable, and maintainable, especially when working on larger projects with teams. Here are some best practices for naming things in Unreal Engine:

1. Use a Consistent Prefixing System

Unreal Engine encourages the use of prefixes to categorize assets. Prefixes help identify the type of an asset at a glance. Common prefixes include:

  • BP_: Blueprints (BP_Player, BP_Enemy)
  • SM_: Static Meshes (SM_Rock, SM_Table)
  • SK_: Skeletal Meshes (SK_Character, SK_Dragon)
  • M_: Materials (M_Wood, M_Metal)
  • T_: Textures (T_Grass_Diffuse, T_Wood_Normal)
  • P_: Particle Systems (P_Fire, P_Smoke)
  • S_: Sounds (S_Footsteps, S_BirdChirp)
  • AN_: Animations (AN_WalkCycle, AN_Attack)
  • UI_: User Interface assets (UI_HealthBar, UI_MainMenu)

This makes it easier to search, manage, and understand the role of assets.

2. Use Descriptive and Specific Names

Ensure asset names are descriptive and specific enough to convey the asset’s function or purpose. Avoid vague names like BP_Thing or M_Material. Instead, use:

  • BP_EnemySoldier
  • M_Concrete_Rough

The more precise the name, the easier it will be to find and understand the asset later.

3. Avoid Special Characters and Spaces

Stick to alphanumeric characters and underscores. Special characters (e.g., &, #, @) and spaces can cause issues with file paths and scripting. Use underscores to separate words (BP_ThirdPerson_Character).

4. Follow PascalCase for Asset Names

Unreal Engine recommends using PascalCase for asset names. Each word starts with a capital letter, without spaces between words.

Examples: - Correct: BP_PlayerCharacter, SM_HouseInterior - Incorrect: bp_playercharacter, sm_house interior

5. Suffix for Variants

For assets that have multiple variations (textures, meshes, or materials), use suffixes to clarify the variant type. For instance:

  • T_Grass_Diffuse
  • T_Grass_Normal
  • T_Grass_Roughness

This makes it clear which texture is for which purpose.

6. Version Control

If you are creating multiple iterations of an asset, use suffixes to indicate the version number.

Examples: - BP_PlayerCharacter_v01 - BP_PlayerCharacter_v02

This helps in version tracking and avoids confusion when different versions are in use.

7. Standard Naming for Levels

When naming levels, use a consistent system that reflects the level’s purpose or design. For example:

  • Gameplay Levels: Lvl_Forest, Lvl_Castle
  • Test Levels: Lvl_Test_CharacterControls
  • UI Levels: Lvl_MainMenu, Lvl_OptionsMenu

8. Blueprint Naming

For Blueprints, maintain clarity by including both the object and purpose in the name. For instance:

  • BP_PlayerController
  • BP_EnemyAI

9. Use Folders with Clear Names

Create a well-organized folder structure for storing assets, and make sure folder names are descriptive and logical.

Example folder structure:

/Assets
 /Blueprints 
 /Meshes
 /Textures
 /Materials
 /Animations

10. Class and Variable Naming

When working with Blueprints or code, follow Unreal’s coding standards for naming variables and classes:

  • Variables: Use camelCase (e.g., playerHealth, isJumping).
  • Classes: Use PascalCase with appropriate prefixes (e.g., APlayerCharacter, UPlayerHealthComponent).

Example Naming Scheme in Practice

For a basic player character with associated assets:

  • Blueprint: BP_PlayerCharacter
  • Skeletal Mesh: SK_PlayerCharacter
  • Materials: M_PlayerClothing
  • Textures: T_PlayerClothing_Diffuse, T_PlayerClothing_Normal
  • Animations: AN_PlayerWalk, AN_PlayerJump
  • Sound Effects: S_PlayerFootstep, S_PlayerJump

By following these guidelines, you ensure that projects are easier to navigate and maintain, especially as they grow in complexity or involve multiple contributors.

More References