Offset | Length | Description |
0x00 | 1 | Section 1: Battle scenario. The value here corresponds to the number in the a0stg???.x files (into battle.fs file). You have to convert it to hex |
0x01 | 1 | Section 2: Flags to configure some battle parameters and it works like 8 binary flags (see below) |
0x02 | 1 | Section 3: Main camera animation. This is for the battle entrance animation (when the party and the monsters appear). (See below about cameras) |
0x03 | 1 | Section 4: Secondary camera. Works exactly the same as the main camera, but this one will be used less frecuently.(See below about cameras) |
0x04 | 1 | Section 5: Hidden enemies. Hides an enemy for each bit in the byte. Also works like 8 binary flags. An activated flag means that this enemy is hidden (see below for "enemy flags") |
0x05 | 1 | Section 6: Not Loaded enemies. Show the enemies that are been actually fought. Loaded enemies will attack you. You can attack them, though. Also works like 8 flags. An activated flag means that this enemy is not loaded.(see below for "enemy flags") |
0x06 | 1 | Section 7: Not Targetable enemies. Show the enemies which will apear in the target window. Careful with this, if you put untargetable enemies battle will never end. Also, loaded enemies will attack you even if they are not targetable, so be careful again. Once more, this section works like 8 binary flags. An activated flag mean that this enemy is not targetable. (see "enemy switches" too) |
0x07 | 1 | Section 8: Enabled enemies. This section will specify which enemies will be loaded at the begining of the battle. Even if there's only 1 or 2 enemies, you can enable more enemies through enemy AI scripting(See this video to see what I mean). Also works like eight binary flags. An activated flag means that the enemy is enabled. If an enemy is not enabled, the 3 previous sections will be ignored. See below for enemy flags. |
0x08 | 48 | Section 9: Enemy coordinates. Its a set of 6x8 bytes which describes each enemy's coordinate in (x,y,z) format. So, first 6 bytes would be enemy 1's coords, next 6 enemy 2's ones, and so on. |
0x38 | 8 | Section 10: Enemies. Each byte represents an enemy. To know what enemy you're working with, you can check the c0m???.dat files in battle.fs. You just have to convert it to hex and add 0x10. Be careful, if you put numbers under 0x10 as enemies, battle will crash. |
0x40 | 16 | Section 11: Still under research.A certain enemy also has always the same value, and some of this values can be repeated between enemies. Slots with no enemies always have the value 0x00C81 |
0x50 | 16 | Section 12: Still under research. A certain enemy also has always the same value. Slots with no enemies always have the value 0x00C81 |
0x60 | 16 | Section 13: Still under research too. For a certain enemy has always the same value but different from section 12 and 13. Slots with no enemies always have the value 0xEA60 |
0x70 | 8 | Section 14: This is enemy relative, a certain enemy always have a certain value, e.g. Bite Bug always have 4B. There's only a few values used here: 38 91 0A 64 C8 2D 7B 4A 34 01 4B 02(when an enemy's not used), however setting it to any other value seems to do nothing. |
0x78 | 8 | Section 15: Enemy level. Each enemy level is 1 byte. Numbers from 0x0 to 0x64 are fixed levels up to 100. From 0x64 to 0xFF... Still don't know because it makes weird things... |
Every encounter is a fixed size? So the scripts are somewhere else. (maybe this isn't a surprise to you, I'm not caught up with what we know about FF8's battles)
I've already made a list of encounters (http://wiki.qhimm.com/view/FF8/Encounter_Codes). Dunno if it helps but it took me a long time to make and I don't want it to go to waste. (I skipped the last 100 because I assumed all of them would be dummies and/or really buggy)
I'll add your info to the wiki either tonight or tomorrow unless someone beats me to it. Good work!
By JeMaCheHi
Scene.out contains enemy placement data and flags for each of the game's battle encounters.
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:
{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
! style="background:rgb(204,204,204)" | Offset
! style="background:rgb(204,204,204)" | Length
! style="background:rgb(204,204,204)" | Description
|-
! align="left" | 0x00
| 1
| Battle scenario. The value here corresponds to the number in the a0stg???.x files (into battle.fs file). You have to convert it to hex
!-
| align="left" | 0x01
| 1
| Refers to some battle aspects and it works like 8 binary switches (see below)
!-
| align="left" | 0x02
| 1
| Still don't know, but I suspect that it has something to do with camera movement. If you set it to 0xFF camera will always be fixed
!-
| align="left" | 0x03
| 1
| unkonwn
!-
| align="left" | 0x04
| 1
| Visible enemies. Shows an enemy for each bit in the byte. (see below for "enemy switches")
!-
| align="left" | 0x05
| 1
| Loaded enemies. Show the enemies that are been actually fought. Loaded enemies will attack you.
!-
| align="left" | 0x06
| 1
| Targetable enemies. Show the enemies which will apear in the target window. Careful with this, if you put untargetable enemies battle will never end. (see "enemy switches" too)
!-
| align="left" | 0x07
| 1
| Number of enemies. Also works like eight binary switches. See below
!-
| align="left" | 0x08
| 48
| Enemy coordinates. Its a set of 6x8 bytes which describes each enemy's coordinate in (x,y,z) format. So, first 6 bytes would be enemy 1's coords, next 6 enemy 2's ones, and so on.
!-
| align="left" | 0x38
| 8
| Enemies. Each byte represents an enemy. To know what enemy you're working with, you can check the c0m???.dat files in battle.fs. You just have to convert it to hex and add 0x10. Be careful, if you put numbers under 0x10 as enemies, battle will crush.
!-
| align="left" | 0x40
| 16
| unknown
!-
| align="left" | 0x50
| 16
| Still under research, but this is usually the same as the previous field's value.
!-
| align="left" | 0x60
| 16
| unknown
!-
| align="left" | 0x70
| 8
| unknown
!-
| align="left" | 0x78
| 8
| Enemy level. Each enemy level is 1 byte. Numbers from 0x0 to 0x64 are fixed levels up to 100. From 0x64 to 0xFF... Still don't know because it makes weird things...
|}
==Notes==
Each 128block can have up to 8 enemies, but if more than 4 are shown at the same time, the game will crash. This could seem stupid, but it's not. If you think about some battles, like the final battle (where we have 8 enemies), all the monsters are present, but only one or two are shown at any given time. The rest appear through scripting.
Some byte fields are just 8 switches. Here's what I've found:
In 0x01:
*+0x80: Not random fight. Every scripted battle has this one enabled.
*+0x40: Setting this on will make that you will always be back attacked.
*+0x20: Setting this on will make that you will always be surprise attacked
*+0x10: Doesn't show exp screen at end.
*+0x08: If you set this one up not exp will be gained at the end of battle (like in boss battles)
*+0x04: Shows the timer. Like in dollet withdraw combats.
*+0x02: Can't figure it out. Some boss battles have it enabled but don't know its function
*+0x01: Can't escape.
In 0x04, 0x05, 0x06, and 0x07
*+0x80: 1st enemy relative
*+0x40: 2nd enemy relative
*+0x20: 3rd enemy relative
*+0x10: 4th enemy relative
*+0x08: 5th enemy relative
*+0x04: 6th enemy relative
*+0x02: 7th enemy relative
*+0x01: 8th enemy relative
An important note: If you put an enemy that "summons" another one (Ultimecia summoning Griever, Sphinxara summoning jelleye...) it will summon the enemy from certain slot. This means that if you put that enemy in another battle, it will still summon that slot, because (I think) that summoning is scripted in its AI (in c9m???.dat)
Ugh, more 403 errors. We've been having problems with the wiki. Hopefully when Qhimm's not too busy he'll check it out and see what's going on.
I'll just dump the wiki source here until me or someone else can edit the page.Code: [Select]By JeMaCheHi
Scene.out contains enemy placement data and flags for each of the game's battle encounters.
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:
{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
! style="background:rgb(204,204,204)" | Offset
! style="background:rgb(204,204,204)" | Length
! style="background:rgb(204,204,204)" | Description
|-
! align="left" | 0x00
| 1
| Battle scenario. The value here corresponds to the number in the a0stg???.x files (into battle.fs file). You have to convert it to hex
!-
| align="left" | 0x01
| 1
| Refers to some battle aspects and it works like 8 binary switches (see below)
!-
| align="left" | 0x02
| 1
| Still don't know, but I suspect that it has something to do with camera movement. If you set it to 0xFF camera will always be fixed
!-
| align="left" | 0x03
| 1
| unkonwn
!-
| align="left" | 0x04
| 1
| Visible enemies. Shows an enemy for each bit in the byte. (see below for "enemy switches")
!-
| align="left" | 0x05
| 1
| Loaded enemies. Show the enemies that are been actually fought. Loaded enemies will attack you.
!-
| align="left" | 0x06
| 1
| Targetable enemies. Show the enemies which will apear in the target window. Careful with this, if you put untargetable enemies battle will never end. (see "enemy switches" too)
!-
| align="left" | 0x07
| 1
| Number of enemies. Also works like eight binary switches. See below
!-
| align="left" | 0x08
| 48
| Enemy coordinates. Its a set of 6x8 bytes which describes each enemy's coordinate in (x,y,z) format. So, first 6 bytes would be enemy 1's coords, next 6 enemy 2's ones, and so on.
!-
| align="left" | 0x38
| 8
| Enemies. Each byte represents an enemy. To know what enemy you're working with, you can check the c0m???.dat files in battle.fs. You just have to convert it to hex and add 0x10. Be careful, if you put numbers under 0x10 as enemies, battle will crush.
!-
| align="left" | 0x40
| 16
| unknown
!-
| align="left" | 0x50
| 16
| Still under research, but this is usually the same as the previous field's value.
!-
| align="left" | 0x60
| 16
| unknown
!-
| align="left" | 0x70
| 8
| unknown
!-
| align="left" | 0x78
| 8
| Enemy level. Each enemy level is 1 byte. Numbers from 0x0 to 0x64 are fixed levels up to 100. From 0x64 to 0xFF... Still don't know because it makes weird things...
|}
==Notes==
Each 128block can have up to 8 enemies, but if more than 4 are shown at the same time, the game will crash. This could seem stupid, but it's not. If you think about some battles, like the final battle (where we have 8 enemies), all the monsters are present, but only one or two are shown at any given time. The rest appear through scripting.
Some byte fields are just 8 switches. Here's what I've found:
In 0x01:
*+128: Not random fight. Every scripted battle has this one enabled.
*+64: Setting this on will make that you will always be back attacked.
*+32: Setting this on will make that you will always be surprise attacked
*+16: Doesn't show exp screen at end.
*+8: If you set this one up not exp will be gained at the end of battle (like in boss battles)
*+4: Shows the timer. Like in dollet withdraw combats.
*+2: Can't figure it out. Some boss battles have it enabled but don't know its function
*+1: Can't escape.
In 0x04, 0x05, 0x06, and 0x07
*+128: 1st enemy relative
*+64: 2nd enemy relative
*+32: 3rd enemy relative
*+16: 4th enemy relative
*+8: 5th enemy relative
*+4: 6th enemy relative
*+2: 7th enemy relative
*+1: 8th enemy relative
An important note: If you put an enemy that "summons" another one (Ultimecia summoning Griever, Sphinxara summoning jelleye...) it will summon the enemy from certain slot. This means that if you put that enemy in another battle, it will still summon that slot, because (I think) that summoning is scripted in its AI (in c9m???.dat)
I don't understand... I'm almost positive I've called those battles from my debug room and they worked as expected.Did you put that battle in another situation in the game? I'm testing them in Balamb hotel room, just before going to the SeeD exam. And when I put that Garden Faculty battles, nothing happens.
All I know is that the game's event engine uses battle parameters before starting battles. Things like carrying over the field timer or music, forcing back attacks, etc. I don't look into memory to figure out where they're stored, though.
Is the same true for in-battle cutscenes, like when there's dialogue?
Here's the video showing some stuff as promised:
http://youtu.be/FqXjO18fYFU
This video is private. Mark it as public or unlisted.
EDIT: Working now. Looks freaking cool. Is the text box started when monster is defeated, or after dropping to some % of HP?
Very impressive video. The AI is opcodes just like the field files, right? I need to edit sounds into the battle scenes someday, and it looks like you're almost there.Thanks!
Well to answer the connection between scene.out and .x battlefields in game development aspect, if the scene.out file contains camera animations they are probably the winning animations for each character. It is waste of space to include the winning animations to each battlefield so they are in one file and it's in scene.out if there are no other files containing camera animations. This applies off course for every animations that are "global".
If they are not in scene.out then they may be in r0win.dat file. I'm really surprised if for some reason they are in battlefields, because that's just really bad optimizing especially for a game of this scale. Well I'm more than willing to help with these kind of things.
No, I'm pretty sure that the scene.out doesn't contain any camera animations, but pointers or indexes to those animations, which has to be in other files.
Maybe it's Odin related? Like this fight can or cannot be zantetsuken'ed.