Death and respawn
Modules PulseRespawn (depends on PulseCombat, PulseInventory and PulseAbility) and PulseRespawnUI (the death screen on the UI host of Pulse Foundation, the Pulse HUD by default; its point buttons are Pulse HUD buttons). When a player’s pawn dies, the player waits a few seconds, sees the death screen, picks a respawn point (or lets a rule pick one) and comes back. What the player carried falls into a death bag that only the player and its team can empty. With the downed mode a player whose health runs out goes down first: a teammate revives it by holding the interaction on it, else it bleeds out and dies.
Overview
| Type | What it is |
|---|---|
UPulseRespawnComponent | On the player controller: follows the life state of the pawn’s combat component, the waiting time, the choice of the point (server request), the death bag |
APulseRespawnPointActor | Pulse Respawn Point: a place in the level, with a team and tags |
APulseDeathBag | The bag a dead player leaves: an inventory, its owner as player id, a lifetime |
UPulseRespawnSubsystem | The respawn points of the world, on every machine |
FPulseRespawnRule | How a point is picked when the player does not choose: Nearest, Random, Last Used, Blueprint (instanced structs) |
FPulseRespawnMode | How the player comes back: Revive, Restart, Blueprint (instanced structs) |
FPulseRespawnDeath | What is known about a death: killer, cause, place |
FPulseRespawnPlan | A respawn about to happen: point, place, chosen, forced, refusal (for the plan hooks) |
UPulseDeathScreenWidget | Pulse Death Screen: “You died”, the countdown and one button per point |
UPulseReviveComponent | Pulse Revive: the hold interaction “Revive” on the pawn of a downed player, its movement and owner tags (downed mode) |
FPulseDownedState, FPulseDownedRule | The current down (since, bleed-out, reviver); who may go down: Players Only, Not Alone, Max Downs, Conditions (instanced structs) |
UPulseDownedScreenWidget | Pulse Downed Screen: the bleed-out countdown, the revive progress and Give up |
UPulseRespawnSettings | Project Settings > Pulse > Gameplay > Respawn |
UPulseRespawnUISettings | Project Settings > Pulse > Gameplay > Respawn UI |
Setup
- The pawn needs a Pulse combat component (
UPulseCombatComponent): its life state tells the respawn component when the player dies. Pawns without one use the death source Attribute, or Manual and call Handle Player Died and Handle Player Revived on the respawn component themselves. - Turn on the automatic Respawn Component in Project Settings > Pulse > Gameplay > Respawn (or with the setup step “Respawn” in the Pulse window). It goes on every player controller.
- Place Pulse Respawn Point actors. Without points the player comes back at a player start of the game mode (Use Player Start Fallback).
- The death screen shows through the UI host of Pulse Foundation (the Pulse HUD by default,
bEnableHUD). Respawn UI Activation decides when it starts:With UI Host(default) with the Pulse HUD or a Presenter Class of your own,Alwaysalso with the default presenter (in the viewport),Nevernot at all. The screen opens on the layerPulse.UI.Layer.Game(the main HUD stack of the Pulse HUD) and shows the cursor through the Pulse player input manager.
The flow
The state of a player is one struct, FPulseRespawnState (phase, the stamps on the Pulse game clock, the death place, the last point, the number of deaths). It changes only through pure functions in Pulse::Respawn (PulseRespawnTypes.h), which the specs test without a world:
| Function | What it does |
|---|---|
MakeDead | Dead, the stamps of the delays (game clock), the death place, one more death; a dead state stays as it is |
CheckChoice | Whether a respawn request is allowed: dead, the delay passed, the point exists, is usable by the player and selectable |
ChoosePoint | The point a rule picks among the points the player can use |
MakeRespawned | Alive, stamps, killer and cause cleared, the point as last point |
IsPointUsable, FilterByTeam | The points a player can use: enabled, no team or the player’s team, no owner or the player as owner |
CanAccessBag | Whether a player may empty a death bag |
- Death (server): the combat component reports the death (with the killer), or the game calls Handle Player Died with an
FPulseRespawnDeath(killer, cause as a gameplay tag of the game, place). The respawn component sets the state withMakeDead(with the killer and the cause), drops the death bag, sendsPulse.Message.Respawn.Diedand fires On Died. The state replicates to the owning client (push model, owner only), where On Died fires when it arrives. - Waiting: the death screen counts down on the game clock (
Respawn Delay, 5 s). With Auto Respawn the player comes back by itself afterAuto Respawn Delay, at the point of the rule. A refused automatic respawn (a Respawn Condition, a plan hook) is kept asLastRefusalof the state, which the death screen shows, and is tried again everyAuto Respawn Retry Interval(1 s; 0 ends the automatic respawn and the player chooses). - Choice: a button on the death screen calls
RequestRespawn(PointId). A client sends a server RPC with a request id of the Pulse request subsystem; the server lets it in with its guard (kindPulse.Request.Respawn.Respawn, travel.Travel), checks it withCheckChoiceand answers with anFPulseResult. A refusal shows its reason on the screen (and is broadcast onPulse.Message.Request.Failed). The button Respawn lets the rule pick. The node Request Pulse Respawn does the same in Blueprint and waits for the answer (On Success, On Failure with the result). - Respawn (server), in this order: the checks of the choice, the point (chosen, or picked by the rule, else a player start), the Respawn Conditions, the plan hooks (Plan Respawn,
OnPlanRespawnNative), On Respawn Starting, the Mode of the settings, the state Alive,Pulse.Message.Respawn.Respawnedand On Respawned.
A pawn revived by something else (a cheat, a teammate) ends the waiting where it stands; with the death source Manual the game says so with Handle Player Revived.
Force Respawn (server) brings the player back now: no delay, no checks of the choice (also a point of another team, but not a point that is off or someone else’s personal point) and no Respawn Conditions (round starts). A living player is respawned too: the Mode moves and revives (or restarts) it, components with the carry rule Reset start new, and the message Respawned goes out. The plan hooks still run, and the message Respawned has bForced.
A death that is only caught up (a dead player loaded from a save, also after the component bound the pawn) only sets the state: no death bag, no death penalty, and Deaths is not counted; its message Died has CatchUp = Load. Games without Pulse combat set Death Source = Attribute (category Death): the death is the minimum of Death Attribute (Pulse.Stat.Health when empty) through the attribute contract, and Respawn Health is the share of that attribute. With Health a downed combatant (health empty, still alive) counts as dead; keep the death source Combat for the downed mode. Reset Attributes go back to their start value on every respawn.
While a player is dead by the death source Attribute or Manual, the respawn component puts the dead tag of Pulse combat, Pulse.Combat.State.Dead, on the player’s ability system (a loose tag, replicated) and takes it away when the player lives again (a respawn, a revive from outside, a new living pawn); with Combat the combat component does that. So the server check of the interaction (Server Block Dead Interactor) refuses a dead player with every death source: during the respawn delay it opens no door, takes no pickup, gathers nothing and pays no interaction from its corpse.
A vehicle is not the body of the player: a possessed pawn whose attribute source answers only for itself (bOwnActorOnly of the capabilities, such as a boat hull of PulseWater) is skipped, with both death sources. Boarding a wrecked boat or the wreck of the boat while driving is no death; the player keeps the state and the combat component of the body. A game that wants such a wreck to kill the driver calls Handle Player Died.
Downed
With Enable Downed (category Downed of the respawn settings, death source Combat) a player whose health runs out goes down instead of dying. The setup step “Let players go down before they die” in the Pulse window turns it on together with the automatic Respawn Component (it decides who goes down) and the automatic Revive Component (UPulseReviveComponent, on every player pawn).
- Down (server): the combat component asks Should Go Down before the death; its default asks the native listeners (
OnShouldGoDownNative), the respawn component among them. Every entry of Downed Rules must allow it (Pulse::Respawn::ShouldGoDown, the first refusal is the reason in the log):- Players Only: AI controllers with a respawn component die.
- Not Alone: only while another player of the team is alive and up (someone who could revive); Allow When Alone lets a lonely player go down too.
- Max Downs: at most this many downs between two respawns (2 by default); the next empty health is the death.
- Conditions: a Pulse condition list (player: the controller, target: the pawn, instigator: who emptied the health), or a rule struct of your own (
FPulseDownedRule::Checkanswers with anFPulseResult). The state gets the phaseDownedwithFPulseDownedState(since, the bleed-out stamp on the game clock of the server, who downed it), one more down (Downs), the messagePulse.Message.Respawn.Downedand On Downed. The combat component stays alive at empty health (Is Downed) with the tagPulse.Combat.State.Downed(owner tag, loose tag on the ability system: the melee and ranged attacks are blocked by it). List it in the Pause Tags of health rates so regeneration does not get a downed player up. AI of PulseAI does not target it (a depleted health is no living target).
- Bleed-out: after Bleed Out Time (30 s, scaled by
Pulse.Tuning.Respawn.BleedOut) the player dies with the one who downed it as killer and the causePulse.Respawn.Cause.BledOut; then the normal death and respawn follow. - Revive: a teammate holds the interaction Revive on the downed pawn (the revive component, a replicated interaction, hold time Revive Time, 4 s). Teammates are players of the same team (
Pulse::Team), or two players without a team with Teamless Players Are Teammates. The server starts the revive (StartRevive, checked byPulse::Respawn::CanRevive: down, another player of the team, alive and up, within Revive Range, nobody else reviving), pauses the bleed-out (Pause Bleed Out While Reviving) and checks range and reviver every 0.25 s on the game clock. When the hold completes the health comes back to Revive Health (30 %), the phase is Alive again,Pulse.Message.Respawn.Revivedand On Revived follow. The revive stops (progress lost, the bleed-out runs on) when the teammate lets go, walks away, or one of the two takes damage. Clients compute the progress from the replicated stamps (StepDowned). - Other ends: healing from outside (a medkit) gets the player up too (Revived with
bByHealing).Killwhile down ends the down with the death; Give Up (owning client:Request Give Up, the button of the downed screen; off with Allow Give Up) dies at once with the causePulse.Respawn.Cause.GaveUp. With Damage Finishes Downed damage to a downed player kills it. Handle Player Died (and the cheatPulseRespawnDie) while down kills the combatant too; Force Respawn while down ends the down without a message and brings the health back like any respawn. Only the running revive of a teammate completes: a hold that was stopped by damage, or that started while someone else revived, revives nothing. - Saving: the down is not saved. A player saved while down loads with empty health and so dead (caught up: no death bag, no penalty, Died with catch up
Load); a load that gives the health back while the player is down ends the down like healing (Revived withbByHealing).
The pure functions (PulseRespawnTypes.h, specs PulseRespawn.Downed.Rules):
| Function | What it does |
|---|---|
ShouldGoDown | Asks the downed rules with an FPulseDownedContext (player or AI, team, teammates up, downs since the respawn) |
MakeDowned | Downed, since now, the bleed-out stamp, one more down |
StartRevive, StopRevive | The reviver and the start; the bleed-out paused with the time left and resumed from it |
StepDowned | The revive progress, the bleed-out time left and the outcome (none, bled out, revived) |
MakeRevived | Alive again; the downs stay until the next death or respawn |
CanRevive, ToResult | Who may revive, and the reason as FPulseResult |
Movement: Downed Movement Crawl (factor Crawl Speed Factor, 0.3) or None. The revive component carries the owner tags Pulse.Respawn.State.Downed, .Downed.Crawl or .Downed.NoMove and .Downed.BeingRevived on every machine, for animations and the game’s own movement; with Scale Character Speed it scales MaxWalkSpeed of a character itself (and restores it).
Who sees what: the down state replicates to the owning client only (the downed screen); everyone else sees the combat state (Is Downed, the tags) and the revive component (Is Downed, Get Reviver). The downed screen (UPulseDownedScreenWidget, Respawn UI settings Downed Screen Class, layer Pulse.UI.Layer.Game, game and UI input) shows “Bleeding out in 12 s”, “Ann is reviving you” with a progress bar and Give up; bind TitleText, CountdownText, ReviveText, ReviveBar, MessageText, ButtonList and GiveUpButton in a child of your own.
Permadeath
With permadeath a player who dies stays dead: no respawn follows, the death screen says so, and the save keeps it. Turn it on with Permadeath (category Death of the respawn settings) for every game, or let a difficulty or the server rules turn it on or off: the tuning knob Pulse.Tuning.Respawn.Permadeath, a switch for everyone (not per player). A source of the knob decides, on or off; without one the settings switch decides (Pulse::Respawn::IsPermadeath, Is Permadeath On of the respawn component). Both are off by default, and then nothing changes.
- Death (server): a new death while permadeath is on is permanent. The state gets
bPermanent(Pulse::Respawn::MakePermanent: no respawn stamps, no automatic respawn), replicated to the owning client with the rest of the state. The death bag, the death penalty,Pulse.Message.Respawn.Diedand On Died happen as for any death; thenPulse.Message.Respawn.PermanentDeathand On Permanent Death follow. - No way back: Try Respawn, Request Respawn, the automatic respawn and Force Respawn are refused with
Pulse.Result.Failure.Respawn.Permanent(“Your death is permanent.”), and the log says why. So are the cheatsPulseRespawnNowandPulseRespawnForce. A revive from outside (Handle Player Revived, a revive of the pawn, a new living pawn of the game mode) does not end it either; the log warns. - Downed: a down is no death. A teammate still revives a downed player, healing still gets it up. A bleed-out, giving up,
Killor damage with Damage Finishes Downed are deaths and so permanent. - Saving: the respawn component saves the permanent death with its cause and place (
FPulseRespawnSaveData, version 2; a save of version 1 has none). A load keeps the player dead: a living player dies as caught up (no death bag, no penalty, no further death in the count), a dead one becomes permanent, andDiedandPermanentDeathcarryCatchUp = Load, so a listener does not take it for a new death. A save without the permanent death, and Reset To Defaults (a new game), end it: the player is still dead and may respawn from then on. - Death screen: the default death screen shows Permanent Title Text (“You died for good”) and Permanent Death Text (“Your death is permanent. There is no respawn.”) instead of the countdown and hides the buttons;
On Countdowngets a negative number. A screen of your own asks Is Permanently Dead.
PulseRespawn deletes no saves and no characters. What a permanent death means for them is up to the listeners of Pulse.Message.Respawn.PermanentDeath: a save bridge may delete the slot of a hardcore game, character saves may remove the character. Its context: the controller as player, the pawn as target, the killer as instigator, the cause in the tags, amount 1.
Respawn points
A Pulse Respawn Point holds one FPulseRespawnPoint:
| Field | What it is |
|---|---|
| Point Id | Stable id; empty uses the actor name (the server writes it into the replicated point). Give saved points an id of their own. |
| Display Name | Name on the death screen |
| Team | Team that may use it (Pulse.Team.*); empty for every player |
| Tags | What kind of point it is (Pulse.Respawn.Point.* or tags of the game); rules can ask for them |
| Enabled | Off: nobody uses it |
| Selectable | Off: only the rule picks it, the death screen does not show it |
| Owner Player Id | Personal point (a bed): only the player with this id uses it; empty for every player |
SetPointEnabled, SetPointTeam and SetOwnerPlayerId change a point while playing (server; GetOwnerPlayerId reads the owner). A personal point such as a bed or a sleeping bag can derive from Pulse Respawn Point and set its owner with SetOwnerPlayerId when it is placed; games with points of their own (beds, camps) can also add them with UPulseRespawnSubsystem::SetPoint on every machine.
Points sleep on the network (net dormancy): a placed point is not sent until it changes, a point spawned while playing sleeps after its first replication, and SetPointEnabled, SetPointTeam and SetOwnerPlayerId wake it for the change. A personal point reaches only its owner and a team point only its team (Pulse::Respawn::IsPointRelevantTo), at any distance (points are always relevant to their audience, the death screen lists far points too); points without owner and team reach everyone. Placed points exist on every machine with the level anyway; the rule keeps spawned beds and sleeping bags of other players off the network. A child class that replicates more state calls FlushNetDormancy when it changes it.
A new owner or team (SetOwnerPlayerId, SetPointTeam) changes the audience of a sleeping point. A sleeping channel is not closed when its point stops being relevant, so the players who lost the point would keep the old one and their death screen would list a point the server refuses. So the connections that hold the point at the change (an open channel, or the point asleep on them) stay relevant for PreviousAudienceSeconds (3 s): their clients receive the change, and their death screen drops the point, because it lists only points the local player may use (GetSelectablePoints with its own player id and team). The point stays awake until the net driver closed their channels (its RelevantTimeout plus a second; a spawned point disappears from their clients then), and sleeps again afterwards. Placed points take the same way; their level copy may stay on those clients, with the new owner or team, so their death screen does not list it.
Only real holders count, never the rule as it was before the change: a spawned bed has no owner and no team at first, and that rule reaches everyone. So spawning a bed (or loading saved beds) and then calling SetOwnerPlayerId sends it to its owner only, also when the owner is set before FinishSpawning (then the point simply sleeps after its first replication). With Iris a connection that loses the point drops it at once (the filter removes it from the client), so Iris needs no old audience: the filter group allows the new audience only.
Network audience
Death bags and respawn points keep their audience with both replication systems of the engine:
- Classic net driver:
IsNetRelevantForof the actor asks the rule (IsPointRelevantTo,CanAccessBag) for the player of every connection. - Iris: Iris does not call
IsNetRelevantFor. The server’sUPulseRespawnNetAudienceSubsystemgives every bag and point an exclusion filter group of the replication system (AddExclusionFilterGroup) that allows only the connections whose player is in the audience (a split screen connection when one of its players is). It applies the audience at once when a bag or point starts or changes its owner or team, and twice a second for logins, player ids and team changes, so a player who joins a team gets its points within half a second. Filtering happens before the spatial filters, so the bag’s net cull distance still applies. The module callsSetupIrisSupportin itsBuild.cs. Bags and points with the same audience share one group: the key is the rule, the owner and the team (Pulse::Respawn::Net::FAudienceKey: a bag by owner and, with Team Can Access Bag, its team; a point by its owner, else its team), so the groups grow with the players and teams that own bags and points, not with the bags, and a point without owner and team gets no group. Groups count againstMaxNetObjectGroupCountof the replication system (2048 by default, shared with the engine and other plugins). It fails closed: a group that allows nobody is made before the first audience group, and an actor that finds no group for its key goes there; without even that one it stops replicating (SetReplicates(false)) until a group is free. Both cases log an Error onLogPulseRespawn. The refresh twice a second only touches the connections when the players of the connections (connection, player id, team) changed. A group gets its whole set of connections at once (SetGroupFilterStatuswith a bit array), which disallows every other connection id, also one that went away: Iris keeps the status of an exclusion group per connection id overRemoveConnectionand gives it to the next connection with that id. When a player logs out (FGameModeEvents::OnGameModeLogoutEvent) every group is applied again without it at once, so a new player who gets the freed connection id never receives a bag or a private point of the player before. - Replication Graph: a graph does not call
IsNetRelevantForeither and has no such filter. A game that uses one routesAPulseDeathBagandAPulseRespawnPointActorthrough a node of its own per connection (the rule isPulse::Respawn::IsPointRelevantToandPulse::Respawn::CanAccessBag); its always relevant node would send personal points to everyone.
Log LogPulseRespawn Verbose writes every change of an Iris audience (“connection N receives it”); PulseDebugDump Respawn on a client lists the points (with team and owner) and the bags that reached it.
Rules
The rule of the settings (or of a respawn component) picks the point when the player does not choose one. Every rule only sees the points of the player’s team; Required Tags narrows them further (all points when none has the tags).
| Rule | Picks |
|---|---|
| Nearest (default) | The point nearest to the death place; Min Distance skips points too close to it while farther ones exist |
| Random | A random point, the same for the same seed (the player id and the number of deaths) |
| Last Used | The home point of the player while it is usable, else the point of the last respawn while it is usable, else its Fallback rule (Nearest when empty) |
| Blueprint | What a Blueprint derived from Pulse Respawn Rule Object (picked as Rule Class) answers in Choose (an index into the points, one of the candidates; anything else takes the first candidate) |
Your own rule: a USTRUCT derived from FPulseRespawnRule that overrides Choose, or the Blueprint rule. Rules keep no state; what they know about the player comes in FPulseRespawnContext: the death place, team, last point, home point, seed, the controller, the player id, the killer, the cause and the deaths.
Home point: Set Home Point (server) gives a player a preferred point, such as the bed or sleeping bag it slept in (Get Home Point Id reads it, FPulseRespawnState::HomePointId on the owning client). Rule Last Used takes it before the last point while it is usable (enabled, the player’s team, a personal point of this player), your own rules read HomePointId of the context. The id is not checked when it is set, so a point that registers later counts; none clears the home. It is saved with the last point and cleared by a new game.
The Blueprint entries of rules and modes name a class, not an object, so they survive the ini of the project settings. The respawn subsystem makes one instance of each class per world (UPulseRespawnSubsystem::GetStrategyObject): values differ per child class, not per entry.
Modes
Mode of the settings decides how the player comes back. Modes keep no state and build on two public steps of the respawn component, which a Blueprint mode can call too:
- Revive At (
ReviveAt): the pawn is moved to the place and revived (Pulse::Combat::Revivewith Respawn Health, a share of the maximum health), Reset Attributes go back to their start value, components with the carry rule Reset start new. False without a pawn the death source can revive. - Restart At (
RestartAt): a new pawn appears at the place (of the given class, or the default pawn of the game mode throughRestartPlayerAtTransform), then the old pawn is destroyed. What the old pawn keeps goes to the new one. When no new pawn can be made the player keeps the old one and the step returns false.
| Mode | What it does |
|---|---|
| Revive (default) | Revive At; Restart At when there is no pawn to revive |
| Restart | Restart At, with Pawn Class (empty: the default pawn of the game mode) |
| Blueprint | Respawn of a Blueprint derived from Pulse Respawn Mode Object, picked as Mode Class (its default: Revive) |
Your own mode: a USTRUCT derived from FPulseRespawnMode that overrides Respawn.
With the death source Manual, Revive At moves the pawn, resets the Reset Attributes and the components with the carry rule Reset, but does not touch a health of the game’s own: the game restores it (in On Respawned, or in a Blueprint mode).
Respawn conditions
Respawn Conditions (a Pulse condition list of the settings) must pass for a respawn the player asks for and for the automatic respawn: a limit of lives, waves, a teammate who is alive. They are checked when the point is known; the player is the controller, the target the pawn, the source the actor of the point (a Pulse Respawn Point). A refusal answers with Pulse.Result.Failure.Conditions and the line of the first condition that failed, which the death screen shows. A refused automatic respawn is tried again every Auto Respawn Retry Interval of the timing (a wave that starts, a teammate who comes back), and its reason stays on the death screen until the player is back; with 0 it waits for a request of the player or a Force Respawn, which skips the conditions. Conditions made in Blueprint come from the condition objects of Pulse Foundation.
The conditions only guard the respawns of the respawn component. A living pawn the game gives the player itself (a RestartPlayer of the game mode, a spawn of its own) ends the waiting like a revive from outside, without conditions, plan hooks or the message Respawned; the log warns when Respawn Conditions are set. Bring players back through Try Respawn or Force Respawn when a limit of lives must hold.
Hooks
On the server, before the mode runs:
- Plan Respawn (a BlueprintNativeEvent of a child of the respawn component) and then
OnPlanRespawnNative(C++, bridges) get theFPulseRespawnPlan: they may change Transform, name another Point Id (the respawn then uses that point: its place unless the hook moved Transform too, its actor as source; an unknown id refuses) or set Refusal to a failure. A refusal is the answer of the request (without a reason it getsPulse.Result.Failure.Refused). - On Respawn Starting (and
OnRespawnStartingNative) then sees the final plan, read only.
On Died (and OnDiedNative) fire on the server for every death, also one that was only caught up, and on the owning client when a new dead state arrives (also a death that followed a respawn within one net update). On Respawned stays the event after the respawn.
Death bag
When a player dies, its inventory (UPulseInventoryComponent of the controller, pawn or player state) falls into an APulseDeathBag on the ground below the death place:
- All or nothing: the player’s contents become
FPulseInventorySaveDataand are imported into the bag (Pulse::Respawn::Bag::PlanDropIntoBag: layout, persisted traits, every stack with its traits and id); only when every stack imports, the player’s stacks are removed, both in oneApplyTogether. Otherwise the player keeps everything and the log says why. - Rights: the owner is a player id (
FPulseDeathBagState::OwnerPlayerId), not an actor, so it stays valid after a respawn. The owner and, with Team Can Access Bag, players of the owner’s team may empty it; others see “Not yours”. The bag’s inventory asksPulse::Respawn::CanAccessBaginCanRequesterModify, so single items move with the inventory requests too, but only from next to the bag: the pawn of the requester must be within Death Bag Reach (400 cm to the bag’s bounds plus Reach Tolerance of the request guard of PulseFoundation, 100 cm; 0 does not check) and, with Death Bag Line Of Sight, see the bag (Visibility;Pulse::Requests::CheckReachandHasLineOfSightthroughPulse::Ability::Interact::Reach::CheckReach,APulseDeathBag::IsInReachOf; the equipment of the player and actors attached to the bag do not block). A player without a pawn is too far. Take All by interaction is checked by the reach of the replicated interaction. A dead player takes nothing: its pawn stays possessed until the respawn and the bag lies right under it, so the bag refuses a player whose respawn component is dead or whose pawn is not alive (APulseDeathBag::IsRequesterAlive:UPulseRespawnComponent::IsDead,Pulse::Combat::IsAlive) inIsInReachOf(the inventory requests),CanBeInteractedWith(the interaction, at its start and when a hold completes) andTakeAll. The corpse run stays a run, also with the carry rule Keep, in Revive mode or with an inventory on the player state. Bound stacks (Bound trait without Can Transfer) and lent stacks go back to the owner only (Pulse::Respawn::Bag::CanTakeStack): a teammate’s Take All leaves them in the bag, and the bag’sCanRequesterChangeItemrefuses a teammate’s requests that would take them out (transfer, drop, use, remove), also through the item user (use from the bag) and the equipment (equip from the bag). A lent stack is never equipped straight from the bag, not by the owner either (another holder): the owner takes it back first. The bag and its contents reach only the clients of players who may empty it (CanAccessBag, inIsNetRelevantForand with Iris in a filter group, see Network audience); other players do not receive it at all. - Taking: the interaction (“Take all”) moves everything that fits into the player’s inventory (
Pulse::Respawn::Bag::PlanTakeAllwith the taker’s player id, stack by stack with the instance traits; a stack that fits in part moves that part; bound and lent stacks only for the owner). The bag needs a replicated interaction (UPulseRepInteractAbility). - Lifetime: the bag disappears after Death Bag Lifetime (game clock, 600 s; 0 keeps it) and, with Destroy Empty Bag, when it is empty. A player has at most Max Death Bags Per Player bags (10; 0 has no limit): a new bag takes the place of the oldest one, which disappears with what is left in it (
UPulseRespawnSubsystem::TrimBags), so a player who dies on purpose cannot fill the world with bags.Pulse.Message.Respawn.BagDroppedis broadcast when it is dropped. - Saving: the respawn subsystem knows the bags of the world (
GetBags,FindLastBagby player id) and saves them as bytes on the server through a save carrier (save identityPulse.Respawn.Save.DeathBags,FPulseDeathBagsSaveData: owner and expiry, place, class, the inventory as bytes; the bag inventory saves nothing of its own). A load replaces the bags lying in the world, so a bag dropped after the save does not double the items the loaded player has again; bags whose time ran out are left out. While bags drop, the subsystem also saves an empty list.GetLastBagof the respawn component finds a loaded bag by the player id.
The equipment stays with the player.
Tuning
The tuning knob Pulse.Tuning.Death.Inventory of PulseFoundation, a choice, decides what happens to the inventory of a player who dies: Settings (the default: bDropDeathBag decides), Keep, Drop (into a death bag) or Destroy (every stack is removed). A player may choose it for themselves when the host allows it, so one player can play hardcore in a group. The controller is the player of the context, the pawn the target.
Pulse.Tuning.Respawn.Delay, a factor per player (0 to 10), scales Respawn Delay and Auto Respawn Delay of a player who dies.
Pulse.Tuning.Respawn.BleedOut, a factor per player (0 to 10), scales Bleed Out Time of a player who goes down.
Pulse.Tuning.Respawn.Permadeath, a switch for everyone (off), makes deaths permanent; without a source Permadeath of the settings decides (see Permadeath).
What the player keeps
Components of the pawn that save themselves as bytes (IPulseByteSaveable of Pulse Foundation: survival values, skills or quest logs that live on the pawn) follow Carry Rules, by the tag of their save identity (the closest parent tag wins; Default Carry Rule for the rest):
- Keep: the state goes with the player. In Restart mode it is taken from the old pawn before it goes and given to the components of the new pawn with the same save id (
FPulsePlayerCarry). - Reset: the state starts new. In Revive mode the component is asked to reset (
ResetToDefaults); in Restart mode the new pawn’s component simply starts fresh. - The inventory falls into the death bag (Death Bag) instead. Attributes in Reset Attributes of the respawn settings go back to their start value; Pulse Survival resets hunger and thirst on a respawn by itself.
A level change uses the same carry: Store Player Carry (Pulse Foundation) on the server before the travel, and the respawn component gives it to the new pawn when the player gets one.
The respawn component saves itself as bytes (IPulseByteSaveable, save identity Pulse.Respawn.Save.State): the point of the last respawn and the home point (rule “last used”) and the deaths (seed of the random rule). A player is alive after a load: the life state belongs to the loaded pawn. The down is not saved: a player saved while down loads dead (caught up), and a load that gives the health back ends a running down like healing.
Death penalty
Death Penalty is a cost list (Pulse costs of any plugin: experience, gold, durability) the dying player pays, as one exchange: all or nothing. A player who cannot pay all of it pays nothing; the log says why.
Travel
With Allow Travel, living players travel to respawn points: the same points as a respawn (the team’s, selectable), Travel Costs paid first as an exchange. Request Travel from the owning client or Try Travel on the server; Pulse.Message.Respawn.Traveled follows. Dead players respawn instead.
Messages
| Channel | Payload | Context |
|---|---|---|
Pulse.Message.Respawn.Died | FPulseRespawnDiedMessage (place, killer, cause, deaths) | player: the controller, target: the pawn, instigator: the killer, tags: the cause, amount 1; a death only caught up has CatchUp = Load |
Pulse.Message.Respawn.Respawned | FPulseRespawnedMessage (point id, place, chosen or by the rule, bForced; a forced respawn also of a living player) | player: the controller, target: the pawn, source: the actor of the point, amount 1 |
Pulse.Message.Respawn.BagDropped | FPulseDeathBagMessage (bag, owner and rights, stacks) | player: the controller, target: the bag, amount: stacks |
Pulse.Message.Respawn.Traveled | FPulseRespawnedMessage (point id, place) | player: the controller, target: the pawn, amount 1 |
Pulse.Message.Respawn.Downed | FPulseDownedMessage (place, who downed it, bleed-out seconds, downs) | player: the controller, target: the pawn, instigator: who emptied the health, amount: the downs since the respawn |
Pulse.Message.Respawn.Revived | FPulseRevivedMessage (reviver, bByHealing, health share, downs) | player: the controller, target: the pawn, instigator: the reviver, amount 1 |
Pulse.Message.Respawn.PermanentDeath | FPulseRespawnPermanentDeathMessage (place, killer, cause, deaths) | player: the controller, target: the pawn, instigator: the killer, tags: the cause, amount 1; a permanent death a load brings back has CatchUp = Load. PulseRespawn deletes nothing: listeners remove saves or characters |
All come from the server.
Blueprint and C++
| Function | Where | What it does |
|---|---|---|
Find Respawn Component | any | The respawn component of a controller, pawn or player state |
Request Respawn | owning client or server | Asks for the respawn at a point (none: the rule) |
Request Pulse Respawn | owning client or server | Async node: Request Respawn with On Success and On Failure |
Try Respawn | server | Respawns now, returns the result |
Force Respawn | server | Respawns now without delay, checks of the choice and Respawn Conditions (also a living player); refused after a permanent death |
Handle Player Died | server | Sets the player dead, with killer, cause and place (FPulseRespawnDeath, all optional) |
Handle Player Revived | server | The player came back by something else: the waiting ends where the pawn stands |
Revive At, Restart At | server | The steps of the respawn modes |
Request Travel / Try Travel | owning client or server / server | Brings a living player to a respawn point (travel) |
Request Pulse Travel | owning client or server | Async node: Request Travel with On Success and On Failure |
Get State, Get Death, Is Dead, Get Seconds Until Respawn, Get Selectable Points | owning client and server | For your own death screen |
Set Home Point / Get Home Point Id | server / owning client and server | The preferred point of the player (rule Last Used), saved; none clears it |
On State Changed, On Died, On Respawn Starting, On Respawned | events | Died or respawned; died (server, owning client); the plan is final (server); came back (server) |
Plan Respawn | child of the component, server | Hook before the mode: change the place or refuse |
Is Downed, Get Seconds Until Bleed Out, Get Revive Progress, Can Give Up | owning client and server | For your own downed screen |
Start Revive, Stop Revive, Complete Revive | server | The revive (the revive component calls them); Complete Revive without a reviver gets the player up at once |
Request Give Up / Give Up | owning client or server / server | The downed player dies at once |
Force Down | server | Empties the health and lets the player go down without the downed rules (cheats, tests) |
On Downed, On Revived | events (server) | Went down; got up (revive or healing) |
Is Permanently Dead, Is Permadeath On | owning client and server / server | Died for good; whether a death now would be permanent (knob, else settings) |
On Permanent Death | event (server, owning client) | Died for good, also a permanent death a load brought back |
Check Revive (revive component) | any | Whether an actor may revive this pawn now |
Your own death screen: set Death Screen Class in the Respawn UI settings to any activatable widget, or derive from Pulse Death Screen and bind Backdrop, TitleText, KillerText, CountdownText, MessageText, PointList and RespawnButton. The default screen makes its buttons from the Modal Action Button Class of the HUD settings. KillerText shows a line such as “Killed by Ann (Fall)”: the player name of the killer (else its class), the cause by Cause Texts of the Respawn UI settings (else the last part of its tag); override Make Killer Text for your own line, an empty text hides it. The line follows the state while the screen is open (a killer that replicates late, another death). MessageText shows the reason of a refused request, and of a refused automatic respawn (LastRefusal of the state).
Settings
| Setting | Default | Description |
|---|---|---|
Timing | 5 s, no automatic respawn (30 s, retried every 1 s when refused) | Delays on the game clock |
Rule | Nearest | How a point is picked when the player does not choose |
bAllowChoice | true | Players choose a point on the death screen |
Mode | Revive | How the player comes back: Revive, Restart, Blueprint or a mode of your own |
RespawnConditions | empty | Conditions of a respawn the player asks for and of the automatic respawn |
DeathSource, DeathAttribute | Combat, Health | What tells that the player died: Combat, Attribute or Manual |
bPermadeath | false | Deaths are permanent; a source of Pulse.Tuning.Respawn.Permadeath decides over it |
RespawnHealth | 1 | Health after the respawn |
bUsePlayerStartFallback | true | A player start when there is no point |
CarryRules | empty | Keep or Reset per save identity tag of the pawn’s byte saveable components |
DefaultCarryRule | Keep | Rule of components without an entry |
DeathPenalty | empty | Costs a dying player pays (all or nothing) |
bAllowTravel | false | Living players travel to respawn points |
TravelCosts | empty | Costs of one travel |
bDropDeathBag | true | The inventory falls into a death bag |
DeathBagClass | APulseDeathBag | The bag actor |
DeathBagLifetime | 600 | Game seconds until the bag disappears; 0 keeps it |
MaxDeathBagsPerPlayer | 10 | Bags one player may have at once; a new bag takes the place of the oldest; 0 has no limit |
bTeamCanAccessBag | true | The owner’s team may empty the bag |
DeathBagReach | 400 | How far (cm) the pawn of a player may be from the bag to move its items with inventory requests, plus Reach Tolerance of the request guard; 0 does not check |
bDeathBagLineOfSight | true | The inventory requests on a bag also need a free line from the pawn’s eyes to the bag |
bDestroyEmptyBag | true | An empty bag goes away |
RespawnComponent | off | Automatic respawn component on every player controller |
bEnableDowned | false | The downed mode (needs the death source Combat and the revive component) |
DownedRules | Players Only, Not Alone, Max Downs 2 | Who may go down |
BleedOutTime | 30 | Game seconds until a downed player bleeds out |
ReviveTime, ReviveHealth, ReviveRange | 4 s, 0.3, 300 cm | Hold time, health share and range of a revive |
bPauseBleedOutWhileReviving | true | The bleed-out waits during a revive |
bTeamlessPlayersAreTeammates | true | Players without a team revive each other |
bAllowGiveUp | true | A downed player may give up |
bDamageFinishesDowned | false | Damage kills a downed player |
DownedMovement, CrawlSpeedFactor, bScaleCharacterSpeed | Crawl, 0.3, true | How a downed player moves |
ReviveComponent | off | Automatic revive component on every player pawn |
RespawnUIActivation (Respawn UI) | With UI Host | When the death screen starts (With UI Host, Always, Never) |
bShowDeathScreen (Respawn UI) | true | The death screen on the UI host |
DeathScreenClass (Respawn UI) | UPulseDeathScreenWidget | The death screen |
DeathScreenLayer (Respawn UI) | Pulse.UI.Layer.Game | Layer of the UI host the screen opens on |
PointButtonClass (Respawn UI) | W_DefaultModalButton | Button of the default screen for every respawn point |
DeathScreenInputContext, DeathScreenInputPriority (Respawn UI) | menu, 450 | Input while the screen is open |
CauseTexts (Respawn UI) | empty | Names of the causes of death on the death screen |
bShowDownedScreen, DownedScreenClass, DownedScreenLayer (Respawn UI) | true, UPulseDownedScreenWidget, Pulse.UI.Layer.Game | The downed screen |
DownedScreenInputContext, DownedScreenInputPriority (Respawn UI) | game and menu, 440 | Input while the downed screen is open |
Example
Play the PulseGameplay example map with a listen server and a client, then PulseGameplayGrant (it calls PulseRespawnGrant: a respawn component and a point at the pawn when the level has none). PulseCombatKill kills the player: the death screen counts down, the point button and Respawn bring the player back. The bag lies where the player died; PulseRespawnTeam Enemy on the other player shows that it is “not yours”, PulseRespawnTakeBag empties it for the owner or a teammate. PulseRespawnDie shows the cause on the death screen, PulseRespawnForce brings the player back at once.
The downed mode: turn on Enable Downed and the Revive Component (setup step “Let players go down before they die”), play with a listen server and a client, PulseRespawnDown on one player (it goes down; PulseRespawnDown Force also with the rules refusing), then the other holds the interaction on it (or PulseRespawnReviveNearest). PulseRespawnRevive gets the player up at once, PulseRespawnGiveUp lets it die.
Switching it off. UPulseRespawnUISubsystem is switchable: add it to Disabled Subsystems (Project Settings > Pulse > Foundation > Subsystems) when your game brings its own death screen. Death and respawn work as before. See Replacing and switching off subsystems.
Cheats
See Console.