Utilities
Categories:
GS_Core includes a rich set of utility libraries for common game development patterns. These are header-only (or lightweight) utilities that any component or system can use without additional setup.
For usage guides and setup examples, see The Basics: GS_Core.
Contents
- Physics Trigger Volume
- Easing Curves
- Spring Dampers
- Orbital Solver
- Noise
- Envelope
- Gradients
- Entity Utilities
- Weighted Random
- Angle Helpers
- Spline Utilities
- Serialization Helpers
- Common Enums
- Comparisons
- Debug Logging
- See Also
Physics Trigger Volume
PhysicsTriggeringVolume is a non-component base class that manages the full lifecycle of a physics trigger or collision volume — entity tracking, enter/exit/hold callbacks, and collision contact events. Inherit from it to create interactive volumes without boilerplate physics code. PhysicsTriggerComponent is the concrete O3DE component that wraps this base and adds game-lifecycle awareness (standby handling).
Easing Curves
The Curves namespace provides 40+ easing functions and a CurveType enum for data-driven curve selection. All functions take a normalized t (0 → 1) input. The dispatch function EvaluateCurve(CurveType, t) routes to the correct function at runtime. Curve families: Linear, Quadratic, Cubic, Quartic, Quintic, Sine, Exponential, Circular, Back, Elastic, and Bounce.
Spring Dampers
The Springs namespace provides 6 spring-damper types for physics-based animation and smoothing — each available in float, Vector2, and Vector3 overloads (plus a Quaternion variant). All springs use a halflife parameter (seconds to reach 50% of goal) rather than raw stiffness/damping constants.
Orbital Solver
The OrbitalSolver namespace (GS_Core::Math) provides a pivot-aware position and pose blend primitive — Linear / Cylindrical / Spherical shapes around a configurable pivot. Used by PhantomCam’s cross-cam blend execution, DynamicOrbitBody per-tick damping, and LeadingFollowBody band response. The pose form returns a “look at pivot” rotation by default, making it a one-call replacement for spring damping when motion naturally arranges around a pivot.
Noise
The Noise namespace (GS_Core::Noise) provides a project-owned, license-clean Perlin noise toolkit — signed Perlin 1D / 2D / 3D, fractal multi-octave, and the LayeredPerlin1D (amp, freq, phase) stack with its NoiseLayer struct. Used by PhantomCam camera shake (PerlinNoise and ImpulseNoise stages) and open for adoption by any UI / VFX / unit modulation consumer that needs time-varying smooth values. Stateless, deterministic across runs, thread-safe.
Envelope
The Envelope namespace (GS_Core::Envelope) provides a reflected ADSR envelope — attack, decay, sustain and release — with Evaluate, TotalDuration and IsFinished. General-purpose rather than audio-specific: any value that should rise, hold and fall over time can be described as an authored envelope instead of hand-written timing code. Because the struct is reflected, the shape is tuned in the Inspector rather than in source.
Gradients
Multi-stop gradient types (FloatGradient, Vector2Gradient, ColorGradient) for sampling values over a normalized [0,1] range. Used throughout the motion system and feedback effects for curve-based value animation. ColorGradient exposes independent EvaluateColor(t) and EvaluateAlpha(t) channels.
Entity Utilities
The EntityUtility namespace provides helper functions for entity lookup by name — returning either an AZ::Entity* or AZ::EntityId.
Weighted Random
RandomUtils::GetRandomWeighted<T> selects a key from an AZStd::unordered_map<T, float> with probability proportional to each entry’s float weight. Requires a caller-provided AZ::SimpleLcgRandom instance.
Angle Helpers
The Orientation namespace maps angles to discrete sector indices for directional gameplay — facing directions, animation sectors, compass queries. Includes the SectionConfig enum (x4 through x24 presets), RotationDirection, hysteresis support, and yaw/quaternion helpers.
Spline Utilities
The SplineUtility namespace provides helper functions for O3DE spline queries — closest world point, closest local point, and normalized fraction along a spline — taking an entity ID and world/local position.
Serialization Helpers
Three helpers that reduce reflection boilerplate: GS_ReflectionIncludes.h (single-include for all reflection headers), and GS_AssetReflectionIncludes.h (extends with asset serialization).
Common Enums
Shared enum types used across the framework: CurveType (maps to all easing functions for serialized curve selection) and BooleanConditions (condition evaluation for dialogue and record-keeping systems).
Comparisons
ComparisonUtility.h supplies BooleanComparison(value, compareValue, condition) for float, AZ::u32 and AZ::s32, evaluating one of the BooleanConditions — equal, greater, less and so on — against a pair of values.
This is what lets a condition be authored as data: a component exposes a comparison enum and a threshold in the Inspector, and the code evaluates whichever comparison the designer picked without a branch per operator.
#include <GS_Core/Utility/ComparisonUtility.h>
if (GS_Core::BooleanComparison(currentHealth, m_threshold, m_condition))
{
// the authored condition passed
}
Debug Logging
DebugLoggingHelper is a small mix-in that gives a component a Logging Depth property and gated log output. Above zero, the component reports what it is doing; at zero it stays silent.
GS_ManagerComponent inherits it, which is why every manager can be made verbose individually from the Inspector. Inherit it on your own components when you want the same per-instance diagnostic control — it is more useful than a global verbosity flag precisely because you can turn up one system while the rest stays quiet.
See Also
For conceptual overviews and usage guides:
For related resources:
Get GS_Core
GS_Core — Explore this gem on the product page and add it to your project.