1. Naming Conventions
Consistent naming makes blueprints readable and maintainable.
✓ DO:
- BP_PlayerCharacter
- WBP_MainMenu
- f_CalculateDamage
- b_IsPlayerAlive
- v_MaxHealth
✗ DON'T:
- player (ambiguous)
- Thing1 (meaningless)
- var (no context)
- NewBlueprint (generic)
💡 Prefixes: BP_ (Blueprint), WBP_ (Widget), f_ (function), b_ (boolean),
v_ (variable), E_ (enum), S_ (struct), M_ (material), T_ (texture)
2. Organization & Structure
Well-organized blueprints are easier to debug and maintain.
- Use Categories: Group variables by purpose (Movement, Combat, UI, etc.)
- Reroute Nodes: Keep connection lines tidy with reroute nodes
- Comment Boxes: Explain complex logic with colored comment boxes
- Collapse to Functions: Turn repeated logic into reusable functions
- Separate Concerns: One blueprint = one responsibility
3. Performance Optimization
Small optimizations add up to significant performance gains.
✓ DO:
- Cache component references
- Use Timers instead of Tick
- Disable Tick when not needed
- Use Event Dispatchers
- Pool frequently spawned actors
✗ DON'T:
- GetComponent every frame
- GetAllActorsOfClass in Tick
- Spawn/Destroy every frame
- Complex math in Tick
- String operations in loops
4. Variable Management
Proper variable scope and access control prevents bugs.
- Use Private by Default: Only expose what's necessary
- Serialize for Save Data: Mark variables that need saving
- RepNotify for Multiplayer: Use for replicated variables that trigger events
- Tooltips: Always add tooltips to public variables
- Default Values: Set sensible defaults for all variables
5. Function Design
Good functions are reusable, testable, and single-purpose.
✓ DO:
- Single responsibility
- Pure functions when possible
- Return values over output params
- Clear input/output names
- Document with tooltips
✗ DON'T:
- Functions that do too much
- 10+ input parameters
- Modify global state unexpectedly
- Side effects in getters
6. Event Handling
Use the right event system for the job.
- Event Dispatchers: One-to-many communication (health changed → update UI + play sound)
- Interfaces: Polymorphism (Interact interface for doors, chests, NPCs)
- Direct Function Calls: One-to-one communication when you have the reference
- Event Tick: ONLY for things that MUST update every frame
- Custom Events: Async operations, delayed execution, replication
7. Error Handling
Handle failure cases gracefully to prevent crashes.
- Validate References: Check IsValid before using actor references
- Array Bounds: Check array length before accessing indices
- Divide by Zero: Check denominators before division
- Log Warnings: Use Print String or Log for debugging
- Fail Gracefully: Return default values instead of crashing
8. Multiplayer Considerations
Design for multiplayer from the start, even if not needed yet.
- Authority Checks: Has Authority before server-only logic
- Replication: Only replicate what clients need to know
- RPCs: Validate inputs in Server RPCs to prevent cheating
- Client Prediction: Show immediate feedback, correct if wrong
- NetUpdateFrequency: Lower for distant/unimportant actors
9. Debugging Practices
Make debugging easier for your future self.
- Print Strings: Use different colors for different systems
- Draw Debug: Visualize raycasts, collision, AI paths
- Breakpoints: Use blueprint breakpoints to inspect values
- Watch Window: Monitor variables during play
- Log Categories: Create custom log categories for filtering
10. Common Anti-Patterns to Avoid
These patterns lead to bugs and performance issues.
- God Objects: One blueprint that does everything
- Circular Dependencies: BP_A references BP_B which references BP_A
- Magic Numbers: Use named constants instead of raw numbers
- Global State Abuse: Minimize GameInstance/GameState usage
- Copy-Paste Code: Make it a function instead
- Premature Optimization: Profile first, then optimize
📚 Quick Reference Checklist
Before committing any blueprint:
- ✓ All variables have tooltips and categories
- ✓ Functions are single-purpose and documented
- ✓ No "New Blueprint" or generic names
- ✓ Event Tick is disabled if unused
- ✓ Component references are cached
- ✓ Complex sections have comment boxes
- ✓ Connection lines are organized with reroutes
- ✓ No compiler warnings or errors
Learn More About UE5 Development
Check out our blog for in-depth tutorials and guides
View Blog