Author Topic: [PSX/PC] Battle Stage to OBJ converter [1.1] [OUTDATED]  (Read 20542 times)

Maki

  • 0xBAADF00D
  • Freak
  • *
  • Posts: 608
  • Karma: 135
  • 0xCCCCCCCC
    • View Profile
Disclaimer!
See newest BS software: http://forums.qhimm.com/index.php?topic=17064.0

Born from here: http://forums.qhimm.com/index.php?topic=15906.0

FFVIII Battle stage .X to OBJ converter is intended to analyze, dump and convert data from FF8 .X battle stage files to OBJ with texture coordinates.

Current version: 1.1 (1.1)
Last updated: 25.03.2015


Features
  • GUI
  • Automatically searches for models in two modes: strict and extended (description below)
  • Shows model offset, vertices, triangles and quad count, shows offset for each one
  • Resolves TIM texture size + TPage'ing.
  • Converts model data to OBJ
  • Automatically creates MTL and OBJ needed info
  • And something more I forgot about. :*

List of changes in 1.1
  • Added Magic RIP Button (The most awaited :D)
  • Redone debug info. Shows now full path
  • Redesigned. Deleted unused progress bar and stuff
  • Software now checks if obj is already ripped, if so, overwrites it. No more endless stream.


List of changes in 1.0
  • Changed icon to the one made by LionHartGR. Thanks!
  • Fixed triangle UV. Thanks to Kaspar01 for providing screenshots. Correct order was ABC> BCA
  • Extremely optimized file. Now it's ~300 KB
  • Built with .NET Framework 4.5 instead of 4.5.1

List of changes in 0.9e
  • Added auto texture resolve
  • Added auto MTL generator
  • Injected quad/triangle algorithm as a one operation
  • Made it less ugly (deleted unused options and stuff)

INSTRUCTION
1.Load file by File>Open
2.Click on one of preferred search modes
3.Select model offset from list on left (or click Magic RIP button - rips all valid meshes)
4.Click RIP
5.Generated MTL and OBJ is in your directory where .X file was. Software generates files named by this: (stageFilename)_(offsetOfModel)_(t or q).obj

Modes
Strict mode - Is most stable option to search for models, but it mostly misses many models (segments). This mode takes the models from generic model set as I wrote on wiki (and it's probably not true [what I wrote on wiki], as we can see now there're models before generic object header [will edit this later])
Extended mode - It searches from beginning. This CAN produce offset of models, that ARE NOT a models itself. There's where my model checker comes in action. Before RIP button is going to be available, my validator checks it for conditions:
Triangle count < 10000
Quad count < 10000
Vertices count < 10000
Vertices != 0
However, it's not 100% of possibilities, so there's still 1% of chance, that the wrong model will pass thru my validator. Ripping bad model passing my validator shouldn't crash the software itself, however the mesh would be complete mess.

Download:

https://www.dropbox.com/s/n7vao6448jtse5v/VIII_x_to_obj_11.zip?dl=0

You will need .NET Framework 4.5 to run this.



FAQ
« Last Edit: 2018-04-24 17:24:44 by Covarr »

Covarr

  • Covarr-Let
  • Administrator
  • *
  • Posts: 4066
  • Karma: 127
  • Just Covarr. No "n".
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [0.95]
« Reply #1 on: 2015-03-23 17:48:44 »
Which versions of the game does this work with?

Maki

  • 0xBAADF00D
  • Freak
  • *
  • Posts: 608
  • Karma: 135
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [0.95]
« Reply #2 on: 2015-03-23 18:22:22 »
Which versions of the game does this work with?

Any. PSone, PC and PC STEAM re-release use the same files.

Halfer

  • Crazy poster
  • *
  • Posts: 142
  • Karma: 31
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [0.95]
« Reply #3 on: 2015-03-23 19:24:45 »
Fantastic job!!! I'm very glad that you got the stage model ripper done.

However, I do have a problem with importing textures to blender. I can't get the textures working on blender. I don't know if i'm doing something wrong or if the .mtl is not working properly?

Maki

  • 0xBAADF00D
  • Freak
  • *
  • Posts: 608
  • Karma: 135
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [0.95]
« Reply #4 on: 2015-03-23 19:51:16 »
MTL file says to use XXX.png texture (where XXX is your stage model filename)*. However if you just put a texture on it in Blender this is create new material, then everything should be working 100%. I'm not a blender guy though, so I can't help you more.

So, if you're working on a0stg105.x, then you should have a texture named a0stg105.png
You can edit MTL file by your own. You'll see inside how it's done. :)
« Last Edit: 2015-03-23 20:16:01 by MaKiPL »

Halfer

  • Crazy poster
  • *
  • Posts: 142
  • Karma: 31
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [0.95]
« Reply #5 on: 2015-03-23 21:11:34 »
Yeah my bad, didn't look in to .mtl and realize that the texture needs to be individually exported :D

By the way, I don't know if you have solved this but for example in a0stg101.x the texture (png exported with deling) is blue (clutted?) and thus making the grass appear as blue like the sky. But don't let it hold you back, this is easy to fix manually with material editing.
« Last Edit: 2015-03-23 21:15:54 by Halfer »

Maki

  • 0xBAADF00D
  • Freak
  • *
  • Posts: 608
  • Karma: 135
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [0.95]
« Reply #6 on: 2015-03-23 22:02:08 »
Yeah my bad, didn't look in to .mtl and realize that the texture needs to be individually exported :D

By the way, I don't know if you have solved this but for example in a0stg101.x the texture (png exported with deling) is blue (clutted?) and thus making the grass appear as blue like the sky. But don't let it hold you back, this is easy to fix manually with material editing.

And it is in fact. To make grass green, the FF8 engine uses texture colourization, the colors are written in quad/triangle data second, third, fourth and fifth byte from end of one face data.

FF8 uses textures like that is PSOne GPU optimization and TIM texture being only 16bit.
I'm not able to do anything. Just don't know how to overcome this, totally. :C
« Last Edit: 2015-03-23 22:11:04 by MaKiPL »

kaspar01

  • Crazy poster
  • *
  • Posts: 118
  • Karma: 18
  • FFVIII Fan & Collector , 3D Artist , FF8RP-WIP
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [0.95]
« Reply #7 on: 2015-03-23 23:01:37 »
Yeah my bad, didn't look in to .mtl and realize that the texture needs to be individually exported :D

By the way, I don't know if you have solved this but for example in a0stg101.x the texture (png exported with deling) is blue (clutted?) and thus making the grass appear as blue like the sky. But don't let it hold you back, this is easy to fix manually with material editing.

That's because of the .tim format for textures.

the blue one you see is the correct channel only for a single piece of that texture..there are usually as many "color palette" as many are the texture segments  I didn't understand yet if there is a way or a tool to automatically extract the correctly composed "puzzle" of right color pieces...I usually do it by myself..

To make this more clear I'll post a little sample:




« Last Edit: 2015-03-23 23:26:24 by kaspar01 »

Halfer

  • Crazy poster
  • *
  • Posts: 142
  • Karma: 31
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [0.95]
« Reply #8 on: 2015-03-24 08:21:01 »
I see. I kinda already knew this before posting but had to make sure that I was not missing anything. I used Ps Tim viewer before for researching textures for World map and that program had clut options available for color correction.

P.s. I haven't abondoned World map researching, i'm just very busy with my school currently but on the side note i'm learning java in there which helps me make tools later on :)

kaspar01

  • Crazy poster
  • *
  • Posts: 118
  • Karma: 18
  • FFVIII Fan & Collector , 3D Artist , FF8RP-WIP
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [0.95]
« Reply #9 on: 2015-03-24 14:02:52 »
I see. I kinda already knew this before posting but had to make sure that I was not missing anything. I used Ps Tim viewer before for researching textures for World map and that program had clut options available for color correction.
I use tim viewer too..well actually I use it to scan files and extract tims.. then I use noesis to extract each palette layer and combine them whith photoshop..

I guess somewhere is supposed to be stored data that should help to make this process automatically but since I can do by myself (spending some time) I don't feel the urge for it :)

P.s. I haven't abondoned World map researching, i'm just very busy with my school currently but on the side note i'm learning java in there which helps me make tools later on :)

Happy to hear this!!!

Now coming back to topic since there is not yet the "magical button" to get 1 already merged .obj (and it probably will take some time) a button that automatically rip all models found whith one click could be a good start :)

Anyway I'm gonna make some test whith messed triangle UV because I have a theory about what makes them look wrong and how it could be fixed..

Update:

My theory looks correct.. the UV cohordinates of each triangle are correct but they are assigned to the wrong vertex..

Here you can see a simple model on the right whith its UV map on the left.. the positions looks correct but the textures looks messed up.


Now If you take a triangle and you switch vertex position to its next one position this way..
(looks like paint doesnt have oblique right-down arrow ... hope it's clear anyway )


The result  looks correct..


I guess you should just change the uv position assigned to vertex in tiangular mesh and the problem should get fixed..

« Last Edit: 2015-03-24 19:09:11 by kaspar01 »

Maki

  • 0xBAADF00D
  • Freak
  • *
  • Posts: 608
  • Karma: 135
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [0.95]
« Reply #10 on: 2015-03-25 18:23:16 »
kaspar01, you're right. For quads it's ABCD> ABDC. Taking look at your screen I finally made it. :)
ABC> BCA was correct.

I made a correction. I'll upload the fixed version. Still no "magic button" though. :C

UPDATE: Nah! I made it. :D Magical RIP button is ready. Also by using List + Validator I'm able to get ID's for every ripped model, so I can stitch it by software itself. But... Next time. :) Thanks for patience!

I'll update the first post with version 1.1
« Last Edit: 2015-03-25 18:43:28 by MaKiPL »

Maki

  • 0xBAADF00D
  • Freak
  • *
  • Posts: 608
  • Karma: 135
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [1.1]
« Reply #11 on: 2015-03-25 18:41:12 »
Updated to 1.1

kaspar01

  • Crazy poster
  • *
  • Posts: 118
  • Karma: 18
  • FFVIII Fan & Collector , 3D Artist , FF8RP-WIP
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [1.1]
« Reply #12 on: 2015-03-25 19:12:34 »
kaspar01, you're right. For quads it's ABCD> ABDC. Taking look at your screen I finally made it. :)
ABC> BCA was correct.

I made a correction. I'll upload the fixed version. Still no "magic button" though. :C

UPDATE: Nah! I made it. :D Magical RIP button is ready. Also by using List + Validator I'm able to get ID's for every ripped model, so I can stitch it by software itself. But... Next time. :) Thanks for patience!

I'll update the first post with version 1.1

Very nice!
I'm gonna test the new version soon :D
Thanks for the magic button! now I can have the complete model imported in max whithin 2 minutes (If I already made the texture)
Feeback coming soon :)

Update:

WOW!

Triangular mesh uv problem looks solved!

Moreover now the missing mesh from the 2 fire cavern battle stages are correctly extracted!

There is a little problem whith uv whith the newly found triangular mesh anyway..
In stage 030 the UV looks weird since it's shown this way:



but it's probably supposed to be this way (I manually fixed it):



(That's weird since only vertical position looks wrong since I have to move and scale a bit only on vertical axis to fix that)

I can confirm that this problem does not occur whith battle stage 031 (Ifrit lair).. maybe it's just an isolated case..I'll let you know if I find more !

P.S.
Actually the tool is almost done and imho it's time to give it a real name (you know..there is already pupu,ifrit,deling etc.. you could choose a name for this MakiPL :) )
« Last Edit: 2015-03-25 20:47:38 by kaspar01 »

Halfer

  • Crazy poster
  • *
  • Posts: 142
  • Karma: 31
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [1.1]
« Reply #13 on: 2015-03-25 21:32:25 »
Awesome! :D

Here's a little preview with a0stg101.x (with poor color correction):


Also a bonus pic with my bland Squall model :P

kaspar01

  • Crazy poster
  • *
  • Posts: 118
  • Karma: 18
  • FFVIII Fan & Collector , 3D Artist , FF8RP-WIP
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [1.1]
« Reply #14 on: 2015-03-25 23:34:50 »
After many test on many stages I came to the conclusion that normal are probably all wrong because the mesh look weird till I "flip" them on max (both quads and triangular).

I guess that can be fixed by inverting all face normals :)

LeonhartGR

  • No life
  • *
  • Posts: 2518
  • Karma: 36
  • ~Whatever...~ Enjoy life!
    • View Profile
    • LeonhartGR Productions
Re: [FF8] Battle Stage to OBJ converter [1.1]
« Reply #15 on: 2015-03-26 00:20:28 »
Fawwwk! That is awesome! I saw the Squall model! Please take care of the fur and the jacket though. I know it's early but I'm just informing you now in case you are interested in any modelling improvements. The circle with the fur around the neck looks a bit more wide open. As well as it is with the jacket. But the hair look just perfect! Well done!


« Last Edit: 2015-03-26 00:34:06 by LeonhartGR »

Halfer

  • Crazy poster
  • *
  • Posts: 142
  • Karma: 31
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [1.1]
« Reply #16 on: 2015-03-26 06:52:32 »
Thanks for feedback LeonhartGR. Yes, this is in a pretty early development mostly concentrated on head till now. I do have a model with "real" hair but I prefer the polygon one since it's intended to be a replica. Also the textures are just placeholders.

Maki

  • 0xBAADF00D
  • Freak
  • *
  • Posts: 608
  • Karma: 135
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [1.1]
« Reply #17 on: 2015-04-25 13:34:07 »
Today I wrote the triangulation for quad meshes. I though that this was the issue for bad "stitching" for models, but even after making quad models triangular it DOES NOT fix the problem. Currently, I don't know how to make one model from segments without using external software. Anyone?

@Updated wiki page with Quad>Triangle translation

@Edit: Oh, by the way. I imported one of the Ultimecia castle battle stage to UE4 and made this:
« Last Edit: 2015-04-25 13:50:07 by MaKiPL »

Fr3aKeD

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [1.1]
« Reply #18 on: 2015-07-04 02:19:53 »
So, is this a way to be able to take and delete all FF8 characters and make them turn into FF7 characters? :D just curious if this is what that does?

Halfer

  • Crazy poster
  • *
  • Posts: 142
  • Karma: 31
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [1.1]
« Reply #19 on: 2015-07-04 08:30:20 »
Umm no? It exports battle stages to wavefront files which is also stated in title. I'm not sure if there's is a good FF8 character converter but if there isn't then it's probably coming in the future.

Maki

  • 0xBAADF00D
  • Freak
  • *
  • Posts: 608
  • Karma: 135
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [1.1]
« Reply #20 on: 2015-07-04 09:03:16 »
Fr3aKeD, it is possible, indeed. Noesis is capable of exporting character models. If you'd like to swap models, you'd need to recreate FF8 model with FF7 geometry and textures. You can do this only manually, working with FF8/DAT file documentation here on Qhimm. If you like HEX fun, then go for it! :)

Just as Halfer wrote. It only converts battle STAGE model (forests, castle, desert background etc.) to .OBJ format

kaspar01

  • Crazy poster
  • *
  • Posts: 118
  • Karma: 18
  • FFVIII Fan & Collector , 3D Artist , FF8RP-WIP
    • View Profile
Re: [FF8] Battle Stage to OBJ converter [1.1]
« Reply #21 on: 2015-07-09 15:55:44 »
@Edit: Oh, by the way. I imported one of the Ultimecia castle battle stage to UE4 and made this:


LOL XD

I saw this just now XD

Actually I'm starting learning some UE4 stuff for my ff8 project these days.. hi poly modeling takes a lot of time.. maybe I should import some models this way too XD