Author Topic: FF VIII Chara.one World.fs  (Read 3555 times)

Softtm17

  • *
  • Posts: 33
    • View Profile
FF VIII Chara.one World.fs
« on: 2014-03-14 09:58:07 »
Always me ^^"
There is any way to extract the model from the world.fs?
We are interested to take IF possible:
All models about the world map...
So city, car, ragnarock, mini squall etc

I have the plugin for the noesis that extract the normal chara.one in field.fs, but when i try to extract "That" chara.one in world.fs i got an error.
I've see the structure in hex edit and it's different from the normal one....so i'm asking you if anyone have a new script or something that can be usefull for extract all.
(i think there is also something inside the other forlder "dat" where there are some obj file....there is any way to extract something from there? Inside the file wmsetit.obj there are some textures about garden car etc....)
Thanks again, waiting for you answers.
« Last Edit: 2014-03-14 10:20:44 by Softtm17 »

Vehek

  • *
  • Posts: 215
    • View Profile
Re: FF VIII Chara.one World.fs
« Reply #1 on: 2014-03-15 06:09:09 »
The chara.one in world.fs is an older type of chara.one. They were used in the PS1's FF8 demo and sometimes appear in the old, unlinked field archives, but the one in world.fs appears to be the only actual use of the old format in the final version.
Some details about the format. I don't know if this is the right term, but there's a "footer". To read it, you have to work backwards from the end of the file. Unlike the headers in standard chara.one files, all offsets are absolute, not relative.

Code: [Select]
import struct
import os.path
from os import mkdir

class genericEntry:
    def __init__(self):
        self.location = 0
        self.size = 0
        self.isNPC = False
        self.MCHNumber = -1
        self.TIMlocations = []
        self.modelLoc = 0
        self.sizeBeforeAnims = 0
        self.anims = []

def unread(src):
    loc = src.tell()
    curResult = struct.unpack("<I", src.read(4))[0]
    src.seek(loc - 4)
    return curResult

name = raw_input('File name:')
src = open(name, 'rb')

charaEnd = struct.unpack("<I", src.read(4))[0]
src.seek(charaEnd - 4)

totalModels = unread(src)

models = []

for i in range(totalModels):
    mdl = genericEntry()
    firstNum = unread(src)
    if (firstNum & 0xD0000000) == 0xD0000000:
        mdl.MCHNumber = firstNum & 0xFFFF
        mdl.location = unread(src)
    else:
        mdl.isNPC = True
        mdl.TIMlocations.append(firstNum)
        loc = unread(src)
        while loc != 0xFFFFFFFF:
            mdl.TIMlocations.append(loc)
            loc = unread(src)
        mdl.modelLoc = unread(src)
        mdl.location = firstNum & 0xFFFFFF

    models.append(mdl)
   
fillerplace = genericEntry()
fillerplace.location = src.tell() + 4
models.append(fillerplace)

if not os.path.exists("%s_extract" % (name)):
    mkdir("%s_extract" % (name))

for i in range(totalModels):
    src.seek(models[i].location)
    curmdl = models[i]
    rawdata = src.read(models[i + 1].location - models[i].location)
    if curmdl.isNPC == True:
        outmdl = open('%s_extract\\mdl%02d.mch' % (name, i), 'wb')
        for offs in curmdl.TIMlocations:
            outmdl.write(struct.pack("I", offs + 0x100 - curmdl.location))
        outmdl.write(struct.pack("I", 0xFFFFFFFF))
        outmdl.write(struct.pack("I", curmdl.modelLoc + 0x100 - curmdl.location))
        while outmdl.tell() < 0x100:
            outmdl.write(chr(0))
        outmdl.write(rawdata)
        outmdl.close()
    else:
        outmdl = open('%s_extract\\d%03d_anim.bin' % (name, curmdl.MCHNumber), 'wb')
        outmdl.write(rawdata)
        outmdl.close()
       
   

src.close()
« Last Edit: 2014-03-15 06:13:18 by Vehek »

kaspar01

  • *
  • Posts: 118
  • FFVIII Fan & Collector , 3D Artist , FF8RP-WIP
    • View Profile
Re: FF VIII Chara.one World.fs
« Reply #2 on: 2014-03-15 08:27:46 »
Thank you Vehek! :)

Do you know maybe something too about how extracting the models in wmsetus.obj?or about terrain (not sure about them but they could be in that big wmx file even if textures are in wmsetus and textl files..
« Last Edit: 2014-03-15 08:32:10 by kaspar01 »

Softtm17

  • *
  • Posts: 33
    • View Profile
Re: FF VIII Chara.one World.fs
« Reply #3 on: 2014-03-15 10:28:29 »
Yup now it's working but i see another "Old" thread...where you talking about the .obj file inside the world.fs......i'll try to open wmsetus.obj go in the address 0x3BB4 (if i don't remember bad) and see where are the models...but how can we exctract them? (And where is the lenght of the file? >_>) You said there is just the mesh and no bones (so no animations), for me is good in anycase.
We got alredy the texture with another tool but we cannot find a way to extract them and make all these readable on noesis or 3ds studio max >_>