Author Topic: [FF8 steam]Character importer  (Read 19862 times)

kaspar01

  • *
  • Posts: 118
  • FFVIII Fan & Collector , 3D Artist , FF8RP-WIP
    • View Profile
Re: [FF8 steam]Character importer
« Reply #25 on: 2018-03-30 10:02:27 »
Hey Shun! it's been a while and I see you're still on FF8 stuff (and you're doing geat as well! )

Can't wait to see how this is going to evolve..

Hopefully my newly acquired 3D skills will be of any use for creating a HD mods or something sooner or later  :)

Mcindus

  • *
  • Posts: 929
  • Artist, Modder, Musician.
    • View Profile
    • Lunatic Pandora
Re: [FF8 steam]Character importer
« Reply #26 on: 2018-03-30 15:29:55 »
kaspar - you and I both!!

It would be really nice to be able to import models with more polys.

Keep it up Shunsq!  I can't wait to be able to give the characters a REAL overhaul :)

Shunsq

  • *
  • Posts: 142
  • 20 years to mod a game, that's insanely long
    • View Profile
Re: [FF8 steam]Character importer
« Reply #27 on: 2018-03-30 16:40:37 »
Good to see you back kaspar!
I'm not showing anything because right now the code is a bit useless. I can import new model into the game but on screen all the vertices are messed up because of "fixed point precision" of the engine. Google the term on the net. In modern game, or even ff7 if i'm not wrong,the vertices are "floating point precision". That means that a fixed number of coordinates are allowed on screen . If my vertex is at coordinate (20.233 pix; 123.3 pix) then it will be snapped to (20 pix; 123 pix). That is the "shaky" effect of old psx games. Some emulators fix that issue (see PGXP).I would like something similar i could inject with dlpb tools.

My other issue is the size of the ram of ff8. I can increase the texture size to 256×256 (twice the actual size) but the new texture overlaps with other textures. So i tried to build a code that stores the textures somewhere else in memory. But the problem is still the same.

Mcindus

  • *
  • Posts: 929
  • Artist, Modder, Musician.
    • View Profile
    • Lunatic Pandora
Re: [FF8 steam]Character importer
« Reply #28 on: 2018-03-30 18:54:52 »
Good to see you back kaspar!
I'm not showing anything because right now the code is a bit useless. I can import new model into the game but on screen all the vertices are messed up because of "fixed point precision" of the engine. Google the term on the net. In modern game, or even ff7 if i'm not wrong,the vertices are "floating point precision". That means that a fixed number of coordinates are allowed on screen . If my vertex is at coordinate (20.233 pix; 123.3 pix) then it will be snapped to (20 pix; 123 pix). That is the "shaky" effect of old psx games. Some emulators fix that issue (see PGXP).I would like something similar i could inject with dlpb tools.

My other issue is the size of the ram of ff8. I can increase the texture size to 256×256 (twice the actual size) but the new texture overlaps with other textures. So i tried to build a code that stores the textures somewhere else in memory. But the problem is still the same.

Aali released his source - and they've been working on it and chatting about it in the FF7 dev area of discord.  Aali was able to crate a modpath for the (lower resolution is icon.tex) - iconfl00.tex, iconfl01.tex, iconfl02.tex, iconfl03.tex for the english version and make an external folder path interceptor for the textures.  If you could do something like this with your models, then you might be able to get the functionality you're looking for.  Would Kalderasha have anything to add to this topic?

Kaldarasha

  • *
  • Posts: 2449
  • Prince of Model Editing
    • View Profile
Re: [FF8 steam]Character importer
« Reply #29 on: 2018-03-30 19:19:02 »
Not really, if I understand Shunsq correctly then the game use int var to calculate the 3D. So the function needs to be rewritten with float or double precision. I probably said this but it might be a good idea to ask Kaldaien on steam if he has an idea how to deal with this. He seems to be very competent with working on graphic interfaces and with the source of Aali's driver he may have more possibilities to hack the game.

red_evilspirit

  • *
  • Posts: 41
    • View Profile
Re: [FF8 steam]Character importer
« Reply #30 on: 2018-05-13 15:13:59 »
I write script like this, is it right ?
Code: [Select]
bs.seek(animofs, NOESEEK_ABS)
animCount = bs.readShort()
framCount = bs.readShort()
boneCount = bs.readShort()
coordinatesOffset = bs.readBytes(6)
gido = []
for i in range(0,boneCount):
byte1 = bs.readByte()
byte2 = bs.readByte()
byte3 = bs.readByte()
byte4 = bs.readByte()
rotation1 = (byte1 << 0x02) | ((byte4 & 0x03) << 0x0A)
rotation2 = (byte2 << 0x02) | ((byte4 & 0x0C) << 0x08)
rotation3 = (byte3 << 0x02) | ((byte4 & 0x30) << 0x06)
xyz = {
"x": rotation1,
"y": rotation2,
"z": rotation3
}
gido.append(xyz)
when i dump 'xyz', all number is really big :(
« Last Edit: 2018-05-13 15:16:27 by red_evilspirit »

Shunsq

  • *
  • Posts: 142
  • 20 years to mod a game, that's insanely long
    • View Profile
Re: [FF8 steam]Character importer
« Reply #31 on: 2018-05-30 19:57:49 »
Hello red,
Sorry for the late reaction,
Your reading program is ok for chara.one file. The rotations are written on 12 bits, which give you a max angle of 4095 for each rotation.
For some reason blender understands that 4095 equals 180 degrees. That means  2048 is 90 deg and so on.
In my code i don't do any conversion to radians or degrees. I read the raw value and apply it to the bone rotations in pose mode.

On the contrary the data is different in the mch file.
The mch only contains the bone hierarchy, their length and a T pose.
I still have big issues to find a code that creates a good T pose for all characters.Today i extract 2 bytes for each rotations then i convert to degree, then to euler angles.

Just so you know, you don't need the T pose to anim the character. That means that even if the  T pose is a total mess, the bones will magically anim perfectly in posemode.

red_evilspirit

  • *
  • Posts: 41
    • View Profile
Re: [FF8 steam]Character importer
« Reply #32 on: 2018-06-01 18:31:32 »
I thought i can get T-pose with that code.
By the way, can you show me the structure of chara.one file?
Does it like http://wiki.ffrtt.ru/index.php/FF8/FileFormat_ONE
« Last Edit: 2018-06-03 02:48:53 by red_evilspirit »