-
Notifications
You must be signed in to change notification settings - Fork 45
Tutorial: Enemies
EarthBound wouldn't be the same if it was deprived of its all of its unique enemies; fortunately, CoilSnake gives you a great degree of control over each and every one of them. From crows to Giygas, you can modify them to your heart's content... as long as Giygas is... H... A... P... P... Y...
List of files used:
BattleSprites/enemy_configuration_table.ymlenemy_groups.ymlmap_enemy_groups.yml
Anyone playing EarthBound must have noticed that the enemies you see in battle sometimes look nothing like what they look like on the world map. That's because they're drawn using completely different sprites, which can be found in the BattleSprites/ directory, where they are classified by the number which identifies them. You can edit these sprites using one of the programs suggested in the introduction of this manual.
It stands to reason that enemies should have some of the most detailed property blocks of any object in EarthBound, and CoilSnake being very reasonable, there is much to configure with enemies in enemy_configuration_table.yml. Each number in the file references a sprite number in the BattleSprites/ directory. Each block is a whopping 47 lines long – that's a lot of properties, so let's look them over as always. As an example, we'll use the Armored Frog, ID 3:
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: 2Ye gods above! Let's examine that methodically.
-
'"The" Flag'- Sets whether the game should display a "the" before the enemy's name (true) or not (false) when appropriate. -
Action 1,Action 2,Action 3,Action 4- Indicate the action inbattle_action_table.ymlto execute; 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. The associatedArgumentspecifies 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 Argumentbeing 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- Can be set either tofalseto indicate a normal enemy ortrueto indicate a boss (which means you won't be able to run away from it). -
Death Sound- Can either benormalfor normal enemies orbossfor bosses (which will make any other enemies in the battle disappear upon defeat of the boss).Boss Flagdoes not need to be set for this, however. -
Death Text Pointer- Indicates the location of the text to display once the enemy has been defeated. -
Encounter Text Pointer- Indicates the location of the text to display once the enemy has been encountered. -
Defense,Guts,HP,Level,Luck,Offense,PPandSpeed- Represents the enemy's statistic levels, much like the player's levels.Levelitself is used to determine whether the enemy should run away on sight or not. -
Experience points- Specifies the amount of experience which should be split between party members upon defeat of the enemy. -
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- Used to tell EarthBound how the text should reference the enemy (as amale,female, orneutralbeing). -
Initial Status- The status the enemy should initially be affected with:normal,asleep,cannot concentrate,feeling strange,psi shield alpha,psi shield beta,shield alpha, orshield beta, each state being rather self-descriptive. -
Item Dropped- Points to the item from item_configuration_table.yml, if any, using its ID. -
Item Rarity- If anItem Droppedis provided, its rarity must be specified here, which can take be either1/128,2/128,4/128,8/128,16/128,32/128,64/128, or128/128. -
Max Call- References the maximal number of enemies that can be called by the current enemy if it calls for help. -
Mirror Success Rate- Represents the chance that Poo's Mirror ability will succeed using a percentage (despite the absence of a % sign). -
Miss Rate- The chance that the enemy will miss its attack upon the player character, with0being "always hit" and16being "always miss". -
Money- The amount of money the enemy will drop upon being defeated. -
Movement pattern- Specifies the type of movement to use on the world map. -
Music- The musical piece which should play during the battle, assuming this enemy is the one encountered on the world map. -
Name- Unsurprisingly, the name of the enemy. -
Overworld Sprite- Indicates the sprite group fromSpriteGroups/to use on the world map, referenced by its ID. -
Row- Indicates the row the enemy should appear in when the battle begins. -
Run Flag- Specifies whether the player should be able to run from the enemy (true) or not (false). -
Type- Describes the kind of enemy the player characters are faced with: is it anormalenemy? Is it made ofmetal? Is it aninsect?
And finally, there is an additional Unknown property for each enemy. Will you be the first to discover
what it does?
Also, if you require additional data regarding the Enemies, their configurations and what each one does, please be sure to check out the page entry at Data Crystal about the very own Enemy Configuration Table page.
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 1andBackground 2- Specify two possible animated background to layer when the battle begins, 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 unsetorrun 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.
Note: The ID of the enemy group determines whether or not the party's sprites will flash and briefly become invincible after the conclusion of the battle. If the ID is less than 448 then the party will flash, otherwise they won't.
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: 8This syntax should look pretty familiar to you by now.
-
Event Flag- The flag which, when set, specifies thatSub-Group 2should be used; when unset,Sub-Group 1will be used. -
Sub-Group 1andSub-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.
That was quite a bit of information, but at least you now know that your enemies are fully configurable. So, will you come up with the next Giygas?
- Overworld Sprites
- Battle Backgrounds
- Battle Sprites
- Title Screen
- Window Graphics
- Logos
- Fonts
- Layer 3 Animations
- Expand PSI Animations
- Swirls
- NPCs
- CCScript
- CCScript Command Documentation
- Event Flags
- Playable Characters
- Temporary Party Members
- PSI Abilities