Qhimm.com Forums

Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: JeMaCheHi on 2014-12-02 23:15:58

Title: [FFVIII] Scene.out research (Battle formations structure)
Post by: JeMaCheHi on 2014-12-02 23:15:58
Hi everyone!

I've been making a little research on FF8's scene.out file for the last few days, and wanted to share with you my findings. I will update the thread with any new info I get. Also, since any of this information is on the wiki, it would be cool if someone puts it in there (I think I cant).

First of all, I wanted to thank to random_npc, because I read on a post of him that scene.out contained enemy encounters and that they was stored in 128byte blocks, which was very helpful. From there, here are my findings:



Encounter Structure

As told you before, each 128byte block (from now on we'll simply call it "encounter"), has a defined structure. Each section from the 8th(included) refers to each one of the eight enemies defined. In other words, is divided in eight sub-blocks or "slots".

Here's what I have:

OffsetLengthDescription
0x001Section 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
0x011Section 2: Flags to configure some battle parameters and it works like 8 binary flags (see below)
0x021Section 3: Main camera animation.  This is for the battle entrance animation (when the party and the monsters appear). (See below about cameras)
0x031Section 4: Secondary camera. Works exactly the same as the main camera, but this one will be used less frecuently.(See below about cameras)
0x041Section 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")
0x051Section 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")
0x061Section 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)
0x071Section 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.
0x0848Section 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.
0x388Section 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.
0x4016Section 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
0x5016Section 12: Still under research. A certain enemy also has always the same value. Slots with no enemies always have the value 0x00C81
0x6016Section 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
0x708Section 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.
0x788Section 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...
1: 0xC8 is the code to target self in AI script code for enemies. I wonder if this has some kind of relationship... I'll keep searching.



About binary/enemy flags.

Sections 2, 5, 6, 7, and 8 works as binary flags. This means that each bit enables/disables something. When the bit is 1 it means the flag is enabled. When is 0, the flag is disabled. Since the 8 flags forms a Byte, I'll list in form of hex sums, from Most Significant Bit to Less Significant Bit:

For battle configuration (Section 2):
   +0x80: Not random fight. Every scripted battle has this one enabled.
   +0x40: Force back attack (you will be back attacked, not the enemy xD).
   +0x20: Force surprise attack (as before, you are the one 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 functionI'm stupid. This disables victory sequence.
   +0x01: Can't escape.

For Sections 5,6,7 and 8:
   +0x80: 1st enemy flag
   +0x40: 2nd enemy flag
   +0x20: 3rd enemy flag
   +0x10: 4th enemy flag
   +0x08: 5th enemy flag
   +0x04: 6th enemy flag
   +0x02: 7th enemy flag
   +0x01: 8th enemy flag



About cameras.

Each encounter has two cameras, as explained above. Each camera is represented by a byte, but each byte stores two things: The camera number, and the camera animation. The camera number is stored on the most significant nibble of the byte (4 bits) and the animation is stored on the less significant nibble of the byte. I called it "Camera number" because I had to name it somehow, but I'm not even sure if they're different cameras, or just are "sets" of animations. Anyway, we'll call it that way until we find a better one. Also, a few considerations about these camera parameters:





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 can confirm)  that summoning is scripted in its AI (in c9m???.dat) as an enemy ability.

I've also made a C++ class that stores a chosen encounter from the scene.out file. I've implemented a little command line program to see info and change some things, but since I don't know anything about GUI programming and interacting with a cli program will be pretty tedious, I think I'll stop developing it xD.

Well, I'll update this thread with my findngs. Also, any help will be appreciated :D

Update: Some pics to show up!

You can put any enemy you want:

(http://i.imgur.com/ZONfVnm.png)

(http://i.imgur.com/ZbVm6sL.png)

However, sometimes enemy palletes could crash. Also, you should be careful with certain enemies like GF's or bosses as Seifer because when killed, they won't dissapear, fade out, or run away.


Encounter list

A guy from gamefaqs called aladore384 made a pretty complete list of every encounter. Since it's very useful, I'll post it here. To edit a certain encounter in the scene.out, all you have to do is to get its encounter number, convert it to hex, and multiply it per 0x80, and you'll get the offset.
For example, lets say you want to edit Omega Weapon encounter:

Update July 2015
Sections are updated with my new findings, flag stuff are (I think) better exlained, and I started developing developed a GUI tool to modify the scene.out without all the hex pain.
Link to the tool thread: http://forums.qhimm.com/index.php?topic=16275.0
Title: Re: [FFVIII] Scene.out research
Post by: Shard on 2014-12-03 01:09:38
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!
Title: Re: [FFVIII] Scene.out research
Post by: JeMaCheHi on 2014-12-03 09:21:03
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!

Thanks Shard :D

And yes, I knew about that encounter list, I used it in field scripting some time ago, but didn't know you did it. Thanks for that one too  ;D
I found a more detailed list on gamefaqs (http://www.gamefaqs.com/boards/197343-/54721689), though. That guy posts a french and an english version.

And yes, every encounter has 128 byte size. The scriptings are in the enemy .dat files, as referred in its wiki article (http://wiki.qhimm.com/view/FF8/FileFormat_DAT#Section_8:_Battle_scripts.2FAI). I think this includes actions like summoning other enemies after death as told in the main post. I'm still clueless about the last 3 or 4 sections...
Title: Re: [FFVIII] Scene.out research
Post by: Shard on 2014-12-03 09:54:19
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:
*+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)
Title: Re: [FFVIII] Scene.out research
Post by: JeMaCheHi on 2014-12-03 10:30:59
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)

Thanks for your work Shard. Can I make a suggestion? I like how you did the binary switches explanation (sums instead numbering the bit), but since we are editing a binary file, don't you think it would be better to put "+0x80,+0x40....." instead "+128,+64..."? I'm just asking, you're the real professional here  ;D At least, I find it more confortable when it comes to sum. Actually, I've implemented it that way in my program...
Title: Re: [FFVIII] Scene.out research
Post by: Shard on 2014-12-03 11:05:38
That's a good point. I've been dealing decimal-based bitmasks A LOT lately so I'm used to dealing with the +2^n notation when talking about bits, but since it's a byte it should probably be in base 16.
Title: Re: [FFVIII] Scene.out research
Post by: JeMaCheHi on 2014-12-07 01:11:32
Hey Shard, take a look at this thread: http://forums.qhimm.com/index.php?topic=11137.msg165591#msg165591
There random_npc explains how AI script works in .dat files. I'm sure it's related with scene.out, specially when it comes to summoning other enemies.
Title: Re: [FFVIII] Scene.out research
Post by: JeMaCheHi on 2014-12-12 00:50:25
I found out that Scene.out only stores the initial status of an encounter. Altough not figured out everything, I'm almost sure that a battle takes some parameters from another place. I've been making some tests with special battles like the garden's ones, where you fight the monsters sent by Garden Faculty. If you just set that exactly battle anywhere else (by writing a script or whatever), the Garden Faculty won't talk and run away. Instead, he will remain in the battle. I tried to modify some parameters on the block but it seems like those events are controlled from another place. I think I'd need a little help here....
Title: Re: [FFVIII] Scene.out research
Post by: Shard on 2014-12-12 13:15:57
I don't understand... I'm almost positive I've called those battles from my debug room and they worked as expected.

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.
Title: Re: [FFVIII] Scene.out research
Post by: JeMaCheHi on 2014-12-12 20:57:45
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.

Quote
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.

Yes, you can set the bytes in Section 2 from this file with the OPCODES BATTLE and BATTLEMODE, with the stack. In fact, now that I'm thinking about it... There was in the wiki some incomplete values for that flags. Since its values are the same as here, you could complete them if you wish (I'd do it but I can't edit the wiki I think) By the way, the music can't be changed from Scene.out, and that's for sure.

I wonder what the file r0win.dat stores... do you know something about it? I don't know how to figure it out, the only reverse engineering technique I know is trial and error xD

Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: JeMaCheHi on 2015-02-08 18:37:43
Sorry for not been posting here for a long time... Have been real busy. The last thing I discovered is that an enemy summoning (for example Ultimecia calling griever) is coded as an enemy attack, and has to be edited in the AI script in the .dat file. Will post more info as soon as I can.
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: Shard on 2015-02-08 23:13:36
Is the same true for in-battle cutscenes, like when there's dialogue?
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: JeMaCheHi on 2015-02-09 10:51:19
Is the same true for in-battle cutscenes, like when there's dialogue?

I'm afraid that I'm not understanding what are you saying...
You mean when, for example, Ultimecia starts to levitate and says "I'll summon blablablabla..."? If that's so, yes, it's the same. Yesterday I made some progress, I'll upload a video showing up as soon as I can, showing all that stuff.
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: JeMaCheHi on 2015-02-09 18:56:30
Here's the video showing some stuff as promised:

http://youtu.be/FqXjO18fYFU
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: Maki on 2015-02-09 19:01:52
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?
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: JeMaCheHi on 2015-02-09 20:13:55
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?

Hi MaKiPL, it's after dropping certain % of HP (doesn't remember just now). I think it's on a textbox, but not sure.

PS: I've been looking your work on .X files, it's really awesome. I think that combining the modification of .dat, .out, and .x files, we could make quite impressive and complete mods
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: Shard on 2015-02-09 20:23:20
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.
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: JeMaCheHi on 2015-02-09 21:58:23
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!

Yeah, is opcode based, but it's still a bit messy for me. It seems that each opcode has certain number of associated bytes. I'm still discovering a lot of them but... it's a lot of work to do man. About battle sounds... I have no idea, but i'd bet they are stored with each attack, ability or spell.
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: JeMaCheHi on 2015-07-29 12:51:00
Don't know if this is necrobumping but, since I rebooted my research on this, there's no much activity on scripting and reverse engineering board, and I'm developing a little tool on Qt.... I think is fine to rebump this thread. I'll have a little spare time now, so I'll post my new findings.

BTW, anyone here could explain me how to edit the wiki entry? The current scene.out entry is a little deprecated and I'd like to update it.
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: Maki on 2015-07-29 17:39:59
You need to ask admin to create an account for you.
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: JeMaCheHi on 2015-07-29 18:06:32
Thanks Maki, I'll ask Covarr for an account then.
By the way, I've been looking at your research on .x files, and I think the cameras in battle formations has much to do with .x files. Maybe you can find some useful info by combining .out and .x files...
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: Halfer on 2015-07-29 21:42:09
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 of course for every animations that are "global".
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: JeMaCheHi on 2015-07-29 22:41:43
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".

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. The two cameras I added today on the first post are relative to the entrance animation, and are dependant on the battle stage. That's why I supposed the actual camera animation is on the .x file. About character winning animations... I don't think they're on the scene.out. I mean, there's still 4 unknown sections, but they seem to be strongly related to each enemy... Maybe some of those sections are camera animations too... I'll think about it, thanks a lot Halfer.
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: Halfer on 2015-07-29 23:09:47
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.
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: JeMaCheHi on 2015-07-29 23:37:15
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.

Thanks Halfer :) I've always been suspicious about r0win.dat file, scene.out feels pretty incomplete. There's a lot of stuff you can't do just by editing the .out file. For now, I'm finishing that tool so everyone can test everything comfortably :D. When I end with it, I'll try to see if some of the unknowns corresponds to enemy animations or something...
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: Maki on 2015-07-30 08:13:02
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.

This makes sense as replacing stages (renaming levels) crashed game in my test. So yes, scene.out is probably addressing cameras offset, thanks for this! Also:
Battlestages contains only intro animation and maybe final camera position. Battle stages does not contain any other camera animation like winning. Still totally unknown are the first ~0x5d4 bytes. My idea is to run looped analyzer on all stages and see which data is far different from others.

EDIT: r0win.dat has AKAO sequences.

I deleted r0win.dat, went to battle, won it and... HUD dissapeared and nothing happens. Game didn't throw exception nor froze. It's just endless battle.
Looks like this file is whole winning scene. Sound, scripts, camera animation...

FF8 loads only one encounter probably with (128*encounterindex) for 128bytes and MOV's it to FF8_EN.exe+19287DC (01D287DC)

@Update: Found the camera!

MOV:
FF8_EN.exe+10CC98 - mov [eax],dx = FOV
FF8_EN.exe+10CCBB - mov [eax+08],dx = FOV

X:
01D9778C (sint32) [FF8_EN.exe+16C66A - mov [eax],edx]
Y:
01D97790 (sint32) [FF8_EN.exe+16C6AE - mov [eax+04],edx]
Z:
01D97794 (sint32) [FF8_EN.exe+16C6F9 - mov [eax+08],edx]

Yes, scene.out points to camera just as you wrote in first post. Still can't find cameras in file.
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: JeMaCheHi on 2015-08-01 11:25:37
I've been playing around with the unknowns, but doesn't seem to have anything to do with camera stuff. Even if you nullify, or set to the default (the same value use for dummies), the enemies will still have all the same animations. I'm running out of ideas with unknowns so I'll start diggin deeper on the level byte until I have new ones...
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: Maki on 2015-08-01 11:42:23
Maybe it's Odin related? Like this fight can or cannot be zantetsuken'ed.
Title: Re: [FFVIII] Scene.out research (Battle formations structure)
Post by: JeMaCheHi on 2015-08-01 12:04:15
Maybe it's Odin related? Like this fight can or cannot be zantetsuken'ed.

Then it should be a global parameter, not a per-enemy parameter... Also, zantetsuken inmunity should be coded in each .dat file... In fact, it's a good point, there's still some unknown fields on .dat files, maybe zantetsuken inmunity is one of those unknowns....