Build your own boss body
A boss in this kit has two halves:
- The fight logic - the director, phases, attack loops, tile grid and boss target (README section 8). It decides what attacks happen and when the boss is hurt.
- The boss body -
ACorridorBossBody. It is the visible boss: a set of static-mesh parts that move, light up and hurt the hero. It only listens to the fight; it never changes it.
The body is data only. You build it in the Details panel (or as a Blueprint child) and no code is needed. The two shipped bosses are examples to copy from:
| Blueprint | Where | Parts |
|---|---|---|
BP_Boss_Machinist |
/PlatformerKit/Blueprints/Boss |
11 parts (Boss 1) |
BP_Boss_Engine |
/PlatformerKit/Blueprints/Boss |
20 parts (Boss 2) |
Open Corridor_Boss1 or Corridor_Boss2, select the boss in the level and press Ctrl+B to open its Blueprint. Everything below is visible there.
1. Make a body
- In the Content Browser, right-click Add > Blueprint Class, search Corridor Boss Body, create
BP_MyBoss. - Drag it into your boss map where the boss should stand.
- Select it and fill the Parts array (section 2) in Details. Parts are built when you change the array, so you see the boss in the viewport as you work.
- Leave Director and Attack Loops empty: the body finds the level's boss director and its attack loops itself. Fill them only if the level has more than one director.
- Add the body to the director's phases (section 6).
2. Parts
Each entry of Parts is one static mesh.
| Field | What it does |
|---|---|
| Name | Unique name. Moves refer to a part by its position in the array; the name is for you and for the log. |
| Mesh | Any Static Mesh. Collision on the mesh is ignored: the body never blocks the hero; use a hazard box (section 5) to hurt. |
| Parent | Name of another part to attach to (empty = attached to the body actor). A child follows every move of its parent, so a turret on a rotating turntable turns with it. |
| Transform | Location, rotation and scale relative to the parent. |
| Signals | Optional light-up slots (section 4). |
| Launch Points | Optional points in the part's own space (cm) that a missile rain's missiles go up from; they move with the part (section 7). |
| Moves | What the part does (section 3). |
| Hazard While Moving fields | Optional hurt zone while the part moves (section 5). |
Tips: build the boss around the body actor's origin, facing +X, with the feet at Z 0. Use your own meshes; keep each part a separate static mesh so it can move.
3. Moves
A Move is one reaction: when this happens, this part does that. A part can have any number of moves.
Trigger - when the move starts:
| Trigger | Starts when |
|---|---|
| Idle | Always, looping (breathing, slow spin, glow pulse). |
| Phase Begin | The listed phase of the director begins. |
| Step Started | An attack loop starts a step of the listed Attack Kinds (for example LaneShot, MissileAtHero). Use this for telegraphs: the move starts before the shot lands (section 7). |
| Hit | The boss is hit and has the listed Health Index left. Typically used with Hide to knock a plate off. |
| Defeat | The last phase of the director begins (or the phase you set in Defeat Phase). |
| Retry | The hero died and the fight restarts at a checkpoint. Every part is put back for that checkpoint's health first, and Hit/Hide parts are shown again as they should be. |
| Track Hero | Continuous: the part turns to face the hero. |
Motion - what the part does:
| Motion | Fields used | Result |
|---|---|---|
| Spin | Axis, Speed, Time, Hold Time | Turns round the axis at Speed degrees per second: with the Idle trigger all the time, with any other trigger for Time + Hold Time (Time is also the ease in). |
| Hinge | Axis, Range, Time, Hold Time | Swings Range degrees about the axis in Time seconds, holds, swings back. |
| Slide | Axis, Range, Time, Hold Time | Same as Hinge, as a straight move. |
| Pulse | Range, Time, Hold Time | Grows by Range (0.04 = 4 %) over Time, holds, shrinks back over Time. |
| Hide | Axis, Range, Time | Flies Range cm along the axis over Time while it tumbles, then stays hidden until the parts are restored (a retry or a new fight). |
| Signal | Signal Index, Signal Color, Signal Intensity, Time, Hold Time | No motion: lights its signal slot for Time + Hold Time (section 4). |
Common fields: Delay (seconds after the trigger before the move starts), Time, Hold Time (-1 = hold until the parts are restored), Signal Index (any move can light a signal slot while it plays; -1 = none) with Signal Color and Signal Intensity, Sfx (section 8).
4. Signals - lights and glow
A Signal slot on a part lets a move change a material colour and glow.
- Give the part a material with a vector parameter for colour and a scalar parameter for glow. The shipped
M_Boss_SignalhasColorandIntensity;MI_Boss_Signalis an instance of it. - In the part's Signals, add a slot: Slot (the material slot on the mesh), Color Param and Intensity Param (the parameter names), and the idle colour and idle intensity.
- In a move, choose Motion = Signal, set Signal Index (the slot), Signal Color and Signal Intensity. Tick Shot Color to take the colour of the attack that is being telegraphed.
5. Hazard While Moving
A part can hurt the hero while one of its moves plays, for example a swinging boom.
- Hazard While Moving: on.
- Hazard Center and Hazard Extent: a box in the part's own space, in centimetres before the part's scale.
- Hazard Moves: which moves hurt (indices into Moves). Empty = every move except Idle and Track Hero.
- Hazard Death: the death kind when the box hits the hero (default Touch; also Fall, Explosion, Squash, Electric, Burn and more). The shield companion takes the hit first unless Hazard Ignores Shield is on.
- Hazard Ignores Shield: the shield does not help.
The hero is hit only while the move is actually running, through the same path as every other hazard (shield, death, respawn). Always give the player a telegraph first: make the hazardous move start from a Step Started trigger with a Delay, and add a Signal move that lights the part up earlier. In the shipped Boss 2 the boom lights up and swings 0.25 s after it starts; leave more time in your own boss if the arena is small.
6. Put the body in a phase
The director only runs actors listed in a phase's Enable Actors. A body that is not listed does nothing in that phase.
- Select the boss director in the level.
- In Phases, open each phase where the body should react.
- In Enable Actors, add your
BP_MyBossnext to the attack loop of that phase.
The shipped fights list the body in every phase; a body that is left out of a phase simply freezes there. Moves with Phase Begin use the phase's position, so check them after you reorder phases.
7. Telegraphs with On Step Started
Every attack loop announces a step just before it runs: On Step Started with Kind, Shot, Lane and Lead Time (how many seconds until the attack lands: a lane shot's warning time, a missile's flight delay, a salvo's fall time, a drop's shake plus hold). The body listens to it for Step Started moves; you can listen yourself:
- Select a boss attack loop in the level.
- Details > Events > + next to On Step Started (or in the Level Blueprint, drag the loop and choose Assign On Step Started).
- Use
Lead Timefor your own flash, sound or camera shake.
Missile launch points: give a part Launch Points, then add the body to the Missile Rain actor's Launchers (category Missiles). The Missile Rain's Launch Point Tag must equal the body's Launch Point Tag (Boss category; both default to MissileLaunch). Missiles fly out of these points in turn, with Launch Delay between them.
Boss target: ACorridorBossTarget has Arrival Radius: a spun enemy ends its flight at that distance from the point, so it lands on the boss's shell instead of inside it.
8. Sound per move
Each move has an Sfx field: the theme sound key played when the move starts (after Delay). The shipped bosses use BossServo, BossServoFast, BossTelegraph, BossSpinUp, BossPartEject and BossDefeat. Idle and Track Hero moves have none. Keys, volume and replacing a sound: see SOUND.md.
9. Check your boss
- Turn on Log Hooks on the body and play: the Output Log (category
LogCorridor) printsBossBody <name> t=... <trigger> -> part=.. move=..for every move. Use it to see which move fired and when. - Die on purpose in a late phase: after the respawn every part must be in the state of that checkpoint.
- Check the camera: the boss and the hero should both be in frame (README section 4, Cameras; the shipped boss maps use one camera view that slides and looks between boss and hero).
Common problems
- A part does not move: its move's trigger never fires. Check the phase, the attack kind and Enable Actors; read the hook log.
- A child part floats: Parent has a typo (it must equal the other part's Name).
- A part is in the wrong place after editing in Blueprint: edit the array again or recompile; parts are rebuilt by the construction script.
- The boss does not come back after a death: the body must be in Enable Actors of the phase you restart in.