Add comprehensive tooltips to all UPROPERTY declarations
Adds detailed tooltips (units, ranges, behavior, examples) to 82 UPROPERTY across EBBullet.h (42), EBBarrel.h (25), and EBMaterialResponseMap.h (15). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c6fd71dc0b
commit
ed901a90d5
Binary file not shown.
Binary file not shown.
@ -55,9 +55,12 @@ public:
|
||||
// Called every frame
|
||||
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "PROSERVE") int nextFireEventID = 100.0f;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug") bool shotTrace = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug") float DebugArrowSize = 100.0f;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "PROSERVE", meta = (ToolTip = "Next fire event ID to assign to spawned bullets. Auto-incremented after each shot. Used to correlate fire events with impact callbacks. Starting value should be unique per barrel to avoid ID collisions in multiplayer."))
|
||||
int nextFireEventID = 100.0f;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug", meta = (ToolTip = "When true, draws a red debug line from the barrel muzzle along the aim direction each time a bullet is spawned. Useful for verifying barrel alignment and aim direction. Persists for 3 seconds."))
|
||||
bool shotTrace = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug", meta = (ToolTip = "Length (cm) of the editor-only debug arrow drawn at the barrel's location in the viewport. Shows the barrel's forward direction. Only visible in editor, not in-game. Default: 100 cm.", EditCondition = "shotTrace"))
|
||||
float DebugArrowSize = 100.0f;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug", meta = (ToolTip = "Draw real-time debug lines: Green = raw tracker, Red = anti-recoil predicted aim"))
|
||||
bool DebugAntiRecoil = false;
|
||||
@ -105,36 +108,58 @@ public:
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Weapon", meta = (ToolTip = "Maximum of random multiplier applied to bullet muzzle velocity")) float MuzzleVelocityMultiplierMax = 1.0f;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Weapon", meta = (ToolTip = "Minimum fire rate, rounds per second")) float FireRateMin = 1.0f;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Weapon", meta = (ToolTip = "Maximum fire rate, rounds per second, set to same number as FireRateMin to disable randomization")) float FireRateMax = 1.0f;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, EditAnywhere, Category = "Weapon") EFireMode FireMode = EFireMode::FM_Auto;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, EditAnywhere, Category = "Weapon") bool ShootingBlocked;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, EditAnywhere, Category = "Weapon", meta = (ToolTip = "Current fire mode. Full Auto: fires continuously while trigger held. Semiauto: one shot per trigger pull. Burst: fires BurstCount rounds per trigger pull. Interruptible Burst: burst that stops if trigger is released. Manual: requires explicit Charge() call between shots. Slam Fire: fires on trigger release. Gatling: requires spool-up before firing, rate controlled by GatlingRPS."))
|
||||
EFireMode FireMode = EFireMode::FM_Auto;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, EditAnywhere, Category = "Weapon", meta = (ToolTip = "When true, the barrel cannot fire. Use to temporarily disable shooting (e.g. during reload animation, weapon switching, or game state lock). Replicated so the server can block client firing."))
|
||||
bool ShootingBlocked;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Weapon", meta = (ToolTip = "Number of rounds auto fired in burst mode")) int BurstCount = 3;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Weapon", meta = (ToolTip = "Minimum time between bursts")) float BurstCooldown = 0.0f;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Weapon", meta = (ToolTip = "Automatically spin up gatling when trigger is being held down")) bool GatlingAutoSpool = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Weapon") float GatlingSpoolUpTime = 1.0f;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Weapon") float GatlingSpoolDownTime = 1.0f;
|
||||
UPROPERTY(BlueprintReadWrite, Category = "Weapon") float GatlingPhase = 0.0f;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Weapon", meta = (ToolTip = "Time (seconds) for the gatling barrel to spool from idle to full firing speed. During spool-up, the fire rate ramps up linearly. Only used in FM_Gatling fire mode. Default: 1.0s.", ClampMin = "0.01", EditCondition = "FireMode == EFireMode::FM_Gatling"))
|
||||
float GatlingSpoolUpTime = 1.0f;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Weapon", meta = (ToolTip = "Time (seconds) for the gatling barrel to spool down from full speed to idle after trigger release. During spool-down, the fire rate decreases linearly and the weapon continues firing. Default: 1.0s.", ClampMin = "0.01", EditCondition = "FireMode == EFireMode::FM_Gatling"))
|
||||
float GatlingSpoolDownTime = 1.0f;
|
||||
UPROPERTY(BlueprintReadWrite, Category = "Weapon", meta = (ToolTip = "Current gatling spool phase (0.0-1.0). 0 = idle, 1 = full speed. Automatically updated during spool up/down. Read this to drive barrel spin animations or sound pitch. Do not set manually unless you want to force a specific spool state."))
|
||||
float GatlingPhase = 0.0f;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Ammo") bool CycleAmmo = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Ammo", meta = (EditCondition = "CycleAmmo")) bool CycleAmmoUnlimited = true;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, EditAnywhere, Category = "Ammo") TArray<TSubclassOf<class AEBBullet>> Ammo;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, EditAnywhere, Category = "Ammo", meta = (EditCondition = "CycleAmmo")) int CycleAmmoCount;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, EditAnywhere, Category = "Ammo", meta = (EditCondition = "CycleAmmo")) int CycleAmmoPos;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Ammo", meta = (ToolTip = "When true, the barrel automatically cycles through the Ammo array, chambering the next bullet class after each shot. When false, you must manually set ChamberedBullet. Enables magazine/belt-fed behavior with mixed ammo types."))
|
||||
bool CycleAmmo = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Ammo", meta = (ToolTip = "When true, ammo is never depleted — the barrel loops through the Ammo array indefinitely. When false, ammo count decreases with each shot and the AmmoDepleted event fires when empty. Disable for realistic magazine management.", EditCondition = "CycleAmmo"))
|
||||
bool CycleAmmoUnlimited = true;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, EditAnywhere, Category = "Ammo", meta = (ToolTip = "Array of bullet classes defining the ammo belt/magazine. Each entry is a bullet class (AEBBullet subclass). The barrel cycles through this list in order. Multiple entries of the same class simulate a uniform magazine. Different classes allow mixed ammo (e.g. tracer every 5th round)."))
|
||||
TArray<TSubclassOf<class AEBBullet>> Ammo;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, EditAnywhere, Category = "Ammo", meta = (ToolTip = "Number of rounds remaining before ammo depletion. Only used when CycleAmmoUnlimited is false. Decremented after each shot. When it reaches 0, the AmmoDepleted event fires and the barrel stops firing. Set via SetAmmo() or directly.", EditCondition = "CycleAmmo"))
|
||||
int CycleAmmoCount;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, EditAnywhere, Category = "Ammo", meta = (ToolTip = "Current index in the Ammo array. Determines which bullet class is chambered next. Wraps around to 0 when reaching the end of the array. Replicated so server and clients agree on ammo type.", EditCondition = "CycleAmmo"))
|
||||
int CycleAmmoPos;
|
||||
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, Category = "WeaponState") TSubclassOf<class AEBBullet> ChamberedBullet;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, Category = "WeaponState") bool Shooting;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, Category = "WeaponState") bool Spooling = false;
|
||||
UPROPERTY(BlueprintReadWrite, Category = "Weapon") float GatlingRPS = 0.0f;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, Category = "WeaponState", meta = (ToolTip = "The bullet class currently chambered and ready to fire. Set automatically by CycleAmmo or manually via Charge(). If null, the barrel cannot fire. Replicated so server and clients agree on the next round type."))
|
||||
TSubclassOf<class AEBBullet> ChamberedBullet;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, Category = "WeaponState", meta = (ToolTip = "True while the trigger is held down (for auto/gatling modes) or while a burst is in progress. Read this to drive muzzle flash, sound loops, or animation states. Replicated."))
|
||||
bool Shooting;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, Category = "WeaponState", meta = (ToolTip = "True while the gatling barrel is spooling (up or down). Read this to drive barrel spin-up animations and sound. Only relevant in FM_Gatling fire mode. Replicated."))
|
||||
bool Spooling = false;
|
||||
UPROPERTY(BlueprintReadWrite, Category = "Weapon", meta = (ToolTip = "Current gatling rounds per second, computed from GatlingPhase and fire rate. Read-only runtime value. Use to drive audio or visual feedback proportional to actual firing speed."))
|
||||
float GatlingRPS = 0.0f;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, Category = "WeaponState") bool LoadNext=true;
|
||||
UPROPERTY(BlueprintReadWrite, Category = "WeaponState") float Cooldown;
|
||||
UPROPERTY(BlueprintReadWrite, Category = "WeaponState") int BurstRemaining;
|
||||
UPROPERTY(BlueprintReadWrite, Category = "WeaponState", meta = (ToolTip = "When true, the barrel automatically chambers the next round after firing. Set to false to require manual Charge() calls between shots (e.g. bolt-action, pump-action). Works with CycleAmmo to advance the ammo position."))
|
||||
bool LoadNext=true;
|
||||
UPROPERTY(BlueprintReadWrite, Category = "WeaponState", meta = (ToolTip = "Remaining cooldown time (seconds) before the barrel can fire again. Determined by fire rate (1/FireRate). Counts down each tick. The barrel fires when this reaches 0 and the trigger is held. Read-only at runtime."))
|
||||
float Cooldown;
|
||||
UPROPERTY(BlueprintReadWrite, Category = "WeaponState", meta = (ToolTip = "Number of rounds remaining in the current burst. Only used in FM_Burst and FM_InterBurst fire modes. Set to BurstCount when a burst starts, decremented after each shot. Burst ends when this reaches 0."))
|
||||
int BurstRemaining;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Replication") bool ReplicateVariables=true;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Replication") bool ReplicateShotFiredEvents = true;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Replication") bool ClientSideAim=false;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Replication") float ClientAimUpdateFrequency = 15.0f;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Replication") float ClientAimDistanceLimit = 200.0f;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Replication", meta = (ToolTip = "When true, weapon state variables (Ammo, ChamberedBullet, FireMode, etc.) are replicated from server to clients. Disable only if you handle replication manually or in a single-player context."))
|
||||
bool ReplicateVariables=true;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Replication", meta = (ToolTip = "When true, the ShotFired event is broadcast to all clients via multicast RPC. Clients receive the event to play muzzle flash, sound, etc. Disable if you handle shot feedback through other means."))
|
||||
bool ReplicateShotFiredEvents = true;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Replication", meta = (ToolTip = "When true, the owning client computes the barrel aim position/direction locally and sends it to the server via RPC. The server uses the client's aim to spawn the bullet. Essential for VR/tracked controllers where the server cannot know the exact barrel orientation. When false, the server uses the barrel component's replicated transform."))
|
||||
bool ClientSideAim=false;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Replication", meta = (ToolTip = "How often (Hz) the client sends aim updates to the server when ClientSideAim is true. Higher values = more accurate server-side aim at the cost of bandwidth. 15 Hz is a good default. Only relevant when ClientSideAim is enabled.", EditCondition = "ClientSideAim", ClampMin = "1"))
|
||||
float ClientAimUpdateFrequency = 15.0f;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Replication", meta = (ToolTip = "Maximum allowed distance (UU/cm) between the client-reported aim position and the server's barrel position. Acts as an anti-cheat clamp: if the client aim is further than this, the server clamps it. 200 = 2 meters. Set higher if the tracker has large offsets from the replicated barrel position.", EditCondition = "ClientSideAim", ClampMin = "0"))
|
||||
float ClientAimDistanceLimit = 200.0f;
|
||||
|
||||
FRandomStream RandomStream;
|
||||
|
||||
|
||||
@ -33,28 +33,42 @@ public:
|
||||
// Sets default values for this actor's properties
|
||||
AEBBullet();
|
||||
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, Category = "State") FVector Velocity;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, Category = "State") FRandomStream RandomStream;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, Category = "State", meta = (ToolTip = "Current bullet velocity vector (cm/s). Set at spawn from muzzle velocity and direction. Updated each tick by gravity, drag, and wind. Also modified on ricochet/penetration. Replicated to clients."))
|
||||
FVector Velocity;
|
||||
UPROPERTY(Replicated, BlueprintReadWrite, Category = "State", meta = (ToolTip = "Random stream used for deterministic randomization (spread, first step delta). Seed is generated at spawn so each bullet has unique but reproducible random values. Replicated to clients."))
|
||||
FRandomStream RandomStream;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, Category = "State") bool OwnerSafe=false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "PROSERVE") int fireEventID;
|
||||
UPROPERTY(BlueprintReadWrite, Category = "State", meta = (ToolTip = "When true, the bullet ignores the owner and attached actors during collision traces. Automatically set to true at spawn if SafeLaunch is enabled, then cleared after SafeDelay seconds. Prevents the shooter from hitting themselves."))
|
||||
bool OwnerSafe=false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "PROSERVE", meta = (ToolTip = "Unique identifier for this fire event, used to correlate bullet spawn with impact callbacks. Set by the barrel when firing and passed through to OnImpact events."))
|
||||
int fireEventID;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug") bool DebugEnabled;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug") float DebugTrailTime=1.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug") float DebugTrailWidth=0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug") FLinearColor DebugTrailColorFast = FLinearColor(0, 1, 0, 1);
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug") FLinearColor DebugTrailColorSlow = FLinearColor(1, 0, 0, 1);
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug") bool DebugPooling;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug", meta = (ToolTip = "Enable debug trail visualization. When true, draws colored lines along the bullet trajectory using DrawDebugLine. The color interpolates between DebugTrailColorSlow and DebugTrailColorFast based on current speed relative to muzzle velocity. Editor-only (WITH_EDITOR)."))
|
||||
bool DebugEnabled;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug", meta = (ToolTip = "Duration (seconds) the debug trail lines persist on screen before fading. Higher values let you see the full trajectory longer. Default: 1.0s.", EditCondition = "DebugEnabled"))
|
||||
float DebugTrailTime=1.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug", meta = (ToolTip = "Width of the debug trail lines in world units. 0 = thin hairline (1px). Higher values make trails more visible at distance. The no-hit trace path always uses width 0 regardless of this setting.", EditCondition = "DebugEnabled"))
|
||||
float DebugTrailWidth=0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug", meta = (ToolTip = "Trail color when the bullet is at or above muzzle velocity. The debug trail lerps between ColorSlow and ColorFast based on speed ratio. Default: green (0,1,0).", EditCondition = "DebugEnabled"))
|
||||
FLinearColor DebugTrailColorFast = FLinearColor(0, 1, 0, 1);
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug", meta = (ToolTip = "Trail color when the bullet has lost most of its velocity. The debug trail lerps between ColorSlow and ColorFast based on speed ratio. Default: red (1,0,0).", EditCondition = "DebugEnabled"))
|
||||
FLinearColor DebugTrailColorSlow = FLinearColor(1, 0, 0, 1);
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Debug", meta = (ToolTip = "Enable on-screen debug messages for bullet pooling operations (spawn, recycle, pool size). Only active in editor builds (WITH_EDITOR). Useful for verifying that pooling is working correctly."))
|
||||
bool DebugPooling;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "World") FVector Wind;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "World", meta = (ToolTip = "Global wind velocity vector (cm/s). Applied as a constant offset to air-relative velocity for drag calculation. X/Y/Z components define wind direction and strength. Example: FVector(500,0,0) = 5 m/s wind along X axis. Can be overridden per-bullet via the GetWind Blueprint event."))
|
||||
FVector Wind;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, SaveGame, Category = "World", meta = (ToolTip = "Select atmosphere model")) EEBAtmosphereType AtmosphereType;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "World", meta = (ToolTip = "Air Density at sea level - in KG/m^3", ClampMin = "0")) float SeaLevelAirDensity = 1.21;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "World", meta = (ToolTip = "in cm/s", ClampMin = "0")) float SeaLevelSpeedOfSound = 34300;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "World", meta = (ToolTip = "Used for Density Curve atmosphere model")) UCurveFloat* AirDensityCurve;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "World") bool SpeedOfSoundVariesWithAltitude = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "World") UCurveFloat* SpeedOfSoundCurve;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "World", meta = (ToolTip = "When true, the speed of sound varies with altitude using SpeedOfSoundCurve. When false, SeaLevelSpeedOfSound is used everywhere. Affects Mach number calculation for drag. Only relevant if MachDragCurve is set."))
|
||||
bool SpeedOfSoundVariesWithAltitude = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "World", meta = (ToolTip = "Float curve mapping altitude (cm, on X axis) to speed of sound (cm/s, on Y axis). Only used when SpeedOfSoundVariesWithAltitude is true. If null while the option is enabled, falls back to SeaLevelSpeedOfSound.", EditCondition = "SpeedOfSoundVariesWithAltitude"))
|
||||
UCurveFloat* SpeedOfSoundCurve;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "World") float WorldScale = 1.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "World", meta = (ToolTip = "Scale factor applied to the world for drag calculation. 1.0 = real world scale (1 UU = 1 cm). Values >1 mean the world is larger than real scale. Affects drag deceleration: higher WorldScale = less drag effect per UU traveled. Useful for scaled-down environments."))
|
||||
float WorldScale = 1.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, SaveGame, Category = "World", meta = (ToolTip = "Atmosphere pressure at 0,0,0 - in millibars", ClampMin = "0")) float SeaLevelAirPressure = 1012.5f;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, SaveGame, Category = "World", meta = (ToolTip = "Atmosphere Temperature at 0,0,0 - in degrees C")) float SeaLevelAirTemperature = 20.0f;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, SaveGame, Category = "World", meta = (ToolTip = "Temperature Decrease With Altitude, degrees per meter")) float TemperatureLapseRate = 0.00649f;
|
||||
@ -64,74 +78,125 @@ public:
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, SaveGame, Category = "World", meta = (ToolTip = "Use spherical planet model to get altitude")) bool SphericalAltitude = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, SaveGame, Category = "World", meta = (ToolTip = "Planet radius, in Unreal units", EditCondition = "SphericalAltitude", ClampMin = "0")) float SeaLevelRadius = 637100000.0f;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "World") bool OverrideGravity = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "World") FVector Gravity = FVector(0,0,-980);
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "World", meta = (ToolTip = "When true, uses the custom Gravity vector below instead of the world's default gravity (Project Settings > Physics > Gravity). Enable this to simulate different gravitational conditions per bullet class."))
|
||||
bool OverrideGravity = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "World", meta = (ToolTip = "Custom gravity acceleration vector (cm/s^2). Only used when OverrideGravity is true. Default: (0,0,-980) = Earth gravity. Example: (0,0,-162) for Moon gravity, (0,0,0) for zero-G.", EditCondition = "OverrideGravity"))
|
||||
FVector Gravity = FVector(0,0,-980);
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Safe launch") bool SafeLaunch = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Safe launch", Meta = (EditCondition = "SafeLaunch")) bool SafeLaunchIgnoreAttachParent = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Safe launch", Meta = (EditCondition = "SafeLaunchIgnoreAttachParent")) bool SafeLaunchIgnoreAllAttached = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Safe launch", Meta = (EditCondition = "SafeLaunch", ClampMin = "0")) float SafeDelay = 1.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Safe launch", Meta = (EditCondition = "SafeLaunch")) TArray<AActor*> SafeLaunchIgnoredActors;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Safe launch", meta = (ToolTip = "When true, the bullet ignores its owner (and optionally attached actors) during the initial SafeDelay period. Prevents the shooter from hitting themselves or their own equipment (e.g. weapon mesh, ejected brass). Essential for first-person shooters."))
|
||||
bool SafeLaunch = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Safe launch", meta = (ToolTip = "When true, the bullet also ignores the owner's attachment parent during SafeDelay. Useful when the weapon is attached to a character — the bullet won't hit the character mesh.", EditCondition = "SafeLaunch"))
|
||||
bool SafeLaunchIgnoreAttachParent = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Safe launch", meta = (ToolTip = "When true, the bullet ignores ALL actors in the owner's attachment hierarchy (parent, siblings, children, recursively). Ensures the bullet passes through the entire character rig and all attached props.", EditCondition = "SafeLaunchIgnoreAttachParent"))
|
||||
bool SafeLaunchIgnoreAllAttached = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Safe launch", meta = (ToolTip = "Duration (seconds) the bullet remains owner-safe after spawn. After this delay, the bullet can hit the owner. Default: 1.0s. Set higher for slow projectiles that stay near the shooter longer.", EditCondition = "SafeLaunch", ClampMin = "0"))
|
||||
float SafeDelay = 1.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Safe launch", meta = (ToolTip = "Additional actors to always ignore during the SafeDelay period, beyond the owner and attachment hierarchy. Useful for ignoring specific actors like vehicles or deployable shields that the shooter is near.", EditCondition = "SafeLaunch"))
|
||||
TArray<AActor*> SafeLaunchIgnoredActors;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Shotgun") bool Shotgun=false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Shotgun", meta = (EditCondition = "Shotgun")) int ShotCount=10;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Shotgun", meta = (EditCondition = "Shotgun")) float ShotSpread=0.01;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Shotgun", meta = (EditCondition = "Shotgun")) float ShotVelocitySpread = 0.01;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Shotgun", meta = (ToolTip = "When true, spawning this bullet class produces multiple pellets per shot (ShotCount). Each pellet is an independent bullet with its own spread and velocity variation. The barrel fires one logical shot but multiple physical bullets."))
|
||||
bool Shotgun=false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Shotgun", meta = (ToolTip = "Number of pellets spawned per shot. Each pellet is a full bullet with independent trajectory. Typical values: 8-9 for buckshot, 200+ for birdshot. Performance cost scales linearly with count.", EditCondition = "Shotgun"))
|
||||
int ShotCount=10;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Shotgun", meta = (ToolTip = "Angular spread cone (radians) for pellet direction randomization. Each pellet direction is offset randomly within this cone. 0.01 rad ≈ 0.57°. Typical buckshot: 0.02-0.05 rad. This is in addition to the bullet's own Spread value.", EditCondition = "Shotgun"))
|
||||
float ShotSpread=0.01;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Shotgun", meta = (ToolTip = "Fractional velocity variation between pellets. Each pellet velocity is randomized by ±(ShotVelocitySpread * MuzzleVelocity). 0.01 = ±1% variation. Simulates real-world pellet velocity inconsistency.", EditCondition = "Shotgun"))
|
||||
float ShotVelocitySpread = 0.01;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Flight") float MuzzleVelocityMin = 100000.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Flight") float MuzzleVelocityMax = 100000.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Flight", meta = (ToolTip = "Minimum muzzle velocity (cm/s). The actual muzzle velocity is randomized between Min and Max. Set both equal to disable randomization. Example: 9mm = ~35000 cm/s, 5.56mm = ~94000 cm/s, airsoft 6mm = ~9000 cm/s. Also used as reference for debug trail color scaling.", ClampMin = "0"))
|
||||
float MuzzleVelocityMin = 100000.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Flight", meta = (ToolTip = "Maximum muzzle velocity (cm/s). The actual muzzle velocity is randomized between Min and Max. Set both equal to disable randomization. Also used as the upper bound for debug trail color interpolation (ColorFast).", ClampMin = "0"))
|
||||
float MuzzleVelocityMax = 100000.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Flight", meta = (ToolTip = "Maximum bullet spread, in radians", ClampMin = "0")) float Spread = 0.0f;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Flight", meta = (ToolTip = "Spread bias, higher is more accurate on average", ClampMin = "0")) float SpreadBias = 0.0f;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Flight") float Mass = 0.005;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Flight") float Diameter = 0.556;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Flight") float FormFactor = 1.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Flight") UCurveFloat* MachDragCurve;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Flight", meta = (ToolTip = "Bullet mass (kg). Affects drag deceleration (lighter = decelerates faster) and impulse on hit. Example: 9mm = 0.008 kg, 5.56mm = 0.004 kg, airsoft 0.2g BB = 0.0002 kg.", ClampMin = "0.0001"))
|
||||
float Mass = 0.005;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Flight", meta = (ToolTip = "Bullet diameter (cm). Used to compute the bullet's cross-sectional area for drag calculation (pi * (D/2)^2). Example: 9mm = 0.9 cm, 5.56mm = 0.556 cm, airsoft 6mm = 0.6 cm.", ClampMin = "0.01"))
|
||||
float Diameter = 0.556;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Flight", meta = (ToolTip = "Aerodynamic form factor multiplier for drag. 1.0 = standard sphere drag. Lower values = more streamlined (less drag), higher = blunter (more drag). Typical rifle bullet: 0.5-0.8. Combined with MachDragCurve to compute total drag coefficient."))
|
||||
float FormFactor = 1.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Flight", meta = (ToolTip = "Float curve mapping Mach number (X axis) to drag coefficient multiplier (Y axis). Defines how drag varies with speed relative to the speed of sound. If null, a constant drag coefficient of 0.25 is used. Typical curve peaks near Mach 1.0 (transonic drag rise)."))
|
||||
UCurveFloat* MachDragCurve;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") float GrazingAngleExponent = 2.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") float MinPenetration = 10.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") float MaxPenetration = 20.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") float PenetrationNormalization = 0.5;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") float PenetrationNormalizationGrazing = 0.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") float PenetrationEntryAngleSpread = 0.1;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") float PenetrationExitAngleSpread = 0.1;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") float RicochetProbability = 0.1;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") float RicochetProbabilityGrazing = 1;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") float RicochetRestitution = 0.1;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") float RicochetFriction = 0.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") float RicochetSpread = 0.1;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") bool SpeedControlsRicochetProbability = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") bool AddImpulse = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") float ImpulseMultiplier = 1.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "Exponent controlling how impact angle affects penetration and ricochet. At grazing angles, the probability/depth is interpolated using pow(angle, exponent). Higher values = sharper transition between head-on and grazing behavior. 1.0 = linear, 2.0 = quadratic (default). Affects both penetration normalization and ricochet probability blending."))
|
||||
float GrazingAngleExponent = 2.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "Minimum penetration depth (cm) at head-on impact angle. The bullet traces this far through the surface to find an exit point. If the surface is thinner than this, the bullet passes through. Example: 10 cm for pistol rounds.", ClampMin = "0"))
|
||||
float MinPenetration = 10.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "Maximum penetration depth (cm) at the most favorable angle (after normalization). Used with MinPenetration to define the penetration range. Thicker surfaces than this value will stop the bullet completely.", ClampMin = "0"))
|
||||
float MaxPenetration = 20.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "How much the bullet path straightens (normalizes) toward the surface normal on entry at head-on angles. 0.0 = bullet continues straight, 1.0 = bullet aligns fully with surface normal. Simulates bullet yaw/tumble on impact. 0.5 = halfway normalization."))
|
||||
float PenetrationNormalization = 0.5;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "Same as PenetrationNormalization but applied at extreme grazing angles. The actual normalization is interpolated between the head-on and grazing values using GrazingAngleExponent. 0.0 = no normalization at grazing angles."))
|
||||
float PenetrationNormalizationGrazing = 0.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "Random angular spread (radians) applied to bullet direction on entry into a surface. Simulates unpredictable deflection when entering material. 0.1 rad ≈ 5.7°. Set to 0 for perfectly predictable entry."))
|
||||
float PenetrationEntryAngleSpread = 0.1;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "Random angular spread (radians) applied to bullet direction on exit from a surface. Simulates unpredictable deflection when exiting material. 0.1 rad ≈ 5.7°. Set to 0 for predictable exit direction."))
|
||||
float PenetrationExitAngleSpread = 0.1;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "Base probability (0.0-1.0) of ricochet at head-on impact angle. The actual probability is interpolated between this and RicochetProbabilityGrazing based on impact angle. 0.1 = 10% chance at perpendicular impact. If the random check fails, the bullet attempts penetration instead.", ClampMin = "0", ClampMax = "1"))
|
||||
float RicochetProbability = 0.1;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "Probability (0.0-1.0) of ricochet at extreme grazing angles. Typically higher than RicochetProbability since shallow angles favor bouncing. 1.0 = always ricochet at grazing. The actual probability is interpolated using GrazingAngleExponent.", ClampMin = "0", ClampMax = "1"))
|
||||
float RicochetProbabilityGrazing = 1;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "Coefficient of restitution for ricochet (0.0-1.0). Controls how much velocity is preserved in the normal (bounce) direction. 0.0 = slides along surface, 1.0 = perfect elastic bounce. 0.1 = mostly absorbed, slight bounce. Can be overridden per-material via MaterialResponseMap."))
|
||||
float RicochetRestitution = 0.1;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "Friction coefficient for ricochet (0.0-1.0). Controls how much tangential (along-surface) velocity is lost on bounce. 0.0 = no friction (full slide), 1.0 = full friction (no slide). Can be overridden per-material via MaterialResponseMap."))
|
||||
float RicochetFriction = 0.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "Random angular spread (radians) applied to the bullet direction after ricochet. Simulates surface roughness causing unpredictable bounce direction. 0.1 rad ≈ 5.7°. Set to 0 for perfectly predictable ricochets."))
|
||||
float RicochetSpread = 0.1;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "When true, bullet speed affects ricochet probability. Slower bullets are more likely to ricochet (probability increases as velocity decreases). Simulates the fact that high-energy impacts tend to penetrate while low-energy impacts tend to deflect."))
|
||||
bool SpeedControlsRicochetProbability = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "When true, applies a physics impulse to hit actors with simulating physics components. The impulse direction follows the bullet velocity and magnitude is based on bullet mass, velocity, and ImpulseMultiplier."))
|
||||
bool AddImpulse = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "Multiplier applied to the physics impulse on hit. 1.0 = realistic momentum transfer (mass * velocity). Higher values exaggerate the knockback effect. Only used when AddImpulse is true.", EditCondition = "AddImpulse"))
|
||||
float ImpulseMultiplier = 1.0;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") EPenTraceType DefaultPenTraceType = EPenTraceType::PT_BackTrace;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") UEBMaterialResponseMap* MaterialResponseMap;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") bool MaterialDensityControlsPenetrationDepth = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact") bool MaterialRestitutionControlsRicochet = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "Method used to find the bullet exit point during penetration. BackTrace: traces backward from the far side to find the exit (works for convex shapes). ByComponent: traces forward against the same component. TwoSidedGeometry: uses double-sided collision (requires two-sided mesh collision). Can be overridden per-material via MaterialResponseMap."))
|
||||
EPenTraceType DefaultPenTraceType = EPenTraceType::PT_BackTrace;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "Data asset mapping Physical Materials to per-material impact behavior overrides (penetration depth, ricochet probability, restitution, friction, spread, etc.). If null, all surfaces use the default bullet impact settings. Assign a UEBMaterialResponseMap asset to differentiate between wood, metal, concrete, flesh, etc."))
|
||||
UEBMaterialResponseMap* MaterialResponseMap;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "When true, the physical material's density property scales the penetration depth. Denser materials reduce penetration depth proportionally. When false, penetration depth is the same regardless of material density (only MaterialResponseMap overrides apply)."))
|
||||
bool MaterialDensityControlsPenetrationDepth = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Impact", meta = (ToolTip = "When true, the physical material's restitution property influences ricochet behavior. Higher material restitution = bouncier ricochets. When false, only the bullet's own RicochetRestitution and MaterialResponseMap values are used."))
|
||||
bool MaterialRestitutionControlsRicochet = true;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Replication") bool ReliableReplication = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Replication", meta = (ToolTip = "When true, velocity change broadcasts after ricochet/penetration use Reliable RPC (guaranteed delivery, ordered). When false, uses Unreliable RPC (faster, may be dropped). Enable for critical gameplay bullets where trajectory changes must be seen by all clients. Disable for high-volume fire where occasional missed updates are acceptable."))
|
||||
bool ReliableReplication = false;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Collision", meta = (ToolTip = "Allow components to collide, intended for use with trigger volumes. Do not use for actual collisions.")) bool AllowComponentCollisions = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Collision") TEnumAsByte<ECollisionChannel> TraceChannel;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Collision") bool TraceComplex;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Collision") float CollisionMargin=1.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Collision", meta = (ToolTip = "Collision channel used for the bullet's line trace each tick. Determines which objects the bullet can hit based on collision channel responses. Typical setup: create a dedicated 'Bullet' channel in Project Settings > Collision, and configure per-object responses. Default: Visibility channel."))
|
||||
TEnumAsByte<ECollisionChannel> TraceChannel;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Collision", meta = (ToolTip = "When true, traces against complex (per-polygon) collision instead of simple collision shapes. More accurate for detailed meshes (e.g. hitting between bars of a fence) but significantly more expensive. Recommended false for most use cases."))
|
||||
bool TraceComplex;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Collision", meta = (ToolTip = "Extra distance (cm) added to the trace length beyond the calculated travel distance per step. Acts as a safety margin to prevent fast bullets from tunneling through thin surfaces due to floating-point precision. Default: 1.0 cm. Increase for very fast bullets or very thin obstacles.", ClampMin = "0"))
|
||||
float CollisionMargin=1.0;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Collision", meta = (ToolTip = "Bullets with lower velocity will automatically despawn on impact, never despawn if set to zero or negative")) float DespawnVelocity=100.0f;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Collision") TArray<AActor*> IgnoredActors;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Collision", meta = (ToolTip = "List of actors permanently ignored by this bullet's traces (not time-limited like SafeLaunch). These actors are never hit regardless of SafeDelay. Useful for ignoring specific world actors like invisible blocking volumes or the weapon mesh itself."))
|
||||
TArray<AActor*> IgnoredActors;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Simulation", meta = (ToolTip = "Spawned bullet performs first trace immediately, instead of waiting for next simulation step")) bool DoFirstStepImmediately = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Simulation", meta = (EditCondition = "DoFirstStepImmediately")) bool RandomFirstStepDelta = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Simulation") bool FixedStep = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Simulation", meta = (EditCondition = "FixedStep", ClampMin = "0")) float FixedStepSeconds = 0.1;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Simulation") int MaxTracesPerStep = 8;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Simulation", meta = (ToolTip = "When true, the simulation uses a fixed timestep (FixedStepSeconds) instead of the frame delta time. Accumulated time is consumed in fixed increments. Ensures deterministic trajectories regardless of framerate. Recommended for multiplayer or replay consistency."))
|
||||
bool FixedStep = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Simulation", meta = (ToolTip = "Fixed timestep duration (seconds) when FixedStep is enabled. Smaller values = more accurate simulation but more traces per frame. 0.01 = 100 sub-steps/second. Too small may cause multiple traces per frame at low FPS.", EditCondition = "FixedStep", ClampMin = "0"))
|
||||
float FixedStepSeconds = 0.1;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Simulation", meta = (ToolTip = "Maximum number of collision traces per simulation step. Limits how many ricochets/penetrations can occur in a single step to prevent infinite bounce loops. 8 = up to 8 consecutive ricochets per tick. If the bullet still has remaining travel time after this many traces, it stops for this tick."))
|
||||
int MaxTracesPerStep = 8;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Retrace") bool Retrace = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Retrace") bool RetraceOnAnotherChannel = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Retrace", meta=(EditCondition="RetraceOnAnotherChannel")) TEnumAsByte<ECollisionChannel> RetraceChannel;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Retrace", meta = (ToolTip = "Enable lag compensation retrace. Each tick, the bullet replays the previous tick's trace before performing the current one. This 'time travel' mechanism allows the bullet to detect actors that moved into the bullet's previous path between ticks (e.g. fast-moving targets, newly spawned objects). Essential for accurate hit detection in networked games."))
|
||||
bool Retrace = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Retrace", meta = (ToolTip = "When true, the retrace uses a different collision channel (RetraceChannel) than the normal trace (TraceChannel). Useful if you want the retrace to hit different object types than the normal trace, e.g. retrace on a channel that includes lag-compensated hitboxes.", EditCondition = "Retrace"))
|
||||
bool RetraceOnAnotherChannel = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Retrace", meta = (ToolTip = "Collision channel used for the retrace when RetraceOnAnotherChannel is true. Configure this to a channel with different collision responses than TraceChannel for selective lag compensation.", EditCondition = "RetraceOnAnotherChannel"))
|
||||
TEnumAsByte<ECollisionChannel> RetraceChannel;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Rotation") bool RotateActor = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Rotation") bool RotateRandomRoll = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Rotation", meta = (ToolTip = "When true, the bullet actor's rotation is updated each tick to face its velocity direction. The roll angle is preserved (not affected by velocity). Disable if bullet rotation is irrelevant (e.g. invisible projectiles) for a minor performance gain."))
|
||||
bool RotateActor = true;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Rotation", meta = (ToolTip = "When true, the bullet starts with a random roll rotation (0-360°). Adds visual variety for visible projectiles with non-symmetric meshes or trails. Only applied at spawn, not updated during flight.", EditCondition = "RotateActor"))
|
||||
bool RotateRandomRoll = true;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Pooling") bool EnablePooling = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Pooling", meta = (EditCondition = "EnablePooling")) int MaxPoolSize = 50;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Pooling", meta = (ToolTip = "When true, deactivated bullets are recycled into a pool instead of being destroyed. Subsequent spawns reuse pooled bullets, avoiding the cost of actor creation/destruction. Significantly improves performance for high fire rates. Pool is stored on the CDO (Class Default Object) per bullet class."))
|
||||
bool EnablePooling = false;
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Pooling", meta = (ToolTip = "Maximum number of inactive bullets kept in the pool per class. When the pool exceeds this size, the oldest bullet is destroyed. Higher values use more memory but reduce the chance of needing to spawn a new actor. 50 is suitable for most scenarios.", EditCondition = "EnablePooling", ClampMin = "1"))
|
||||
int MaxPoolSize = 50;
|
||||
|
||||
//rebase
|
||||
virtual void ApplyWorldOffset(const FVector& InOffset, bool bWorldShift) override;
|
||||
|
||||
@ -20,20 +20,34 @@ USTRUCT(BlueprintType)
|
||||
struct FEBMaterialResponseMapEntry {
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Material") EPenTraceType PenTraceType = EPenTraceType::PT_BackTrace;
|
||||
UPROPERTY(EditAnywhere, Category = "Material") bool NeverPenetrate = false;
|
||||
UPROPERTY(EditAnywhere, Category = "Material") float PenetrationDepthMultiplier = 1.0f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material") float PenetrationNormalization = 0.0f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material") float PenetrationNormalizationGrazing = 0.0f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material") float PenetrationEntryAngleSpread = 0.0f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material") float PenetrationExitAngleSpread = 0.0;
|
||||
UPROPERTY(EditAnywhere, Category = "Material") bool NeverRicochet = false;
|
||||
UPROPERTY(EditAnywhere, Category = "Material") float RicochetProbabilityMultiplier = 1.0f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material") float RicochetRestitution = 0.5f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material") float RicochetRestitutionInfluence = 0.0f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material") float RicochetFriction = 0.5f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material") float RicochetFrictionInfluence = 0.0f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material") float RicochetSpread = 0.0f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material", meta = (ToolTip = "Method used to find the bullet exit point for this material. BackTrace: traces backward from max penetration depth. ByComponent: traces forward against the same component. TwoSidedGeometry: uses double-sided collision. Overrides the bullet's DefaultPenTraceType when this material is hit."))
|
||||
EPenTraceType PenTraceType = EPenTraceType::PT_BackTrace;
|
||||
UPROPERTY(EditAnywhere, Category = "Material", meta = (ToolTip = "When true, bullets never penetrate this material regardless of thickness or bullet energy. The bullet either ricochets or stops. Use for impenetrable surfaces like thick steel or armored walls."))
|
||||
bool NeverPenetrate = false;
|
||||
UPROPERTY(EditAnywhere, Category = "Material", meta = (ToolTip = "Multiplier applied to the bullet's penetration depth when hitting this material. 1.0 = use bullet defaults. <1.0 = harder to penetrate (e.g. 0.5 for steel = half penetration depth). >1.0 = easier to penetrate (e.g. 2.0 for drywall). Only used when NeverPenetrate is false.", ClampMin = "0"))
|
||||
float PenetrationDepthMultiplier = 1.0f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material", meta = (ToolTip = "Per-material override for penetration normalization at head-on angles. How much the bullet path straightens toward surface normal inside this material. 0.0 = no normalization (bullet goes straight through). If non-zero, overrides the bullet's PenetrationNormalization for this material."))
|
||||
float PenetrationNormalization = 0.0f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material", meta = (ToolTip = "Per-material override for penetration normalization at grazing angles. If non-zero, overrides the bullet's PenetrationNormalizationGrazing for this material. Interpolated with the head-on value using GrazingAngleExponent."))
|
||||
float PenetrationNormalizationGrazing = 0.0f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material", meta = (ToolTip = "Per-material random angular spread (radians) applied to bullet direction on entry. If non-zero, overrides the bullet's PenetrationEntryAngleSpread for this material. Simulates material-specific deflection on entry (e.g. higher for wood grain, lower for glass)."))
|
||||
float PenetrationEntryAngleSpread = 0.0f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material", meta = (ToolTip = "Per-material random angular spread (radians) applied to bullet direction on exit. If non-zero, overrides the bullet's PenetrationExitAngleSpread for this material. Simulates material-specific deflection on exit."))
|
||||
float PenetrationExitAngleSpread = 0.0;
|
||||
UPROPERTY(EditAnywhere, Category = "Material", meta = (ToolTip = "When true, bullets never ricochet off this material. They either penetrate or stop. Use for soft materials like flesh, sand, or foam that absorb impacts without bouncing."))
|
||||
bool NeverRicochet = false;
|
||||
UPROPERTY(EditAnywhere, Category = "Material", meta = (ToolTip = "Multiplier applied to the bullet's ricochet probability when hitting this material. 1.0 = use bullet defaults. >1.0 = more likely to ricochet (e.g. 2.0 for polished metal). <1.0 = less likely (e.g. 0.3 for earth). Only used when NeverRicochet is false.", ClampMin = "0"))
|
||||
float RicochetProbabilityMultiplier = 1.0f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material", meta = (ToolTip = "Per-material coefficient of restitution for ricochet (0.0-1.0). Controls bounce energy in the normal direction. 0.0 = no bounce, 1.0 = perfect elastic bounce. How much this value is used depends on RicochetRestitutionInfluence."))
|
||||
float RicochetRestitution = 0.5f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material", meta = (ToolTip = "Blend factor (0.0-1.0) controlling how much this material's RicochetRestitution overrides the bullet's own restitution. 0.0 = use bullet's value entirely. 1.0 = use this material's value entirely. 0.5 = average of both.", ClampMin = "0", ClampMax = "1"))
|
||||
float RicochetRestitutionInfluence = 0.0f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material", meta = (ToolTip = "Per-material friction coefficient for ricochet (0.0-1.0). Controls tangential velocity loss on bounce. 0.0 = no friction (full slide), 1.0 = full friction. How much this value is used depends on RicochetFrictionInfluence."))
|
||||
float RicochetFriction = 0.5f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material", meta = (ToolTip = "Blend factor (0.0-1.0) controlling how much this material's RicochetFriction overrides the bullet's own friction. 0.0 = use bullet's value entirely. 1.0 = use this material's value entirely.", ClampMin = "0", ClampMax = "1"))
|
||||
float RicochetFrictionInfluence = 0.0f;
|
||||
UPROPERTY(EditAnywhere, Category = "Material", meta = (ToolTip = "Per-material random angular spread (radians) applied after ricochet. If non-zero, overrides the bullet's RicochetSpread for this material. Higher values simulate rougher surfaces causing more unpredictable bounces."))
|
||||
float RicochetSpread = 0.0f;
|
||||
};
|
||||
|
||||
UCLASS(BlueprintType)
|
||||
@ -41,5 +55,6 @@ class UEBMaterialResponseMap : public UDataAsset{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, Category = "Responses") TMap<UPhysicalMaterial*, FEBMaterialResponseMapEntry> Map;
|
||||
UPROPERTY(EditAnywhere, Category = "Responses", meta = (ToolTip = "Maps Unreal Physical Materials to per-material impact behavior overrides. Each entry defines how bullets interact with a specific surface type (penetration, ricochet, spread). Physical Materials are assigned to mesh surfaces in material instances. Materials not in this map use the bullet's default impact settings."))
|
||||
TMap<UPhysicalMaterial*, FEBMaterialResponseMapEntry> Map;
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user