A boss is a powerful enemy that the player usually fights at the end of a zone. In SRB2, the third act of each zone (e.g. Greenflower Zone Act 3) generally features Eggman as a boss. Nearly all the official bosses take eight hits to defeat, and will usually make an Egg Capsule appear in the map upon being defeated. Many custom level packs follow this format. However, SRB2 currently includes only six unique bosses: Egg Mobile, Egg Slimer, Sea Egg, Eggscalibur, Metal Sonic and Brak Eggman. For this reason, people may want to create their own custom bosses to avoid using the standard SRB2 bosses frequently. This article provides information that may be useful when creating a custom boss.
Bosses in SRB2
SRB2 currently contains six bosses, plus an old scrapped boss that can still be used in custom maps:
- Thing type 200: Egg Mobile
- Thing type 201: Egg Slimer
- Thing type 202: Sea Egg
- Thing type 203: Eggscalibur
- Thing type 206: Brak Eggman (Old)
- Thing type 208: Metal Sonic (Battle)
- Thing type 209: Brak Eggman
The third act of each zone consists of a fight against one of these bosses. The player has to avoid their attacks and try to damage them through some kind of weak spot. After five hits, the boss will enter its pinch phase or panic mode and switch to a different attack pattern. After three more hits, it will be defeated and flee, usually leaving behind an Egg Capsule that the player can open to release trapped animals and end the level.
Brak Eggman is the only official boss that takes more than eight hits to defeat.
Of the six functional bosses in SRB2, the Egg Mobile and Brak Eggman are the only bosses that can simply be placed on a map and will function as intended. The Egg Slimer additionally needs an Axis on the map that it can rotate around. Metal Sonic (Battle) requires Metal Sonic Gather Points to be placed on the map in order to use his energy ball attacks. The gather points also determine where Metal Sonic gathers energy balls from for these attacks. Both the Sea Egg and Brak Eggman (Old) need waypoints to guide their movement through the level. See the Boss Waypoint article for a guide on how to set these up. All bosses except Brak Eggman will rise to the level's ceiling upon being defeated; however, a Boss Escape Point can be placed on the map or outside its boundaries for the boss to flee to instead.
For all bosses, there are two ways to make them end the level: Checking the Ambush flag on boss Thing will cause the level to end immediately after defeating the boss. More commonly, an Egg Capsule will be placed on the map that rises after the boss is defeated and allows the player to end the level. See the Egg Capsule tutorial for an explanation of how to set this up. All bosses in SRB2's official levels raise an Egg Capsule when defeated, with the exception of Brak Eggman in Egg Rock Core Zone, who ends the level immediately after being defeated instead.
Custom bosses can be created through use of SOC and/or Lua. For a custom Object to become a boss, it needs to have the
MF_BOSS flag checked. This will allow the Object to have a boss thinker – most of the official bosses are given specialised thinkers for themselves to use only, but custom bosses by default are given a relatively blank thinker (see feature list below) allowing for more freedom to modify its behavior via SOC than in previous versions of SRB2. (Previously, all custom bosses would automatically run
A_Boss1Chase whenever they were in their
SpawnState, effectively forcing them to be clones of the Egg Mobile.)
Default features given for custom boss Objects:
- If the current state is about to go to
MF2_FRETis removed from the Object's flags; this disables the temporary invincibility given when the boss is damaged.
- If the Object's current target isn't damageable or doesn't exist, it will find a new player to target and play the sound determined by
SeeSoundif one is found. However, if the boss has been defeated, the sound played is instead determined by
- If the Object's state is currently
MissileState, the Object will automatically face its target. This will not occur if the boss's health is at the value of
Other points to consider when making a custom boss:
- By default when a boss is damaged, the custom boss is given
MF2_FRET, giving it temporary invincibility and makes the boss flash. If the default custom boss thinker is being overwritten by Lua, the new one should at some point remove
MF2_FRETso the boss can be damaged by the player.
- Most bosses include special attacks or behavior only for pinch phase or panic mode, typically given when the boss's health has been reduced to the value of
Damageor lower. Custom bosses do not alter their behavior much for pinch phase by default, allowing for freedom to choose what to do during this phase of the boss battle.
- Some of the official bosses alter their behavior gradually as they lose health, such as increasing their speed or changing their selection of attacks, regardless of whether they are in pinch phase or not. This is not actually required for custom bosses, though if added correctly can add to a player's experience of the boss battle.
- When a boss Object is defeated, it will go into its
DeathStateand the player who defeated it will receive a score of 1000 points (Brak Eggman (Old) awards 1000 points to all players in the map). However, the action
A_BossDeathis needed for the boss to do anything after dying, such as raising the capsule or fleeing. (See the article for
A_BossDeathfor more information).
The majority of the Object properties have some form of use for a boss Object – the uses for each of these are detailed here:
SpawnState: The boss's spawnstate. This is typically used to remove
MF2_FRET, removing the temporary invincibility given after being damaged.
PainState: The boss goes to this state if it has been hit and still has health points left.
A_Boss1Chaseis used, the boss calls either this or
MissileStatewhen it is ready to attack (except in pinch phase).
A_Boss1Chaseis used, the boss calls either this or
MeleeStatewhen it is ready to attack (except in pinch phase).
DeathState: The boss goes to this state if it has no health left. Most bosses call
A_BossScreamin this state and onwards to spawn explosions, with
A_BossDeathbeing used to finish the death sequence.
A_BossDeathis used, the boss will go into this state while fleeing (except in Mario mode).
A_Boss1Chaseis used when the boss is in pinch phase, it will call this state when it is ready to attack.
SeeSound: When the boss spots a player, this sound is played.
A_BossScreamis used, this sound is played to accompany the spawned explosions.
A_SkullAttackis used, this is used as the dashing sound.
SpawnHealth: Sets the boss's initial health points. Most bosses set this to 8, although Brak Eggman sets this to 12.
ReactionTime: Sets the boss's initial reaction time, which for
A_Boss1Chasecontrols how long it takes for the boss to execute an attack. While chasing the player, the boss will continually decrease its reaction time until it hits 0, after which it will use an attack. After this the boss's reaction time will be reset to this value for the next attack.
Speed: Actions such as
A_Boss2Chaseuse this to set the speed at which the boss chases the player.
Mass: Sets the number of the sound to be played when the boss is defeated and flees.
Damage: Used by most boss thinkers to determine the starting number of health points left to use the boss's pinch phase behavior at; e.g.
A_Boss1Chaseuses this to start using
RaiseStatefor its attacks instead of
MissileState. Most bosses set this to 3.
- See also: Actions#Boss thinkers
There are a large number of actions that are either designed to be used by bosses or behave differently from their normal behavior when used by bosses. These are listed here:
These actions are general-purpose actions, or are used by multiple of the bosses included in SRB2:
A_BossJetFume: Can be used to spawn Egg Mobile-style jet fumes, a Sea Egg-style propeller, a Metal Sonic-style jet fume, or an Eggscalibur-style jet flame. This action should only be used once if used at all, as every use of it will spawn new jet fumes; this is best done when the boss is first spawned.
A_BossFireShot: A specialized firing attack that allows the Egg Mobile (in previous versions of SRB2) and the Sea Egg to fire missiles from specific positions relative to themselves. This is rarely useful for custom bosses unless they have the same proportions as the Egg Mobile or the Sea Egg.
A_SkullAttack: A standard dashing attack; however, exclusively to the Egg Mobile and custom bosses, this will spawn a ghost trail of the boss. It is also used as part of the Egg Mobile's pain animation, making the boss fly away from the player before they have a chance to hit it again. Only the Egg Mobile can actually dash straight through the player, however; any other Object will stop as soon as they collide with another Object.
A_BossZoom: An action similarly built to
A_SkullAttack, with a controllable speed but without options to modify flight direction – this was an action originally intended for the Egg Mobile, but was never used.
A_SuperFireShot: These actions work the same as they would for normal Objects, except that the reaction time will remain unchanged – this is so the boss thinker can handle the reaction time itself directly.
A_BossScream: When a boss is defeated, this action may be used to spawn explosions around the boss during a death animation – all of the bosses included in SRB2, except for Brak Eggman and Brak Eggman (Old) use this.
A_BossDeath: A specialized action for boss post-death behavior that, by default, makes bosses fly to the nearest Boss Escape Point (or upwards if none are found), raise the Egg Capsule (using sector tags 680–682) and switch to their
XDeathStatefor fleeing. This behavior differs for some bosses, and can even be customised using the BossDeath Lua hook. If the boss has the flag
MF2_BOSSNOTRAPchecked (which can be set by checking the Special flag on the boss's map Thing), the boss will automatically end the level instead of raising the Egg Capsule. Note that when there are other bosses still alive on the map, the boss will not raise the Egg Capsule nor end the level, but will still flee.
These actions are largely specialised to be used by these bosses only, though in some cases can be freely used for custom boss behavior:
- Egg Mobile
A_Boss1Chase: The basic chasing behavior and thinker used by the Egg Mobile. Also includes the ability to select an attack from
RaiseStatedepending on the situation (see article for more details).
A_Boss1Laser: The Egg Mobile's laser attack thinker – when used,
MF2_FIRINGis turned on and the action is made to call itself again for the rest of the current state's duration.
A_FocusTarget: Used by the Egg Mobile's laser to move towards the target player.
A_Boss1Spikeballs: Used to spawn each of the Egg Mobile's spikeballs (once per use of the action) during pinch phase.
- Egg Slimer
A_Boss2Chase: Egg Slimer's main thinker, for moving in a circle around an Axis and spraying goop around itself.
A_Boss2Pogo: Egg Slimer's pinch phase thinker, for pogoing around spraying goop around itself.
A_Boss2PogoSFX: Old pogoing thrust behavior used by the Egg Slimer in previous versions of SRB2.
A_Boss2PogoTarget: New pogoing thrust behavior used by the Egg Slimer from Version 2.1 onwards.
A_Boss2TakeDamage: Egg Slimer-specific pain-invincibility handler; prevents the boss from being damaged again for a limited time.
- Sea Egg
- Brak Eggman (Old)
- Brak Eggman
Apart from the
MF_BOSS flag itself,
MF_SHOOTABLE are generally also needed to be checked for boss Objects;
MF_SPECIAL enables the player to harm the boss or be harmed themselves by touching the boss, and
MF_SHOOTABLE allows the boss to be harmed/killed by something, whether or not it is the player.
A number of other flags may be given to a boss Object by one of the various actions associated with it:
MF_NOCLIPHEIGHT: The default behavior of
A_BossDeathgives these flags to the boss, to allow itself to fly out of the level boundaries when fleeing.
MF2_BOSSFLEE: The default behavior of
A_BossDeathalso gives this flag to the boss if there is a Boss Escape Point to flee to. This flag allows the boss to fly in the direction of its target Boss Escape Point.
MF2_BOSSNOTRAP: If the boss's map Thing has the Special flag set, this flag is given to the boss. If it is set,
A_BossDeathwill end the level automatically instead of raising an Egg Capsule.
MF2_FRET: Given to bosses when they have been hurt – this flag stops the player from being able to harm the boss and makes all black (palette color #31) in the boss's sprite flash white to signify it has been hit. For Metal Sonic a dark blue (palette color #239) is the flashing color, and for Brak Eggman the whole sprite flashes white. This flag is automatically removed when returning to the
MF2_JUSTATTACKED: This flag is given by
A_Boss1Chasewhen the boss uses any of its attacks. This prevents the use of an attack for the next usage of
A_Boss1Chase, instead sending the boss in a new direction.
MF2_SKULLFLY: When a boss uses
A_SkullAttack, it is given this flag, which in turn allows it to spawn ghosts of itself.
|General||Enemy • Boss • Pushable • Spring • Monitor • NiGHTS power-up • Projectile • Ambient sound effect|
|Special||Player • Shields • Freed animals • Emblem • Overlay|
|Related links||List of Object types|