-
Notifications
You must be signed in to change notification settings - Fork 37
Tutorial: Enemies
List of files used:
BattleSprites/
enemy_configuration_table.yml
enemy_groups.yml
map_enemy_groups.yml
The enemies' in-battle sprites can be found in the BattleSprites/
directory. The filenames correspond with the numbers that identify them. You can change the color palette to any 15 colors, plus one color the game will use as transparency.
Here's an example entry from enemy_configuration_table.yml
:
3:
'"The" Flag': 'true'
Action 1: 4
Action 1 Argument: 0
Action 2: 4
Action 2 Argument: 0
Action 3: 4
Action 3 Argument: 0
Action 4: 95
Action 4 Argument: 0
Action Order: 0
Boss Flag: 'false'
Death Sound: normal
Death Text Pointer: $ef6d96
Defense: 108
Encounter Text Pointer: $ef78b8
Experience points: 1566
Final Action: 0
Final Action Argument: 0
Fire vulnerability: 100%
Flash vulnerability: 70%
Freeze vulnerability: 100%
Gender: neutral
Guts: 5
HP: 202
Hypnosis/Brainshock vulnerability: 50%
Initial Status: normal
Item Dropped: 7
Item Rarity: 16/128
Level: 22
Luck: 8
Max Call: 0
Mirror Success Rate: 50
Miss Rate: 1
Money: 77
Movement pattern: 21
Music: 98
Name: Armored Frog
Offense: 37
Overworld Sprite: 280
PP: 0
Paralysis vulnerability: 50%
Row: 1
Run Flag: 'true'
Speed: 7
Type: normal
Unknown: 2
Ye gods above! Let's examine that methodically.
-
"The" Flag
- Whether or not the game should display a "the" before the enemy's name:true
orfalse
-
Action 1
,Action 2
,Action 3
,Action 4
- Actions frombattle_action_table.yml
- please note that when an enemy is executing this action, the party in the battle action entries means the enemy group, whereas enemy indicates the player characters. A list of action IDs can be found here (this list is incomplete). The associatedArgument
specifies an option to be passed to the action, which has a different meaning depending on the action (it could be an item number, or an enemy number if the enemy is calling for help). -
Final Action
- Indicates an action to be executed by the enemy once it has been defeated,Final Action Argument
being its argument. -
Action Order
- Provides the order used by the enemy to run through each action:-
0
- random order, -
1
- random order where action 1 is favored with a 50% chance, then action 2 with a 25% chance, then actions 3 and 4, each with a 12.5% chance, -
2
- cycles through each action in order, -
3
: staggered order, which gives a 50% chance of choosing either action 1 or 2 the first turn, then a 50% chance of choosing either action 3 or 4 the next turn, and then it repeats.
-
-
Boss Flag
- Setting this totrue
makes it so you can't run away from fights including this enemy. Please note that this flag does not control whether or not you get the boss swirl - Enemy groups 448 and above all have boss swirls. The rest of them are all normal. -
Death Sound
- Possible values:normal
orboss
. When set to 'boss' it plays the doubled sound, and also killing this enemy kills all other enemies in the fight. -
Death Text Pointer
- The text to display when the enemy is defeated. For example, newEnemyStuff.FirstBossDeath points to a text block called "FirstBossDeath" in "newEnemyStuff.ccs", a CCScript file you might want to create. -
Encounter Text Pointer
- Indicates the location of the text to display once the enemy has been encountered. The format is the same as above. -
Defense
,Guts
,HP
,Level
,Luck
,Offense
,PP
andSpeed
- Represents the enemy's statistic levels, much like the player's levels.Level
itself is used to determine whether the enemy should run away on sight or not. -
Experience points
- How many experience points the enemy is worth -
Fire
/Flash
/Freeze
/Hypnosis
/Brainshock
/Paralysis vulnerability
- Describes how the enemy should be affected by specified attack or effect: if it is an attack, the percentage represents the damage that should be dealt to the enemy instead of the one it would normally receive; if it is a status effect, it is the chance that the effect will succeed. -
Gender
- Controls how the enemy will be referred to in the battle text:male
,female
, orneutral
-
Initial Status
- Use this if you want the enemy to have a status affect at the start of the battle. Possible values:normal
,asleep
,cannot concentrate
,feeling strange
,psi shield alpha
,psi shield beta
,shield alpha
, andshield beta
-
Item Dropped
- Put an item number (fromitem_configuration_table.yml
) here -
Item Rarity
- Possible values:1/128
,2/128
,4/128
,8/128
,16/128
,32/128
,64/128
, or128/128
-
Max Call
- The maximum number of enemies that can answer this enemy's calls for help -
Mirror Success Rate
- The percentage that Poo's Mirror ability will succeed with this enemy (this value has no % percent sign in front of it) -
Miss Rate
- How accurate the enemy will be at attacking the party. Possible values:0
for "always hit" through16
for "always miss" -
Money
- How much money the enemy drops upon defeat -
Movement pattern
- The movement pattern this enemy should use on the world map -
Music
- Which song gets used for battle music (see EBMusEd's BGM list for which song ID number to use) -
Name
- Unsurprisingly, the name of the enemy. -
Overworld Sprite
- Which sprite group to use for this enemy on the world map. The ID number to use here corresponds with the filenames of the images inSpriteGroups/
-
Row
- The row the enemy should appear in when the battle begins -
Run Flag
- Controls what types of terrain this enemy can be spawned on when randomly appearing. Earthbound doesn't actually make use of this, and it might not work very well if you try (just leave it to true). CoilSnake has this somewhat mislabeled; "unknown" is "cannot spawn on water tiles" and "true" is "can spawn on any tile". It's actually a bit field: start with 0, add 1 for "can spawn on water", add 2 for "can spawn on hazard tiles", and 4 for "can spawn on normal ground." -
Type
- Possible values:normal
,metal
, andinsect
-
Unknown
- This possibly has something to do with the enemy's IQ stat, but we don't know if it ever gets used for anything
See also: the Enemy Configuration Table page on DataCrystal, and the enemy_data
structure in ebsrc.
The groups of enemies encountered in battle are described in enemy_groups.yml
, and allow you to control what types of enemies should be available in one group initially, what backgrounds should be displayed (see below for configuring these), and more. For example, let's take the group that makes up the Titanic Ant boss:
450:
Background 1: 170
Background 2: 169
Enemies:
- {Amount: 1, Enemy: 37}
- {Amount: 2, Enemy: 209}
Fear event flag: 0
Fear mode: run away if flag is unset
Letterbox Size: 0
-
Background 1
andBackground 2
- Two battle backgrounds, as defined inbg_data_table.yml
. If only one is specified, it should have a color depth of 4; if two are specified, they should have color depths of 2. -
Enemies
- a list of enemies to add to the enemy group, with the following format:{Amount: number_of_enemies, Enemy: ID_of_enemy}
, where the ID references the IDs ofenemy_configuration_table.yml
. -
Fear event flag
- Specifies the flag which will determine the enemy group's fleeing behavior, as set with the next property. -
Fear mode
- Describes the way the enemy group will behave according to the specified flag; it can either berun away if flag is unset
orrun away if flag is set
. -
Letterbox Size
- Indicates the size of the black bars at the top and bottom of the screen when entering battle mode; it can go from 0 to 3.
There are two properties that are controlled by the ID of the enemy group itself, instead of having a field in the table for them. These are:
- All enemy groups less than 448 will make the party flash in the overworld and be temporarily invincible after winning.
- All enemy groups with numbers 448 and above will have the boss battle swirl
If you want to change this cutoff point, and move it to earlier or later group numbers, use this simple ASM patch (Thanks Messianic!):
//Moving Boss Swirl to battle group X instead of 448
ROM[0xC25FC9] = CMP_i(0x##)
ROM[0xC2E94E] = CMP_i(0x##)
However, defining the enemy groups is insufficient for them to be used; you also need to specify how they should be handled on the map in map_enemy_groups.yml
; you can later use these definitions in the EB Project Editor. Each map group is divided into two sub-groups, the first to be used before the flag is set, the second used after the flag is set. Each sub-group randomly selects an enemy group to present to the player. For example, here is the definition for one of the groups found early on in Onett, initially made up of Spiteful Crows, later on made up of Starmen and Evil Eyes:
1:
Event Flag: 0x84
Sub-Group 1:
0: {Enemy Group: 1, Probability: 2}
1: {Enemy Group: 2, Probability: 3}
2: {Enemy Group: 3, Probability: 3}
Sub-Group 1 Rate: 5
Sub-Group 2:
0: {Enemy Group: 4, Probability: 2}
1: {Enemy Group: 5, Probability: 2}
2: {Enemy Group: 6, Probability: 2}
3: {Enemy Group: 7, Probability: 2}
Sub-Group 2 Rate: 8
This syntax should look pretty familiar to you by now.
-
Event Flag
- The flag which, when set, specifies thatSub-Group 2
should be used; when unset,Sub-Group 1
will be used. -
Sub-Group 1
andSub-Group 2
- List the enemy groups which could be selected randomly (using itsProbability
), specified by their ID fromenemy_groups.yml
. The probabilities in each sub-group must add up to 8. -
Sub-Group 1
/2 Rate
- Specifies the chance, expressed as a percentage without the percentage sign, that a group will spawn.
- Overworld Sprites
- Battle Backgrounds
- Battle Sprites
- Title Screen
- Window Graphics
- Logos
- Fonts
- Animations
- Swirls
- EB Project Editor
- Tile Data
- Tile Editor
- Collision Data
- Adding Map Palettes
- Map Editor
- Doors
- Warp Styles
- Enemy Placement
- Hotspots