fix: Update data asset documentation for clarity and consistency in type definitions

This commit is contained in:
Lefteris Notas
2026-05-19 18:14:11 +03:00
parent bc8ab7c48f
commit f272257cb3
5 changed files with 75 additions and 39 deletions

View File

@@ -6,6 +6,8 @@
|----------|-------|
| **Class** | [`FL_GameUtilities`] |
| **Parent** | [`BlueprintFunctionLibrary`] |
> **⚠️ UE5 BP Limitation:** `BlueprintFunctionLibrary` requires C++ to create. This is the ONE file in the framework that needs a minimal C++ class. See Section "Blueprint-Only Alternative" below for the pure BP workaround using Macro Library + direct engine nodes.
| **Folder** | [`Framework/Core/`] |
| **Categorization** | [Core\Framework] |
@@ -88,9 +90,9 @@ This is a pure Function Library. It has **no variables, no event dispatchers, no
| Function | Category | Inputs | Outputs | Description |
|----------|----------|--------|---------|-------------|
| [`LogDebug`] | Debug\Logging | `Category: Name`, `Message: String`, `Color: LinearColor` | — | Conditional screen + log output. Only fires in editor/development builds. Stripped in shipping builds via `DO_CHECK` flag. |
| [`DrawDebugSphere`] | Debug\Drawing | `WorldContext: Object`, `Center: Vector`, `Radius: Float`, `Color: LinearColor`, `Duration: Float` | — | Draws a debug sphere for visual debugging in-editor. Stripped in shipping builds. |
| [`DrawDebugString3D`] | Debug\Drawing | `WorldContext: Object`, `Location: Vector`, `Text: String`, `Color: LinearColor`, `Duration: Float` | — | Draws a 3D world-space debug string. Stripped in shipping builds. |
| [`LogDebug`] | Debug\Logging | `Category: Name`, `Message: String`, `Color: LinearColor`, `WorldContext: Object` | — | Conditional screen + log output. Uses `Branch: Is Editor Build` → then Print String + Draw Debug String. Inactive in shipping builds. |
| [`DrawDebugSphere`] | Debug\Drawing | `WorldContext: Object`, `Center: Vector`, `Radius: Float`, `Color: LinearColor`, `Duration: Float` | — | Draws a debug sphere. **BP node exists:** `Draw Debug Sphere`. Stripped in shipping. |
| [`DrawDebugString3D`] | Debug\Drawing | `WorldContext: Object`, `Location: Vector`, `Text: String`, `Color: LinearColor`, `Duration: Float` | — | Draws 3D world-space debug string. **BP node exists:** `Draw Debug String`. Stripped in shipping. |
## Blueprint Flow
@@ -126,18 +128,41 @@ All functions can be called from Construction Scripts since they are pure (no wo
## Reuse Notes
- This library ships verbatim to every project.
- Add project-specific helpers in a separate `FL_ProjectUtilities` child library that references this one.
- Do **not** add game-specific functions here — extend with a new Function Library inheriting from this pattern.
- Debug functions are automatically stripped in Shipping builds via `DO_CHECK` preprocessor — no manual removal needed.
- This library ships as a minimal C++ `BlueprintFunctionLibrary` (required for static function libraries in UE5).
- Add project-specific helpers in a separate child library or Macro Library.
- Do **not** add game-specific functions here — extend with a new library.
- For a 100% Blueprint approach, see "Blueprint-Only Alternative" below.
## Success Criteria
1. Any Blueprint in the project can call `RemapFloat` from the Math category without errors.
1. Any Blueprint can call `RemapFloat` from the Math category without errors.
2. `GetSubsystemSafe` returns `None` instead of crashing when a subsystem doesn't exist.
3. `FormatTime(3661.0)` returns `01:01:01`.
4. `LogDebug` prints to both the output log and the viewport in editor builds.
5. `LogDebug` produces no output in a shipping build.
5. `LogDebug` produces no output in a shipping build (via `Is Editor Build` branch).
## Blueprint-Only Alternative
If you cannot compile C++, replace `FL_GameUtilities` with direct Blueprint nodes or a **Blueprint Macro Library**:
| FL_GameUtilities Function | Pure BP Equivalent (no C++ needed) |
|--------------------------|-----------------------------------|
| `GetSubsystemSafe` | `Get Game Instance``Get Subsystem (Class)``Is Valid` branch |
| `GetGameFramework` | `Get Game Instance``Cast to GI_GameFramework` |
| `GetPlayerController` | `Get Player Controller (0)``Cast to PC_CoreController` |
| `HasGameplayTag` | `Does Actor Have Tag` (BP node) |
| `AddGameplayTagToActor` | `Get Actor Gameplay Tag Container``Add Tag` |
| `RemoveGameplayTagFromActor` | `Get Actor Gameplay Tag Container``Remove Tag` |
| `MakeTagFromString` | `Make Literal Gameplay Tag` OR `Get Gameplay Tag from Name` |
| `FindComponentByInterface` | `Get Component by Class` + `Does Implement Interface` |
| `RemapFloat` | `Map Range Clamped` (built-in BP math node) |
| `LerpClamped` | `Lerp` + `Clamp (Float)` |
| `FormatTime` | Custom BP function using division/modulo |
| `LogDebug` | `Branch: Is Editor Build``Print String` |
| `DrawDebugSphere` | `Draw Debug Sphere` (built-in BP node) |
| `DrawDebugString3D` | `Draw Debug String` (built-in BP node) |
**Blueprint Macro Library:** Create a **Macro Library** asset (`Content/Framework/Core/ML_GameUtilities`). Macros support `WorldContext`, execution pins, and can call engine nodes — no C++ required. The trade-off: macros are NOT "static pure" — they need execution flow pins.
---