### Linter Plugin Installation and Usage Source: https://context7.com/allar/ue5-style-guide/llms.txt Outlines the steps for installing and using the Linter plugin in Unreal Engine to automate style guide validation. Includes steps for installation, enabling, and scanning content. ```plaintext # Installation Steps: 1. Close all instances of UE4 2. Find Linter in Epic Launcher Vault 3. Click "Install to Engine" button 4. Open your project 5. Edit > Plugins > Search "Linter" 6. Enable checkbox and restart editor # Using Linter in Editor: 1. Right-click on content folder in Content Browser 2. Select "Scan with Linter" 3. Choose ruleset: - Gamemakin LLC Style Guide (ue4.style) - Unreal Engine Marketplace Guidelines (marketplace) 4. Review Lint Report for violations # Lint Report shows: - Asset path and name - Rule violated - Recommended action to fix - Warning vs Error severity ``` -------------------------------- ### Project Directory Structure Example Source: https://context7.com/allar/ue5-style-guide/llms.txt Illustrates a recommended project-centric folder structure for Unreal Engine projects, emphasizing logical grouping of assets. ```plaintext |-- Content |-- GenericShooter // Top-level project folder |-- Art | |-- Industrial | | |-- Ambient | | |-- Machinery | | |-- Pipes | |-- Nature | | |-- Foliage | | |-- Rocks | | |-- Trees |-- Characters | |-- Bob | |-- Common | | |-- Animations // Large asset sets get own folder | | |-- Audio | |-- Jack |-- Core // Critical blueprints | |-- Characters | |-- Engine | |-- GameModes // PascalCase, no spaces | |-- Interactables | |-- Pickups | |-- Weapons |-- Effects | |-- Electrical | |-- Fire | |-- Weather |-- Maps // All levels in Maps folder | |-- Campaign1 | |-- Campaign2 |-- MaterialLibrary // Shared/master materials | |-- Debug | |-- Metal | |-- Paint | |-- Utility |-- Placeables | |-- Pickups |-- Weapons |-- Common |-- Pistols | |-- DesertEagle |-- Rifles ``` -------------------------------- ### Asset Naming Convention Examples Source: https://context7.com/allar/ue5-style-guide/llms.txt Illustrates the base asset naming pattern `Prefix_BaseAssetName_Variant_Suffix` with examples for characters, environment assets, and flooring. ```plaintext // Asset Naming Pattern: Prefix_BaseAssetName_Variant_Suffix // Character "Bob" example assets: SK_Bob // Skeletal Mesh M_Bob // Material T_Bob_D // Texture (Diffuse/Albedo) T_Bob_N // Texture (Normal) T_Bob_Evil_D // Texture (Evil skin variant, Diffuse) // Rock environment assets: S_Rock_01 // Static Mesh (variant 01) S_Rock_02 // Static Mesh (variant 02) S_Rock_03 // Static Mesh (variant 03) M_Rock // Material MI_Rock_Snow // Material Instance (Snow variant) // Flooring with chained variants: Flooring_Marble_01 // Marble flooring variant 01 Flooring_Maple_01 // Maple wood flooring variant 01 Flooring_Tile_Squares_01 // Tile squares flooring variant 01 ``` -------------------------------- ### Event Handler Naming Convention Source: https://github.com/allar/ue5-style-guide/blob/main/README.md Functions that handle or dispatch events should start with 'On'. Collocations of 'On' are exempt from the verb rule. 'Handle' is not allowed. ```UnrealScript OnDeath OnPickup OnReceiveMessage OnMessageRecieved OnTargetChanged OnClick OnLeave ``` ```UnrealScript OnData OnTarget ``` ```UnrealScript HandleMessage HandleDeath ``` -------------------------------- ### Texture Naming and Channel Packing Source: https://context7.com/allar/ue5-style-guide/llms.txt Details texture naming conventions using the T_ prefix and suffixes for texture types, including examples of packing multiple texture layers into RGBA channels. ```plaintext // Standard Texture Suffixes T_Character_D // Diffuse/Albedo/Base Color T_Character_N // Normal Map T_Character_R // Roughness T_Character_M // Metallic (or Mask) T_Character_A // Alpha/Opacity T_Character_O // Ambient Occlusion T_Character_E // Emissive T_Character_S // Specular T_Character_B // Bump // Packed Textures (combine suffix letters for channels) T_Character_ERO // Packed: Emissive(R), Roughness(G), AO(B) T_Weapon_ORM // Packed: AO(R), Roughness(G), Metallic(B) T_Environment_RMA // Packed: Roughness(R), Metallic(G), AO(B) // Note: Alpha in Diffuse is common practice T_Glass_D // Diffuse with alpha channel (no _A needed) T_Foliage_DA // Explicitly noting alpha if needed // Special Texture Types TC_Skybox // Texture Cube RT_SceneCapture // Render Target RTC_Reflection // Cube Render Target MT_Video // Media Texture ``` -------------------------------- ### Specify Content Paths for Linting Source: https://github.com/allar/ue5-style-guide/blob/main/docs/howitworks.md Provide specific content paths to scan. Paths with spaces must be quoted. If no path is provided, '/Game' is used by default. ```bash D:\UE424\Engine\Binaries\Win64\UE4Editor-Cmd.exe "C:\Users\Allar\Documents\Unreal Projects\Linterv2Test\Linterv2Test.uproject" /Game/Content/Apple "/Game/Content/Orange Stuff" -run=Linter ``` -------------------------------- ### Blueprint Variable Naming Conventions Source: https://context7.com/allar/ue5-style-guide/llms.txt Demonstrates correct and incorrect naming conventions for Blueprint variables, including PascalCase, boolean prefixes, context, and complex types. ```cpp // Good Variable Names (PascalCase, descriptive nouns) Score Kills TargetPlayer Range CrosshairColor AbilityID // Boolean Variables (lowercase 'b' prefix) bDead // Good bHostile // Good bCanJump // Good bIsDead // Bad - don't use "Is" prefix bIsHostile // Bad - don't use "Is" prefix // Context-Aware Naming (in BP_PlayerCharacter) // Bad - redundant context: PlayerScore PlayerKills MyTargetPlayer CharacterSkills // Good - context is implied: Score Kills TargetPlayer Skills // Complex State - Use Enums Instead of Multiple Booleans // Bad: bReloading bEquipping bFiring // Good: EWeaponState WeaponState; // Enum: Idle, Reloading, Equipping, Firing // Arrays (plural nouns) Targets // Good Hats // Good EnemyPlayers // Good TargetList // Bad - don't include "List" HatArray // Bad - don't include "Array" ``` -------------------------------- ### Run Linter Commandlet Source: https://github.com/allar/ue5-style-guide/blob/main/docs/howitworks.md Execute the Linter commandlet against a project. Returns error codes for linting failures, errors, or warnings. ```bash D:\UE424\Engine\Binaries\Win64\UE4Editor-Cmd.exe "C:\Users\Allar\Documents\Unreal Projects\Linterv2Test\Linterv2Test.uproject" -run=Linter ``` -------------------------------- ### Specify Lint Rule Set Source: https://github.com/allar/ue5-style-guide/blob/main/docs/howitworks.md Use the -RuleSet argument to specify which lint rule set to apply. If not provided, the project's default rule set is used. ```bash -RuleSet=ue4.style ``` ```bash -RuleSet=marketplace ``` -------------------------------- ### Blueprint Function Naming Conventions Source: https://context7.com/allar/ue5-style-guide/llms.txt Provides guidelines for naming Blueprint functions, including standard verbs, boolean-returning functions, event handlers, RPCs, and property replication notifications. ```cpp // Standard Functions (verbs, present tense) Fire() // Context: Weapon class Jump() // Context: Character class Explode() ReceiveMessage() SortPlayerArray() GetArmOffset() UpdateTransforms() EnableBigHeadMode() // Bool-returning Info Functions (ask questions) IsDead() // Good IsOnFire() // Good IsAlive() // Good HasWeapon() // Good - "Has" is a verb CanReload() // Good - "Can" is a verb WasCharging() // Good - past tense for previous state // Event Handlers and Dispatchers (start with "On") OnDeath() OnPickup() OnReceiveMessage() OnTargetChanged() OnClick() // Property RepNotify Functions OnRep_Health() // Always use OnRep_VariableName OnRep_Ammo() OnRep_PlayerState() // Remote Procedure Calls (prefix with target) ServerFireWeapon() // Runs on server ClientNotifyDeath() // Runs on owning client MulticastSpawnEffect() // Runs on all clients // Bad Function Names Dead() // Ambiguous - is dead? will die? ProcessData() // Vague - what data? what process? HandleMessage() // Use "On" prefix instead ``` -------------------------------- ### Run Linter Commandlet for CI/CD Source: https://context7.com/allar/ue5-style-guide/llms.txt Invoke the Linter commandlet via command line to automate project validation. Use specific flags to generate reports or enforce strict error handling for CI/CD pipelines. ```bash # Basic commandlet invocation UE4Editor-Cmd.exe "Path/To/Project.uproject" -run=Linter # Full example with absolute paths D:\UE424\Engine\Binaries\Win64\UE4Editor-Cmd.exe \ "C:\Users\Dev\Projects\MyGame\MyGame.uproject" \ -run=Linter # Specify ruleset -run=Linter -RuleSet=ue4.style # Gamemakin Style Guide -run=Linter -RuleSet=marketplace # Epic Marketplace Guidelines # Scan specific folders D:\UE424\Engine\Binaries\Win64\UE4Editor-Cmd.exe \ "C:\Projects\MyGame.uproject" \ /Game/Content/Characters \ "/Game/Content/My Assets" \ -run=Linter # Generate reports -run=Linter -json # JSON report in Saved/LintReports/ -run=Linter -json=MyReport.json # Custom JSON filename -run=Linter -html # HTML report -run=Linter -html=Report.html # Custom HTML filename # Strict mode for CI/CD -run=Linter -TreatWarningsAsErrors # Return error code 2 on warnings # Exit codes: # 0 = Success, no errors # 1 = Linter failed to run # 2 = Lint report contains errors (or warnings with -TreatWarningsAsErrors) ``` -------------------------------- ### Static Mesh and Texture Requirements Source: https://context7.com/allar/ue5-style-guide/llms.txt Technical standards for assets, including UV, collision, and power-of-2 dimension requirements. ```text # Static Mesh Requirements: - All meshes MUST have UVs (4.1.1) - No overlapping UVs for lightmaps (4.1.2) - LODs set up for distant viewing (4.2) - Modular assets snap to 10-unit grid (4.3) - All meshes have collision defined (4.4) - Correct world-scale, no editor scaling needed (4.5) # Texture Requirements: - Dimensions must be powers of 2 (7.1) Valid: 128x512, 1024x1024, 2048x1024 Invalid: 100x100, 500x500 - UI textures exempt from power-of-2 rule - Maximum dimension: 8192 pixels (7.3) - Uniform texture density per project (7.2) Example: 8 pixels per unit = 1024x1024 for 100x100 unit surface - Correct Texture Group assignment (7.4) UI textures -> UI texture group World textures -> World texture group # Level/Map Requirements: - Zero errors or warnings on load (6.1) Console command: "map check" - Lighting built for distribution builds (6.2) - No visible z-fighting (6.3) # Marketplace-specific: - Overview map required (named with "Overview") - Demo map with documentation (named with "Demo") ``` -------------------------------- ### Generate HTML Report Source: https://github.com/allar/ue5-style-guide/blob/main/docs/howitworks.md Add the -html switch to generate an HTML report. The report name can be overridden with -html=ReportName.html. Paths are relative to Saved/LintReports/ or can be absolute. ```bash -html ``` ```bash -html=ReportName.html ``` -------------------------------- ### Treat Warnings as Errors Source: https://github.com/allar/ue5-style-guide/blob/main/docs/howitworks.md Use the -TreatWarningsAsErrors switch to make Linter return an error code of 2 if any warnings are found in the report. ```bash -TreatWarningsAsErrors ``` -------------------------------- ### RPC Naming Convention Source: https://github.com/allar/ue5-style-guide/blob/main/README.md Remote Procedure Calls (RPCs) must be prefixed with 'Server', 'Client', or 'Multicast'. Follow standard function naming rules after the prefix. ```UnrealScript ServerFireWeapon ClientNotifyDeath MulticastSpawnTracerEffect ``` ```UnrealScript FireWeapon ``` ```UnrealScript ServerClientBroadcast ``` ```UnrealScript AllNotifyDeath ``` ```UnrealScript ClientWeapon ``` -------------------------------- ### Generate JSON Report Source: https://github.com/allar/ue5-style-guide/blob/main/docs/howitworks.md Add the -json switch to generate a JSON report. The report name can be overridden with -json=ReportName.json. Paths are relative to Saved/LintReports/ or can be absolute. ```bash -json ``` ```bash -json=ReportName.json ``` -------------------------------- ### Identifier Naming Conventions Source: https://context7.com/allar/ue5-style-guide/llms.txt Rules for naming assets and variables, restricting characters to alphanumeric and underscores. ```text # Allowed Characters (RegEx: [A-Za-z0-9_]+) ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 1234567890 _ (use sparingly) # Forbidden in ALL Identifiers: - Spaces (any whitespace) - Backslashes \ - Symbols: # ! @ $ % - Unicode characters # Examples: Zoe // Good (character named Zoë) Zoë // Bad - unicode Desert_Eagle // Good Desert Eagle // Bad - space DesertEagle // Best - PascalCase ``` -------------------------------- ### Implement Texture Size Lint Rule in C++ Source: https://github.com/allar/ue5-style-guide/blob/main/docs/howitworks.md This C++ implementation checks if a texture's dimensions exceed predefined maximums. It reports a violation if the texture is too large, providing a formatted message with recommended dimensions. This rule can be configured via Blueprint. ```cpp bool ULintRule_Texture_Size_NotTooBig::PassesRule_Internal_Implementation(UObject* ObjectToLint, const ULintRuleSet* ParentRuleSet, TArray& OutRuleViolations) const { const UTexture2D* Texture = CastChecked(ObjectToLint); int32 TexSizeX = Texture->GetSizeX(); int32 TexSizeY = Texture->GetSizeY(); // Check to see if textures are too big if (TexSizeX > MaxTextureSizeX || TexSizeY > MaxTextureSizeY) { FText RecommendedAction = NSLOCTEXT("Linter", "LintRule_Texture_Size_NotTooBig_TooBig", "Please shrink your textures dimensions so that they fit within {0}x{1} pixels."); OutRuleViolations.Push(FLintRuleViolation(ObjectToLint, GetClass(), FText::FormatOrdered(RecommendedAction, MaxTextureSizeX, MaxTextureSizeY))); return false; } return true; } ``` -------------------------------- ### Common Asset Type Prefixes Source: https://context7.com/allar/ue5-style-guide/llms.txt Lists common prefixes used for various Unreal Engine asset types to facilitate quick identification and filtering in the content browser. ```plaintext // Most Common Asset Types BP_PlayerCharacter // Blueprint M_Metal_Chrome // Material S_Chair_Office // Static Mesh (use S_, not SM_) SK_Character_Main // Skeletal Mesh T_Wood_Oak_D // Texture (with _D suffix for Diffuse) PS_Explosion_Fire // Particle System WBP_MainMenu // Widget Blueprint // Animation Assets ABP_Character // Animation Blueprint A_Run_Forward // Animation Sequence AM_Attack_Combo // Animation Montage BS_Locomotion // Blend Space AO_Aim_Rifle // Aim Offset LS_Cinematic_Intro // Level Sequence // AI Assets AIC_Enemy // AI Controller BT_EnemyBehavior // Behavior Tree BB_EnemyData // Blackboard BTTask_FindTarget // Behavior Tree Task BTService_UpdateTarget // Behavior Tree Service EQS_FindCover // Environment Query // Materials MI_Metal_Rusty // Material Instance MF_Noise_Perlin // Material Function PP_ColorGrading // Post Process Material MPC_GlobalParams // Material Parameter Collection // Blueprints BPFL_MathHelpers // Blueprint Function Library BPI_Interactable // Blueprint Interface BP_Door_Component // Blueprint Component (note suffix) ``` -------------------------------- ### Implement Custom Lint Rule in C++ Source: https://context7.com/allar/ue5-style-guide/llms.txt Define custom validation logic by overriding PassesRule_Internal_Implementation. Ensure the class is configured via a LintRuleSet Data Asset in the editor. ```cpp // Custom Lint Rule Implementation (C++) // File: LintRule_Texture_Size_NotTooBig.cpp bool ULintRule_Texture_Size_NotTooBig::PassesRule_Internal_Implementation( UObject* ObjectToLint, const ULintRuleSet* ParentRuleSet, TArray& OutRuleViolations) const { // Cast to expected type const UTexture2D* Texture = CastChecked(ObjectToLint); int32 TexSizeX = Texture->GetSizeX(); int32 TexSizeY = Texture->GetSizeY(); // Check rule condition if (TexSizeX > MaxTextureSizeX || TexSizeY > MaxTextureSizeY) { // Create violation with recommended action FText RecommendedAction = NSLOCTEXT("Linter", "LintRule_Texture_Size_NotTooBig_TooBig", "Please shrink texture dimensions to fit within {0}x{1} pixels."); OutRuleViolations.Push(FLintRuleViolation( ObjectToLint, GetClass(), FText::FormatOrdered(RecommendedAction, MaxTextureSizeX, MaxTextureSizeY) )); return false; // Rule violated } return true; // Rule passed } // Blueprint child class exposes configuration: // - MaxTextureSizeX = 8192 (editable) // - MaxTextureSizeY = 8192 (editable) // - Rule display name and description (localized) // LintRuleSet configuration in editor: // 1. Create Data Asset of type LintRuleSet // 2. Set NamingConvention asset reference // 3. Add Class Lint Rules Map entries: // - UTexture2D -> [LintRule_Texture_Size_NotTooBig, ...] // - UBlueprint -> [LintRule_BP_Compiles, ...] // - AnyObject_LinterDummyClass -> [LintRule_NamingConvention, ...] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.