Skip to main content

Best practices

On this page I'll list some best practice basics. It's intended to be a list of "wish I'd known that sooner" items.

I assume that you are familiar with everything from the blueprints section.

Blueprint Interfaces

Heuristic

Use interfaces where you can, but only when the number of use cases exceeds one.

Example 1: if multiple actors can be picked up, have them implement IPickupable.
Example 2: if receiving currency is unique to Players, you should not use interface for it.

Prevent casting and make your blueprints more modular by using Blueprint Interfaces.

Enums, Structs and Datatables

Heuristic

Everything you don't want to hardcode goes into an Enum or a DataTable.

  • Enums are a way to create a list of predefined values that you can use in your blueprints.
  • Structs allow you to make structured collections of data that fit your needs.
  • DataTables are lightweight databases where you can store information based on a struct.

Blueprint Function Libraries

Heuristic

Find yourself copy-pasting logic between blueprints?
It's time to create a Blueprint Function Library.

Blueprint Function Libraries are a way to create reusable functions that can be called from any blueprint.

What are your thoughts?