Author: JeMaCheHi, HobbitDur, Nihil

Scene.out contains all the data for each encounter in the game, this includes enemy IDs, positions, flags and more.

See the corresponding thread: http://forums.qhimm.com/index.php?topic=15816.0

File Structure

Scene.out contains no header. It is a raw list of 1024 encounters. Each encounter block consists of 128 bytes and has the following structure:

Offset Length Description
0x00 1 Battle Stage ID (See .x files)
0x01 1 Battle flags
0x02 1 Main camera data (the upper nibble is the camera’s ID, the lower nibble is the animation ID)
0x03 1 Secondary camera data (the upper nibble is the camera’s ID, the lower nibble is the animation ID)
0x04 1 “NOT Visible” enemy flags
0x05 1 “Not Loaded” enemy flags
0x06 1 “NOT Targetable” enemy flags
0x07 1 “Enabled” enemy flags
0x08 48 Enemy coordinates, 6 bytes per monster (2 bytes each for X, Y, and Z positions)
0x38 8 Enemy IDs (used for c0mxxx.dat files) + 0x10, 1 byte per monster
0x40 16 Unknown 1
0x50 16 Unknown 2
0x60 16 Unknown 3
0x70 8 Unknown 4
0x78 8 Enemy levels

Enemy Flags

Enemy flags are one byte each, and each bit determines whether a specific monster’s flag is on or off, starting from the leftmost bit (MSB) for Monster 1, down to the rightmost bit (LSB) for Monster 8.

Flag value Monster
0x80 Monster 1
0x40 Monster 2
0x20 Monster 3
0x10 Monster 4
0x08 Monster 5
0x04 Monster 6
0x02 Monster 7
0x01 Monster 8

NOT Visible stops the monster from rendering.
NOT Targetable removes the monster from the list of targetable enemies.
NOT Loaded means the monster’s AI isn’t being evaluated.
Enabled needs to be true for the monster to exist in the fight, even if it’s not tagged as NOT Visible or NOT Loaded, it won’t appear or do anything until it’s Enabled.

Battle flags

Similarly to enemy flags, it’s a byte and each bit determines whether a specific flag is on or off.

Flag value Name Description
0x01 Disable Escape Prevents escaping, AI opcode re-enable escaping
0x02 Disable Victory Fanfare Disables the fanfare
0x04 Show Timer Shows active timer
0x08 Disable EXP Gain Prevents EXP from being gained
0x10 Disable Post-Battle Screen Doesn’t show the post-battle screens
0x20 Surprise Attack Monster’s ATBs start full
0x40 Back Attack Monster’s ATBs start full + all party members afflicted with Back Attack
0x80 Force Standard Battle Normal ATB starting positions for everyone

Unknowns

Unknown 1, 2, and 3 each contain 2 bytes per monster, making them 16 bytes long (8 monsters * 2 bytes).
Unknown 4 contains 1 byte per monster, for a total of 8 bytes.

The data is laid out sequentially, from Monster 1 through Monster 8, and each monster has its own set of values, though some values are shared between monsters.
It appears that the game doesn’t read these fields’ data, suggesting they may be remnants of a scrapped feature.

Enemy level

Each enemy level is 1 byte.
By default, the enemy level is determined by the average level of the current team team level, and the game adds or substracts team level / 5.

  • Numbers from 0 to 100 are fixed levels N +- (N / 5).
  • From 101 to 200 are max levels fixed min(team level +- (team level / 5), N)
  • From 201 to 250 are added values team level + (N - 200) +- ((team level + (N - 200)) / 5)
  • 251 is level between 1 to 65, but the game exceptionnaly doesn’t divide the result by +-5, it adds or substracts a random value between 0 and 3 min(team level +- rand(0, 3), 65)
  • 252 is completely random rand(1, 100)
  • 253 is not used in the game, but the formula is random with a constraint rand(1, team level +- (team level / 5))
  • 254 is the average team level, period, no division per 5 team level
  • 255 is the standard formula team level +- (team level / 5)

Notes

No more than 4 enemies can be Enabled at any given time.
Using a value lower than 0x10 for an enemy ID will crash the game on battle start, as the first 16 IDs are reserved for playable characters.