Difference between revisions of "Encounter (.ECT) File Format"

From Ōkami Speedrun Wiki
Jump to navigation Jump to search
(Adding Encounter (ECT) definition.)
 
m (Formatting.)
 
Line 23: Line 23:
! Start (Byte) !! Width (Bytes) !! Type !! Field Name !! Note
! Start (Byte) !! Width (Bytes) !! Type !! Field Name !! Note
|-
|-
| 0 || 6 || PackedTuple\<uint16\> || coordinates || Location of encounter (x, y, z).
| 0 || 6 || PackedTuple<uint16> || coordinates || Location of encounter (x, y, z).
|-
|-
| 6 || 1 || uint8 || unknown1 || Unknown.
| 6 || 1 || uint8 || unknown1 || Unknown.
Line 107: Line 107:
| 1 || 1 || uint8 || cat_id || Category ID: 02 is enemies
| 1 || 1 || uint8 || cat_id || Category ID: 02 is enemies
|-
|-
| 2 || 6 || uint8\[6\] || unknowns || Unknown.
| 2 || 6 || uint8[6] || unknowns || Unknown.
|-
|-
| 8 || 1 || uint8 || total || Total count of this enemy in this encounter.
| 8 || 1 || uint8 || total || Total count of this enemy in this encounter.

Latest revision as of 03:47, 22 November 2022

Note: This page pertains to Reverse Engineering of Okami.

Explanation

This file defines each encounter on a single map.

File Format

Overall

Start (Byte) Width (Bytes) Type Field Name Note
0 4 uint32 Number of Entries Count of encounter definitions
4 ECTEntry array groups Encounter definition
padding 00 Pad zeroes for 4 byte alignment

ECTEntry

Describes a single encounter.

Start (Byte) Width (Bytes) Type Field Name Note
0 6 PackedTuple<uint16> coordinates Location of encounter (x, y, z).
6 1 uint8 unknown1 Unknown.
7 1 uint8 escape_radius How far from the center of the arena to escape the encounter.
8 2 ECTEntryFlags (uint16) flags Bitfield of flags.
10 2 uint16 pad Always 00.
12 2 uint16 index Increasing, no dupes in file, some missing?
14 2 uint16 unknown3 Unknown.
16 4 uint32 pad2 Always 00.
20 96 EnemyEntry[4] enemy One for each enemy type in the encounter.
116 1 uint8 unknown4 Unknown.
117 1 uint8 unknown5 Unknown.
118 1 uint8 unknown6 Unknown.
119 1 uint8 unknownugh May affect triggering event? If you set the demon gate behind shinshu tree to 0, the bloom patch doesn't appear when you beat the gate.
120 1 uint8 unknown7 Unknown.
121 1 uint8 unknown8 Unknown.
122 1 uint8 unknown9 Unknown.
123 1 uint8 unknowna Unknown.
124 1 uint8 separate_waves 00 mix enemy types, 01 separate different enemy types to different waves.
125 7 uint8 array padding All 00.

ECTEntryFlags Format

Bit Field Name Note
0 always_set Seems to always be 1.
1 unknownb1o1 Unknown.
2 unknownb1o2 Unknown.
3 unknownb1o3 Unknown.
4 day_only Encounter only available during the day.
5 night_only Encounter only available at night.
6 inescapable Encounter cannot be escaped.
7 inescapable2 Encounter cannot be escaped. Only used for devil gates, most no-indicator fights, and 2 scrolls.
8 unrepeatable Encounter cannot be repeated.
9 unknownb2o1 Unknown.
a demon_scroll Encounter is represented by a demon scroll.
b devil_gate Encounter is represented by a devil gate.
c unknownb2o4 Unknown.
d unknownb2o5 Unknown.
e unknownb2o6 Unknown.
f unknownb2o7 Unknown.

EnemyEntry Format

Start (Byte) Width (Bytes) Type Field Name Note
0 1 uint8 enemy_id See Enemy ID Table.
1 1 uint8 cat_id Category ID: 02 is enemies
2 6 uint8[6] unknowns Unknown.
8 1 uint8 total Total count of this enemy in this encounter.
9 1 uint8 max_concurrent Maximum number of this enemy present at once.
10 1 uint8 unknown1 Unknown. Always 00. Maybe padding?
11 1 uint8 unknown2 Unknown.
12 12 uint8 array padding All 00.