API Reference
Assets
| Type | Base | Purpose |
|---|---|---|
UCrimsonHitProfile | UDataAsset | Preset, dedup policy, target limits, query rate, cue tag |
UTargetingPreset | UDataAsset (TargetingSystem module) | Holds the selection, filter and sort tasks |
UCrimsonHitZonePhysicalMaterial | UPhysicalMaterial | Names a hit zone on a physics-asset body |
UCrimsonHitProfile properties
| Property | Type | Default | Meaning |
|---|---|---|---|
TargetingPreset | UTargetingPreset* | none | Selection, filtering and sorting. All geometry lives here |
DedupPolicy | ECrimsonHitDedupPolicy | OncePerWindow | How often one actor may be reported by a window |
DedupInterval | float | 0.25 | Seconds before re-eligibility. OncePerInterval only |
MaxTargetsPerWindow | int32 | 0 | Distinct actors one window may report. 0 is unlimited |
MaxTargetsPerQuery | int32 | 0 | Actors one query may report. Hidden under OncePerWindow |
QueryHz | float | 0 | Queries per second. 0 queries every tick |
ImpactCueTag | FGameplayTag | none | Passed through in the report and the cosmetic batch. Never executed |
bResolveHitZones | bool | true | Resolve a zone tag per impact |
bAlwaysDrawDebug | bool | false | Draw this profile even with the console variable off |
UCrimsonHitDetectionComponent
| Member | Kind | Notes |
|---|---|---|
FindHitDetectionComponent | Static function | Finds the component on an actor |
OpenHitWindow | Function | Server only. Returns an invalid handle on clients |
CloseHitWindow | Function | Safe to call for an already-closed handle |
CloseAllHitWindows | Function | Called automatically on EndPlay |
IsHitWindowOpen | Function | Pure |
GetOpenHitWindowCount | Function | Pure |
ExecuteHitQuery | Function | One-shot query. Server only |
SetActiveWeaponActor | Function | Weapon used by windows that do not name one |
GetActiveWeaponActor | Function | Pure |
SetActiveSweepMesh | Function | Sweep mesh used by windows that do not name a weapon, for weapons that are components rather than actors |
GetActiveSweepMesh | Function | Pure |
ResolveActiveWeapon | Native Event | Override in a C++ or Blueprint subclass to answer which weapon is held. Defaults to the two setters above |
SetShapeScale / GetShapeScale | Function | Persistent uniform size multiplier for every window this actor opens |
OpenKeyedHitWindow | C++ only | For callers that cannot hold a handle, such as an animation notify |
CloseKeyedHitWindow | C++ only | Counterpart to the above |
OnHitTargetsResolved | Delegate | Server only. One broadcast per query with new targets |
OnHitImpactCosmetic | Delegate | All machines. Cosmetic only |
OnHitWindowStateChanged | Delegate | Server only. Fires on open and on close |
Structs and enums
| Type | Fields | Notes |
|---|---|---|
FCrimsonHitReport | Window, Profile, Instigator, WeaponActor, ContextTag, ImpactCueTag, Impacts, TargetData | The server-side result. TargetData is never replicated |
FCrimsonHitImpact | HitActor, ImpactPoint, ImpactNormal, BoneName, ZoneTag | Overlap results carry no bone, normal or zone |
FCrimsonHitImpactBatch | Instigator, ImpactCueTag, ContextTag, Impacts | The cosmetic payload. Capped by MaxReplicatedImpactsPerBatch |
FCrimsonHitWindowParams | WeaponActor, SweepMeshOverride, ContextTag, ExtraIgnoredActors, FacingOverride, MaxDuration, ShapeScale, PresetInstance | All optional. ShapeScale multiplies with the component's. PresetInstance is how the nodes hand over the preset copy they wrote their pins onto; leave it unset and the component makes its own |
FCrimsonActiveWeapon | WeaponActor, SweepMesh | What ResolveActiveWeapon returns. Both optional: WeaponActor feeds the ignore list and the report, SweepMesh supplies the sockets. A null SweepMesh means the mesh is searched for on WeaponActor |
FCrimsonProjectileLaunchParams | Velocity, HomingTarget, LifetimeOverride, MaxRange | One shot's launch. LifetimeOverride also bounds the hit window; MaxRange is a straight-line cutoff, 0 for unlimited |
FCrimsonHitWindowHandle | Handle | Server-side only, never replicated |
ECrimsonHitDedupPolicy | OncePerWindow, OncePerInterval, EveryTick | |
ECrimsonHitTraceShape | Line, Sphere, Capsule, Box | Crimson Selection: Trace. Line is the only one Shape Scale cannot widen - it has no cross-section |
ECrimsonHitTraceDirection | ControlRotation, MouseToWorldProjection, Custom | MouseToWorldProjection falls back to ControlRotation wherever there is no local cursor, which includes the server |
ECrimsonHitTraceQueryMode | ObjectTypes, TraceChannel, CollisionProfile | Crimson Selection: Trace. One explicit choice rather than a profile name that has to be left at NoCollision to fall through |
Targeting tasks shipped by this plugin
| Display name | Class | Role |
|---|---|---|
| Crimson Selection: Socket Sweep | UCrimsonHitSelectionTask_SocketSweep | Multi-socket swept capsules along a weapon |
| Crimson Selection: Actor Sweep | UCrimsonHitSelectionTask_ActorSweep | Sweeps the path the source actor travelled |
| Crimson Selection: Area | UCrimsonHitSelectionTask_Area | Sphere, box or capsule overlap with every dimension resizable per request |
| Crimson Selection: Trace | UCrimsonHitSelectionTask_Trace | Line, sphere, capsule or box trace with a selectable direction. Synchronous or asynchronous, decided by the request. Blueprintable |
| Crimson Filter: Affiliation | UCrimsonHitFilterTask_Affiliation | Hostile / neutral / friendly / self |
| Crimson Filter: Actor Class | UCrimsonHitFilterTask_ActorClass | Target must be (or, inverted, must not be) one of a list of classes. For projects with no team system |
| Crimson Filter: Require Ability System | UCrimsonHitFilterTask_RequireAbilitySystem | Target must have an ASC |
| Crimson Filter: Target Tag Query | UCrimsonHitFilterTask_TargetTagQuery | Target ASC tags must satisfy a query |
| Crimson Filter: Angle | UCrimsonHitFilterTask_Angle | Arc measured from the window's facing |
| Crimson Filter: Line Of Sight | UCrimsonHitFilterTask_LineOfSight | Visibility trace from the attacker |
| Crimson Filter: Require Hurtbox | UCrimsonHitFilterTask_RequireHurtbox | Target must declare hit zones |
| Crimson Filter: Max Distance | UCrimsonHitFilterTask_MaxDistance | Range limit independent of the shape |
| Crimson Sort: Angle | UCrimsonHitSortTask_Angle | Most-centered-on-the-attack first |
Tasks from the Targeting System module
AOE, Trace, Source Actor, Actor Class and Sort By Distance are Epic's, defined in the Gameplay Targeting System plugin. They compose freely with the Crimson tasks above.Ability tasks and notifies
| Node | Class | Pins |
|---|---|---|
| Crimson Hit Window | UCrimsonAbilityTask_HitWindow | On Targets Hit (server), On Window Closed (all machines) |
| Crimson Hit Query | UCrimsonAbilityTask_HitQuery | On Targets Hit (server only). Arms Profile under Context Tag for the montage's notifies to fire; runs no query itself. Cancel Query stops it early |
| Crimson Launch Projectile | UCrimsonAbilityTask_LaunchProjectile | Takes a Launch Params struct and an On Impact handler. Apply damage from On Impact, which outlives the ability; On Projectile Hit only fires while the task is alive |
| Crimson Hit Window (Notify) | UAnimNotifyState_CrimsonHitWindow | Context Tag, Sweep Owner Mesh. Timing only - it fires whatever the ability armed under that tag. No output pins; the Crimson Hit Query node relays the hits |
| Crimson Hit Query (Notify) | UAnimNotify_CrimsonHitQuery | Context Tag. Fires the armed profile once, on a single frame. Warns on screen and in the log if that profile uses a socket sweep, which a single frame can never resolve |
ACrimsonProjectile
| Member | Kind | Notes |
|---|---|---|
ImpactProfile | Property | Use a preset built on Actor Sweep |
MaxPierces | Property | 0 stops at the first target; -1 (default) is unlimited |
MaxLifetime | Property | Always set a finite value |
bStopOnWorldBlock | Property | Stop at walls |
LaunchProjectile | Function | Server only. Takes FCrimsonProjectileLaunchParams. The single activation entry point |
OnAcquiredFromPool | ICrimsonPoolable | Called by the pool. Marks the instance pool-owned and repositions it |
OnReleasedToPool | ICrimsonPoolable | Called by the pool. A no-op here - expiry already stood the projectile down |
GetPoolReleaseDelegate | ICrimsonPoolable, C++ only | The pool binds this to reclaim the instance automatically |
AcquireFromPool | Function | Server only. Repositions a dormant instance. OnAcquiredFromPool calls it for you |
SetPoolOwned | Function | Deactivate instead of destroy on expiry. OnAcquiredFromPool sets it for you |
IsPoolOwned, IsProjectileActive, GetRemainingPierces | Functions | Pure |
OnProjectileHit | Delegate | Server only, per impact |
OnProjectileExpired | Delegate | Server only, on stop |
OnProjectileReleased | Delegate | Server only, pool-owned instances only |
OnImpact, OnExpired | BlueprintNativeEvent | Override points for subclass behaviour |
Hit zones
| Member | Kind | Notes |
|---|---|---|
UCrimsonHitZonePhysicalMaterial::ZoneTag | Property | The zone a body using this material reports |
UCrimsonHurtboxComponent::BoneZones | Property | Bone to zone. Lookup walks up parents |
UCrimsonHurtboxComponent::DefaultZoneTag | Property | Reported when nothing matches |
UCrimsonHurtboxComponent::MeshComponentTag | Property | Which mesh's skeleton the parent walk uses |
UCrimsonHurtboxComponent::ResolveZoneForBone | Function | Pure |
UCrimsonHitZoneLibrary::ResolveHitZoneTag | Static function | Physical material first, hurtbox second |
Project settings
| Setting | Default | Meaning |
|---|---|---|
DefaultSubstepOverlapFactor | 0.75 | Sub-step advance as a fraction of the shape radius |
MaxSubstepsPerQuery | 8 | Ceiling on sub-steps per shape per query |
TeleportDistanceThreshold | 1000 | Travel beyond this is treated as a teleport and skipped |
DefaultMaxWindowDuration | 5 | Safety auto-close for a window nothing else closes |
bForceBoneRefreshDuringHitWindows | true | Holds the attacker's mesh at AlwaysTickPoseAndRefreshBones while any window is open, then restores it. Without it, a mesh the server is not rendering reports every socket at its reference pose |
bWarnOnUnsafeAnimTickOption | true | Warn once per actor when a mesh will not refresh its bones off-screen. Ignored while bForceBoneRefreshDuringHitWindows is on, which already fixes it |
MaxReplicatedImpactsPerBatch | 8 | Cosmetic multicast cap. The server report is never truncated |
bAllowDebugDrawing | true | Master switch for all debug drawing |
DebugDrawDuration | 2 | Seconds debug shapes persist |
Console variables
| Variable | Meaning |
|---|---|
Crimson.HitDetection.Debug | Draw swept volumes and resolved impacts for every profile |
Crimson.HitDetection.DrawDuration | Override how long shapes persist. Negative uses the project setting |
showdebug TargetingSystem | Epic's own view. Shows which filter task rejected a candidate |
Shipped collision profiles and tags
| Name | Kind | Purpose |
|---|---|---|
CrimsonHitbox | Collision profile | Query-only hurtbox geometry, invisible to camera and visibility traces |
CrimsonWeaponSweep | Collision profile | A weapon's swept query. Blocks nothing |
CrimsonHitDetection.Zone.* | Gameplay tags | Body, Head, Limb, Weakpoint, Armoured |
CrimsonHitDetection.Context.* | Gameplay tags | Light, Heavy, Projectile, AreaOfEffect |
CrimsonHitDetection.Impact.* | Gameplay tags | Flesh, Metal, Blocked |