Author Topic: (PSX FF7) Modified CLOUD.BCX proof-of-concept  (Read 11657 times)

Lazy Bastard

  • *
  • Posts: 290
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
(PSX FF7) Modified CLOUD.BCX proof-of-concept
« on: 2012-08-16 02:12:54 »
Using data from MD1STIN.BSX (the first field you find yourself in at the beginning of the game), I've modified CLOUD.BCX (Cloud's field model) to make him a red-uniformed Shinra guard, while retaining his facial data. This would allow you to play the entire game with Cloud as a Shinra guard (with the possible exception of Cloud-in-a-dress, and similar scenes).

I've included a video of the intro:

http://www.youtube.com/watch?v=Y3AbC7vG0hE&feature=youtu.be

...and a video of some Cosmo Canyon game play:

http://www.youtube.com/watch?v=YswDVZSAe48&feature=youtu.be

...and a copy of the modified BCX file, in case anyone wants to use something like CDProg or CDMage to insert the file at the same LBA as the original, and play around, in a duplicate thread - HERE

The point of this POC is that I can now take any field model in the game and make it a playable character. This is a necessary step in a mod I'm working on. Next, on to battle models, and finally world map models.

Jenova's Witness

  • Right Wing Safety Squads
  • *
  • Posts: 471
  • I ♥ SCIENCE
    • View Profile
.
« Reply #1 on: 2012-08-16 02:21:42 »
.
« Last Edit: 2015-11-16 09:58:24 by Jenova's Witness »

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #2 on: 2012-08-16 02:59:49 »
The point of this POC is that I can now take any field model in the game and make it a playable character. This is a necessary step in a mod I'm working on. Next, on to battle models, and finally world map models.
For a moment there I thought you said "battle models and finally word domination" ... felt like an episode of Pinky and the Brain suddenly.

Erstwhile, despite silliness, you want to change clouds battle / field model to a Shinra guard or just a different model?

For the battle models you may have some 'interesting' challenges. As noted in your BCX bashing thread the BM's have the weapons with them, and the weapons are a bone that is substituted in. I believe cloud has 15 weapon models. If you wish to change them to a gun or something other than cloud's weapons you will have to play with those. Making the model probably isn't a big deal clouds file is the biggest of the characters so you have plenty of space at least. Anyhow you may want to take Vincent's gun and substitute it as the buster sword to see what happens in the battle model.

I don't recall where the world model is. It may be might be cloud.bcx (maybe) Have you tried a world wandering? Well my guess is you did. I can't remember what the deal was with the world models (honesty here). I think the person who finally cracked the animation was (El?) Spiro it's been more than 6 years (sigh).

Cyb

Lazy Bastard

  • *
  • Posts: 290
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #3 on: 2012-08-16 03:10:07 »
Quote
For a moment there I thought you said "battle models and finally word domination" ... felt like an episode of Pinky and the Brain suddenly.

Heh, you mean 'world domination'? (also, is what I just did considered 'word domination'?  :-P )  I do see what you mean, though. Maybe I MEANT it to look like that...heheh.


Quote
Erstwhile, despite silliness, you want to change clouds battle / field model to a Shinra guard or just a different model?

To a totally different model. I just don't want to give away the bag with a proof of concept demo.


Quote
For the battle models you may have some 'interesting' challenges. As noted in your BCX bashing thread the BM's have the weapons with them, and the weapons are a bone that is substituted in. I believe cloud has 15 weapon models. If you wish to change them to a gun or something other than cloud's weapons you will have to play with those. Making the model probably isn't a big deal clouds file is the biggest of the characters so you have plenty of space at least. Anyhow you may want to take Vincent's gun and substitute it as the buster sword to see what happens in the battle model.

That would be pretty funny, especially if I didn't change Cloud's animation data, so he went around clubbing people with a rifle :)


Quote
I don't recall where the world model is. It may be might be cloud.bcx (maybe) Have you tried a world wandering? Well my guess is you did. I can't remember what the deal was with the world models (honesty here). I think the person who finally cracked the animation was (El?) Spiro it's been more than 6 years (sigh).

CLOUD.BCX is only the field model. I did end up going onto the world map as I made sure the modified BCX worked during world map to field transitions, but I didn't expect the model to carry over onto the world map, and it didn't.

Also, you're remembering L Spiro (so, yeah...mostly right, heh). He was also the author or Memory Hacking Software, an application similar to TSearch, etc.

Lazy Bastard

  • *
  • Posts: 290
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #4 on: 2012-08-16 14:07:53 »
Incidentally, I became interested in battle models last night, and performed some simple file swaps, to observe behavior.

If I swap Sephiroth's battle model with Cloud's, I get a perfectly working Sephiroth battle model, with Cloud's moves, and full control (as in, no AI data is contained within the LZS file, apparently).

If I swap any of Vincent's limit break battle models with Cloud's, I get a perfectly working Chaos/DeathGigas/etc battle mode, with Cloud's moves, and full control (which is pretty cool).

If I swap any enemy model with Cloud's, the game will freeze as the battle begins, just before it pans down far enough for me to see what Cloud looks like. Apparently, enemy models are different enough to cause a crash.

I decompressed CLOUD.LZS and ENEMY016.LZS and took a look around with a hex editor, doing some comparisons, but I haven't nailed down anything meaningful yet. The wiki contains nothing on the subject. Has anyone done any work in this regard?

Jenova's Witness

  • Right Wing Safety Squads
  • *
  • Posts: 471
  • I ♥ SCIENCE
    • View Profile
.
« Reply #5 on: 2012-08-16 19:05:52 »
.
« Last Edit: 2015-11-16 09:58:13 by Jenova's Witness »

Lazy Bastard

  • *
  • Posts: 290
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #6 on: 2012-08-17 01:44:51 »
That's something to consider. I'll look into that.

Also, I somehow forgot that Akari wrote a battle model exporter, and provided source for it :)  Hopefully I can glean some useful information from that.

Jenova's Witness

  • Right Wing Safety Squads
  • *
  • Posts: 471
  • I ♥ SCIENCE
    • View Profile
.
« Reply #7 on: 2012-08-17 05:00:18 »
.
« Last Edit: 2015-11-16 09:58:03 by Jenova's Witness »

Lazy Bastard

  • *
  • Posts: 290
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #8 on: 2012-08-17 20:47:41 »
I've mapped out most of a sample enemy model. Once I'm finished with that, I'll do the same for a sample party member model, then perform some modifications as tests.

Lazy Bastard

  • *
  • Posts: 290
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #9 on: 2012-08-21 20:57:39 »
Still working on mapping out the last few parts of both ENEMY016.LZS (MP) and CLOUD.LZS (Cloud, obviously). I'll post them in their own threads when finished.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #10 on: 2012-08-23 02:45:57 »
Still working on mapping out the last few parts of both ENEMY016.LZS (MP) and CLOUD.LZS (Cloud, obviously). I'll post them in their own threads when finished.
Hmm most of those should be well documented in the wiki, I remember we documented all of the parts including the animation. However that doesn't mean it ended up in the wiki. At that time an SIS based mother board I had wiped out my hard drive 2 times. After that I can't remember.

Erstwhile I think all sections were accounted for. Unless you are speaking of what was inside the sections. Some of the enemy file contents depend on the battle script for certain animations I believe It's been a LONG time I have to admit. I probably remember wrong (amazing).  You may wish to check Akari's extraction code specifically for what it does for battle scenes. I forget which file determines the enemies spawned in a battle.
Anyhow the characters have additional "bones" at the end of the file (all the end sections) I am not positive about this but I believe a TIM file demarks the location where these models begin (or the end of the file). Models that haven't any textures still have a 0x0 TIM file. I remember using that to look for the place where the character 'interchangeable bone' models started.

Cyb

Lazy Bastard

  • *
  • Posts: 290
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #11 on: 2012-08-23 15:14:52 »
Quote from: Cyberman
Hmm most of those should be well documented in the wiki, I remember we documented all of the parts including the animation. However that doesn't mean it ended up in the wiki. At that time an SIS based mother board I had wiped out my hard drive 2 times. After that I can't remember.

Erstwhile I think all sections were accounted for. Unless you are speaking of what was inside the sections. Some of the enemy file contents depend on the battle script for certain animations I believe It's been a LONG time I have to admit. I probably remember wrong (amazing).  You may wish to check Akari's extraction code specifically for what it does for battle scenes. I forget which file determines the enemies spawned in a battle.
Anyhow the characters have additional "bones" at the end of the file (all the end sections) I am not positive about this but I believe a TIM file demarks the location where these models begin (or the end of the file). Models that haven't any textures still have a 0x0 TIM file. I remember using that to look for the place where the character 'interchangeable bone' models started.

Cyb

Yes, I've been using Akari's code and information on the relevant wiki page. I've got almost all data mapped out, but I'm still not entirely sure of where Cloud's animation data ends...there's a section of data after animation data and before the next section that is 855 bytes long, and looks suspiciously like more animation data...but is not related to the first animation data referenced in other parts of the file. I'm also still in the dark about a large collection of offsets near the beginning of the file (called number_of_sections in the wiki page and number_of_files in Akari's source), which seem to have something to do with bones, but which are not the bone data sections referenced in the bone descriptions. If I zero out bone data, Cloud is invisible (except for his weapon...I have found what should be the bone data for his weapon, but zeroing it seems to have no effect); however, if I zero out the 'mystery data' referenced in those early offsets, Cloud becomes a flattened pile of himself, including his weapon.

I'll do more testing later to identify individual parts, etc. I've changed the 'length' values for each bone, one at a time, in the bone descriptions, and documented what each bone was (although several seemed to have no effect, and only some of these were joints), and noticed that changing the length didn't lengthen or shorten the bones as you'd imagine...but instead changed the distance from the 'parent' bone...although this could be related to polygon data, etc (as in, the bone got longer, but the visible part didn't).

I've also noticed that the data that is supposedly TIM data doesn't adhere to what's described as normal TIM specifications on the wiki. There must be some modification to the format in this case, which I'll have to figure out.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #12 on: 2012-08-23 20:52:38 »
Yes, I've been using Akari's code and information on the relevant wiki page. I've got almost all data mapped out, but I'm still not entirely sure of where Cloud's animation data ends...there's a section of data after animation data and before the next section that is 855 bytes long, and looks suspiciously like more animation data...but is not related to the first animation data referenced in other parts of the file. I'm also still in the dark about a large collection of offsets near the beginning of the file (called number_of_sections in the wiki page and number_of_files in Akari's source), which seem to have something to do with bones, but which are not the bone data sections referenced in the bone descriptions. If I zero out bone data, Cloud is invisible (except for his weapon...I have found what should be the bone data for his weapon, but zeroing it seems to have no effect); however, if I zero out the 'mystery data' referenced in those early offsets, Cloud becomes a flattened pile of himself, including his weapon.
The file isn't actually a file at all. That's the first thing you need to realize. The second thing is the offsets are EXACTLY that they are reference offsets (POINTERS) to the data. The data is actually in memory structure data.

I'm pretty sure the mystery data is something Micky unravelled it might be in the archived section from the old forums. In fact that might be the best place too look. There was a thread about the battle models that was quite long.
I'll do more testing later to identify individual parts, etc. I've changed the 'length' values for each bone, one at a time, in the bone descriptions, and documented what each bone was (although several seemed to have no effect, and only some of these were joints), and noticed that changing the length didn't lengthen or shorten the bones as you'd imagine...but instead changed the distance from the 'parent' bone...although this could be related to polygon data, etc (as in, the bone got longer, but the visible part didn't).
Yes BONE LENGTH is actually the offset from the last joint/bone. You could make a character "blow" up I suppose if you messed with those correctly :D
If you find halkuns playstation document I suggest read it regarding the GTE carefully.  It's important to know this beast well if you want to understand FF7's data.

If you have invisible sections is more likely you are drawing your triangles in the WRONG order. It's very important to know what the correct order is. Especially with quads I believe I mentioned this but the quads are weird and you are better off using 2 triangles instead of a normal quad because you'll end up with a bow tie or worse.
I've also noticed that the data that is supposedly TIM data doesn't adhere to what's described as normal TIM specifications on the wiki. There must be some modification to the format in this case, which I'll have to figure out.
As for the TIM data hmmm I'll have too look at it. I remember there was something different about it just not what. I think they removed some of the data you would normally have in a TIM. Just like the BSX files are kind of strangely mangled chunks of data. :D
I use to have something to extract that data OK. Hmmm it's probably on my old machine (that doesn't boot any more).

Cyb

Lazy Bastard

  • *
  • Posts: 290
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #13 on: 2012-08-23 20:59:44 »
Quote from: Lazy Bastard
I'm also still in the dark about a large collection of offsets near the beginning of the file (called number_of_sections in the wiki page and number_of_files in Akari's source), which seem to have something to do with bones, but which are not the bone data sections referenced in the bone descriptions. If I zero out bone data, Cloud is invisible (except for his weapon...I have found what should be the bone data for his weapon, but zeroing it seems to have no effect); however, if I zero out the 'mystery data' referenced in those early offsets, Cloud becomes a flattened pile of himself, including his weapon.

I've identified that the last 14 of the 'mystery data' sections referenced by early offsets and resting immediately before what's signified by documentation and Akari's source as weapon data...seem to also be weapon data. In addition, the data immediately after the stated 'weapon data' seems to be one additional weapon data section, making the count 16 (the number of weapons Cloud has in the game, incidentally).

I believe that the data before this weapon data (the remaining 'mystery data') is either animation data or texture data, despite existing documentation stating otherwise. I think actual enemy models and playable character models are different in this regard. Certainly, Akari's source works with actual enemy models, so it must be largely or entirely correct in that regard...but, although there are playable character models included in the sample data from which the Q-Gears FF7 battle model extractor/viewer pulls files, none of them are actually viewable (although admittedly I haven't attempted to modify the source and config files to facilitate such a feat).

I'm creeping ever closer to a complete mapping. Updates will follow...in the meantime, anyone with useful information can feel free to chime in and save me from re-inventing the wheel.

Lazy Bastard

  • *
  • Posts: 290
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #14 on: 2012-08-23 21:02:51 »
Quote from: Cyberman
The file isn't actually a file at all. That's the first thing you need to realize. The second thing is the offsets are EXACTLY that they are reference offsets (POINTERS) to the data. The data is actually in memory structure data.

Yes, I know (both of those).


Quote from: Cyberman
I'm pretty sure the mystery data is something Micky unravelled it might be in the archived section from the old forums. In fact that might be the best place too look. There was a thread about the battle models that was quite long.

Thanks; I'll dig around in there.


Quote from: Cyberman
As for the TIM data hmmm I'll have too look at it. I remember there was something different about it just not what. I think they removed some of the data you would normally have in a TIM. Just like the BSX files are kind of strangely mangled chunks of data. :D
I use to have something to extract that data OK. Hmmm it's probably on my old machine (that doesn't boot any more).

That would be most helpful :)

Lazy Bastard

  • *
  • Posts: 290
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #15 on: 2012-08-23 22:06:12 »
Also, I've identified the 'mystery data' section immediately before those that appear to be weapon bone data sections, as the texture data (again, despite existing documentation stating otherwise). TIM Viewer corroborated that (I knew I should have tossed this file at a few tools early on) by finding raw TIM data at the exact offset (but not being able to view it).

Lazy Bastard

  • *
  • Posts: 290
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #16 on: 2012-08-23 22:07:32 »
And, I found the thread you were referring to, which may yield some useful information:

http://forums.qhimm.com/index.php?topic=2519.50

Covarr

  • Covarr-Let
  • Administrator
  • *
  • Posts: 3941
  • Just Covarr. No "n".
    • View Profile
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #17 on: 2012-08-23 22:18:30 »
The edit button is your friend, Lazy Bastard.

Lazy Bastard

  • *
  • Posts: 290
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #18 on: 2012-08-23 22:45:37 »
I suppose you're right...but for those who are using Notify, it won't do so unless a new post was made, not an edit.

Jenova's Witness

  • Right Wing Safety Squads
  • *
  • Posts: 471
  • I ♥ SCIENCE
    • View Profile
.
« Reply #19 on: 2012-08-24 18:56:59 »
.
« Last Edit: 2015-11-16 09:56:50 by Jenova's Witness »

Lazy Bastard

  • *
  • Posts: 290
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: (PSX FF7) Modified CLOUD.BCX proof-of-concept
« Reply #20 on: 2012-08-24 18:59:46 »
In the past, I was the same, but as time has become more precious to me and I only scan various forums once in a while, and at the same time I'd like to know when something has been posted in response to either a post of mine, or something I'm interested in...I subscribe.

Also, I've finished mapping out CLOUD.LZS. I'll post a new thread.