Author Topic: [FF8] .x battle fields  (Read 88861 times)

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] .x battle fields
« Reply #50 on: 2015-02-08 17:16:48 »
Looks to me like the triangles overlap, miscalculation somewhere?



If the blue triangle be mirrored vertically, this should work just fine. I'll take a smaller object, and see which one should have +/- 1 face index.
Maybe every second one needs mirroring? If so, then this could be easy to mod, however if it's more complitaced, then.. well, it's going to be more complicated then. xD
« Last Edit: 2015-02-08 17:56:48 by MaKiPL »

Yagami Light

  • *
  • Posts: 173
    • View Profile
Re: [FF8] .x battle fields
« Reply #51 on: 2015-02-08 18:03:48 »
http://gamedev.stackexchange.com/questions/32254/missing-triangles-in-model

This person had the same issue, turns out the obj loader was the issue

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] .x battle fields
« Reply #52 on: 2015-02-08 18:57:00 »
Hmph, I don't know. It's neither backface culling and rendered "glitch". Maybe if We would write the viewer we'd make a special workaround for this, but...

I imported it into 3DS Max, and the face is just rotated 90o, or the vertex should be mirrored horizontally. Also the QUAD/Face translation:

, ,

After numerous tests I found it. Correct ABCD is:

ABD
ACD

So quad:
Code: [Select]
f 394 395 416 417will be:
Code: [Select]
f 394 395 417
f 394 416 417
« Last Edit: 2015-02-08 19:08:23 by MaKiPL »

paul

  • *
  • Posts: 179
    • View Profile
Re: [FF8] .x battle fields
« Reply #53 on: 2015-02-09 12:26:00 »
Nice work, this means reading mesh without U/V and texture information is fully reversed now?

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] .x battle fields
« Reply #54 on: 2015-02-09 13:09:10 »
Nice work, this means reading mesh without U/V and texture information is fully reversed now?


Yup, UV info is stored in quad info, so getting working texture for it is just a little work to do. :)

Just a little update. My Quad>Triangle conversion is lil' bad. Instead of Quad to triangle shakotay2 on Xentax pointed a nice, clear way to fix model just by changing quad order from ABCD to ABDC. Looks fine:
*Ignore missing quad, that's my fault.


EDIT: Imported to Excel, and changed columns to automate ASAP my work. Here's full model:
.

:)


EDIT2: I was just debugging process, had fun with noclip mod I've made, and after that I just noticed the amazing memory viewer with real-time value editing. So, I could see how's the camera made. If geometry is fully done (only texturing left), then this time let's have some fun with the camera. :) I'm on it.

EDIT3: I can in real-time alter camera, but it's still going to fixed location. Still, need to find that "fixed location" address that makes the camera go everytime there.
« Last Edit: 2015-02-09 16:31:50 by MaKiPL »

JeMaCheHi

  • *
  • Posts: 194
  • You can just call me J!
    • View Profile
    • My YouTube Channel :D
Re: [FF8] .x battle fields
« Reply #55 on: 2015-02-09 19:34:27 »
Oh man, that thread caught my attention indeed... Finally someone is researching battlefield scenes. I think the .X files has much to do with the scene.out file...

Mcindus

  • *
  • Posts: 929
  • Artist, Modder, Musician.
    • View Profile
    • Lunatic Pandora
Re: [FF8] .x battle fields
« Reply #56 on: 2015-02-10 02:48:38 »
...here is an example of messed up UV/texture coordinates using Crestian's Railroad texture for Balamb town -



Hey guys - I know this is off-topic, but it has to do with the UV/Walkmesh - and since that seems to be a hot topic, I'm posting this here in the hopes that someone knows what's going on with the UV/Walkmesh in the open world areas.  You cracked that .x file in NO time and you're work is really interesting to watch unfold! 
As you can see, the railroad texture doesn't line up with the tiles near it, but the textures are correct.  If you look closely at the front (or back) of the train station, you can see where the textures combine and the town model warps into the upper corner.  You can easily see this on the Balamb Garden texture as well - textures are zoomed too closely and edges are blown out of proportion in places.  Kaldarasha believes that the walkmesh may be 'doubled' over itself? The PSX version does not do this.

Here is to your amazing-ness.  I hope this can be solved - it would help the texture replacement process become so much more worthwhile.

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] .x battle fields
« Reply #57 on: 2015-02-10 08:57:28 »
Of course I'm going to work on worldmap next. :)
Didn't touch the walkmesh yet, but as far as I just fast looked on those files is:

Wmrail is set of points. Probably points telling where tracks should go, just like splinemesh in UnrealEngine, but I'm not sure yet.
Wmtex is just a file containing textures only
Wmset is a file containing balamb garden model, train models, probably towns, consist similiar geometry data as levels and characters.
Wmsetus - almost same as above, but does have some differences?
And that biggest 20 MB file. Didn't test it out, but appears it doesn't have any textures in it.

I'll finish this .x file (texture support, and tool for it), then I'll start on worldmap. 

Halfer

  • *
  • Posts: 142
    • View Profile
Re: [FF8] .x battle fields
« Reply #58 on: 2015-02-10 12:28:47 »
Great MakiPL, I'm glad that you can understand this so well and are willing to make tools for editing these files! Looking forward to these tools! :D.

P.S. I also wonder if we can someday change the restriction of texture sizes and other limits in the FF8 somehow.

JeMaCheHi

  • *
  • Posts: 194
  • You can just call me J!
    • View Profile
    • My YouTube Channel :D
Re: [FF8] .x battle fields
« Reply #59 on: 2015-02-10 12:33:38 »
Of course I'm going to work on worldmap next. :)
Didn't touch the walkmesh yet, but as far as I just fast looked on those files is:

Wmrail is set of points. Probably points telling where tracks should go, just like splinemesh in UnrealEngine, but I'm not sure yet.
Wmtex is just a file containing textures only
Wmset is a file containing balamb garden model, train models, probably towns, consist similiar geometry data as levels and characters.
Wmsetus - almost same as above, but does have some differences?
And that biggest 20 MB file. Didn't test it out, but appears it doesn't have any textures in it.

I'll finish this .x file (texture support, and tool for it), then I'll start on worldmap. 

Wow, we'll take your word for it. That will be a really amazing tool indeed.

Mcindus

  • *
  • Posts: 929
  • Artist, Modder, Musician.
    • View Profile
    • Lunatic Pandora
Re: [FF8] .x battle fields
« Reply #60 on: 2015-02-10 18:58:18 »
Of course I'm going to work on worldmap next. :)
Didn't touch the walkmesh yet, but as far as I just fast looked on those files is:

Wmrail is set of points. Probably points telling where tracks should go, just like splinemesh in UnrealEngine, but I'm not sure yet.
Wmtex is just a file containing textures only
Wmset is a file containing balamb garden model, train models, probably towns, consist similiar geometry data as levels and characters.
Wmsetus - almost same as above, but does have some differences?
And that biggest 20 MB file. Didn't test it out, but appears it doesn't have any textures in it.

I'll finish this .x file (texture support, and tool for it), then I'll start on worldmap. 

You are amazing. :*)  I've upscaled the entire worldmap from the original textures and inserted it using Tonberry - but with this news, I'm going to continue my full worldmap texture replacement pack.  Currently, I've only done Balamb justice and no one has done anything to the towns because they are the most common objects to have messed up coordinates. 
Thank you!!

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] .x battle fields
« Reply #61 on: 2015-02-12 21:45:23 »
Just started writing that tool. God, that's so time consuming. My code is a total mess, but I do learnt some important things like how to deal with padding, how to read model and etc. Paul wrote, he'd help me with this tool if it'd be on QGears. :)

I already wrote some info dumpers for these stage models. I'll release one. It's no more than a just tool that say's where script, texture, camera and geometry sections are, it's length, vertices count, quad location and quad count. Only for first object. Also can rip .TIM texture.

https://www.dropbox.com/s/atp478d41trqk20/StageDump.zip?dl=0 (source included)

There's also another one, but it's still not fully working. Just give me a couple days, and we make it. :)
Thanks!
« Last Edit: 2015-02-12 21:47:17 by MaKiPL »

paul

  • *
  • Posts: 179
    • View Profile
Re: [FF8] .x battle fields
« Reply #62 on: 2015-02-12 22:43:42 »
Chrome thinks your zip is malware and won't let me save it.

Covarr

  • Covarr-Let
  • Administrator
  • *
  • Posts: 3941
  • Just Covarr. No "n".
    • View Profile
Re: [FF8] .x battle fields
« Reply #63 on: 2015-02-13 02:07:39 »
Chrome thinks your zip is malware and won't let me save it.

Go into the downloads window (Ctrl+J), find the download, and click "recover malicious file". You can save it from there, just not from the normal download bar.

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] .x battle fields
« Reply #64 on: 2015-02-13 21:31:46 »
@UP - Yup, browsers automatically scans what's inside .ZIP file, and it sees it's .EXE. There's totally no malware inside it, but some antivirus softwares can just report is as "potentially risky". It's by the way just a stupid header dumper, that's all.

Getting back to World map. Wmrail is just some crap file. It does NOT contain the road/track points. It does contain some hardlinked path's to FFVIII work exe. Also, to prove, the roads and tracks are in fact in wmset.obj, here's the proof:

Also, I hacked the camera. Finally, we can see that the world map is not loaded fully, but only it's part that are set to be visible. Researching 30 MB file is still painful. It has 16 bytes triangles in it. (Same as characters/enemies, for battle stages it's 20 bytes for triangles).



@Getting back to Battle stages - I'm researching camera now. Debugger is doing the job much faster than normal HEX reversing.
« Last Edit: 2015-02-13 21:54:51 by MaKiPL »

Halfer

  • *
  • Posts: 142
    • View Profile
Re: [FF8] .x battle fields
« Reply #65 on: 2015-02-14 07:22:53 »
Wow cool! Especially with the camera shot!

Do the world map files contain the same headers as other files? I wonder if the rendering settings are fixed in the executable or maybe it's a setting in wmx.obj?

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] .x battle fields
« Reply #66 on: 2015-02-15 15:32:17 »

Do the world map files contain the same headers as other files?

Unfortunately, they not. BUT! They contain some weird:
AKAO

Also, ran my info dump test, to see if it does contain some data as stage had. Nor script, camera, geometry data was found.
I think this wmx.obj is an archive.

Oh, going back to stages, here's the cake:
~350 poly. This is Tomb of unknown king level.
See this triangle holes? It's because it contained triangles, and triangles wing order is a thing I can research in minutes. ATM it's neither ABC nor ACB. So, there's like 9 possibilities to try. :) For quad it was ABCD>ABDC.
Forget it. I just wrongly calculated the triangles (I put the triangles manually). This should be uint16, instead I made it normal int. It works now.


EDIT:
Oh, forgot to wrote. I debugged battle camera today. After 30 minutes I could alter both camera rotation (signed 16 bit), its "skew". Even force the camera to move from orthographical image, so I could just look at "2D plane with moving texture" from side. Still I can't find X Y Z of camera in World.


EDIT2:
I am having hard time with UV's. Here's so far:

24 bytes quad:
Code: [Select]
uint16 X;
uint16 Y;
uint16 Z;
8 bytes of faces

Left 16 bytes:
Code: [Select]
Sample:
60 21 40 3c 40 21 b2 00 80 01 40 01 64 64 64 2c
Probably:
UU UU OP IX IX UU UU XX UU UU UU UU AM1 AM2 AM3 IX
Where:
UU - U or V of texture
OP - opacity sbyte/char (?)
IX - Texture ID, like I don't know...
XX - changing makes the texture go away?

AM:
AM1 - R (red) byte
AM2 - G (green) byte
AM3 - B (blue) byte

Yes, the texture can be colorized just how you want. :)
« Last Edit: 2015-02-15 18:28:05 by MaKiPL »

Yagami Light

  • *
  • Posts: 173
    • View Profile
Re: [FF8] .x battle fields
« Reply #67 on: 2015-02-15 18:42:46 »
Nice progress being made, Vehek posted some great info for wmset.obj and wmsetus.obj
in here for the world map if you haven't read it.
http://forums.qhimm.com/index.php?topic=13799.0

I think the majority of the world map geometry is all stored in the big file wmx.obj

Reverse bytes made this happen



Problem is the file is pretty big, and you have to ride the ragnarok around whole map the spot differences.



Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] .x battle fields
« Reply #68 on: 2015-02-15 18:59:09 »
Nice progress being made, Vehek posted some great info for wmset.obj and wmsetus.obj
in here for the world map if you haven't read it.
http://forums.qhimm.com/index.php?topic=13799.0

I think the majority of the world map geometry is all stored in the big file wmx.obj
Reverse bytes made this happen



Problem is the file is pretty big, and you have to ride the ragnarok around whole map the spot differences.




Thanks, that sure is really much info. :)
If he found the model offset and how it corresponds with texture, then I can examine model itself.
Yagami, could you write which offset was that? That would help me much. Thanks! :)

Yagami Light

  • *
  • Posts: 173
    • View Profile
Re: [FF8] .x battle fields
« Reply #69 on: 2015-02-15 19:22:05 »
here is the bytes I reversed I will keep trying till I affect the towns


Halfer

  • *
  • Posts: 142
    • View Profile
Re: [FF8] .x battle fields
« Reply #70 on: 2015-02-16 09:29:31 »
Okay, I liked to jump a bit for wmx.obj and what i found out is that this file is containing the sea quads of the world:

There seems to be a header starting with 20 19 01 00 , and nullifying every corresponding variables it gave the following results.



Here you can see how to sea is formed from big quads.
EDIT: Also worth to mention that I wasn't able to pass those empty blocks with ragnarok meaning that there is some sort of collision when land (or sea) is removed

That's interesting yagami light. I reversed a big chunk of bytes from that offset and it did very odd stuff following hard lock. Although the ff8.exe seemed to eat my CPU while it was freezed so I don't know what I did wrong :D

Also I would appreciate if MakiPL could say how you managed to hack that camera like that! Would really help a lot! :D
« Last Edit: 2015-02-16 09:31:57 by Halfer »

LeonhartGR

  • *
  • Posts: 2577
  • ~Whatever...~ Enjoy life!
    • View Profile
    • LeonhartGR Productions
Re: [FF8] .x battle fields
« Reply #71 on: 2015-02-16 09:32:40 »
Awesome progress guys! Keep it up!

Yagami Light

  • *
  • Posts: 173
    • View Profile
Re: [FF8] .x battle fields
« Reply #72 on: 2015-02-16 11:33:06 »
Okay, I liked to jump a bit for wmx.obj and what i found out is that this file is containing the sea quads of the world:

There seems to be a header starting with 20 19 01 00 , and nullifying every corresponding variables it gave the following results.


Here you can see how to sea is formed from big quads.
EDIT: Also worth to mention that I wasn't able to pass those empty blocks with ragnarok meaning that there is some sort of collision when land (or sea) is removed

That's interesting yagami light. I reversed a big chunk of bytes from that offset and it did very odd stuff following hard lock. Although the ff8.exe seemed to eat my CPU while it was freezed so I don't know what I did wrong :D

Also I would appreciate if MakiPL could say how you managed to hack that camera like that! Would really help a lot! :D

Those big quads are actually smaller quads combined see here



the engine seems to run slow if you modify even a small bit of the wmx file, I've had times when the vertex got moved high up in the sky and moving near it caused ragnarok to fly high up going crazy till you moved away, and reverse byting too much leads to ff8 not responding when you fly near the affected area, just something you have to be careful of.
« Last Edit: 2015-02-16 11:35:08 by Yagami Light »

Halfer

  • *
  • Posts: 142
    • View Profile
Re: [FF8] .x battle fields
« Reply #73 on: 2015-02-16 11:40:14 »
I see, anyway they seem to be "unmodified" particles meaning that every quad is similiar thus the effect seen in first image. The reason why there is still sea left in my screens means that vertice group is modified by landscape and has a different variables in place of 20 19 01 00. That may be a count or reference to something.

Kaldarasha

  • *
  • Posts: 2449
  • Prince of Model Editing
    • View Profile
Re: [FF8] .x battle fields
« Reply #74 on: 2015-02-16 12:41:13 »
Now where I see the wire it looks like that they have baked the world map and the objects together. That might be the reason why the UV for the tile don't work anymore. I assume that on PSX objects (roads, cities, etc.) are placed on the world map in realtime. Maybe they couldn't done it for PC and simply baked everything together.

Seems like we need to extract the wm from the PSX version and fix the PC rendering. Hopefully this is doable.  :?