Saturday, March 6, 2021

Repost from Neko-Sentai: Setting Vertex Weights in Virtual Reality Studio (VRS)

The following is a repost of an old thread that was originally posted in September of 2018 on the Neko-Sentai forums. The thread discusses how to set vertex weights in Virtual Reality Studio (VRS). The forums also contain a fair amount of adult content, so consider this your fair warning if you decide to visit the page.

Neko-Sentai » FFXI DAT Section » FFXI Modders Corner
Another animation problem with Skirt

09-04-2018, 05:35 PM
candypants2

I'm trying to make the mithra byakko skirt look tighter and shorter. When she walks and does other animations, the back of her skirt disappears into the back of her ass. Can anyone point me in the right direction to solving it?

Attached Files:
dat 127-63.DAT (110.1 KB, 69 views)
09-05-2018, 01:30 AM
crinton

The skeli rig for the pants and the legs are off you need to manual set the weights for the shorts I can go into more detail later if you don*t know how to do it. About to finally get my computer up and running and I*ll make a few more trust mods.

09-05-2018, 04:20 AM
candypants2

Thanks for getting back. Yes if you could let me know more details on how to fix the weights, that would be great! Send me a PM if you need VRS8.

09-09-2018, 08:47 AM
candypants2

Small update

Just wanted to post an update of where I am. I found where the weights are configured. I guess I need to re-bind the faulty vertex's to different parts of the skeleton?

I am also not sure what the actual weight values mean. They go from 0.1 to 1 and even the smallest change seems to mess it up badly.

Here's a couple of screenshots:

09-20-2018, 06:21 PM
KorithXI

Each vertex can be assigned to 1 or 2 skeleton bones. If you want the end result to make any sense, the total value should add up to 1. In your screenshot, it only adds up to 0.9. Also, you aren't limited to only 0.1 increments. You could do 0.45 and 0.55 too.

In terms of what they mean, it just means how closely that vertex follows that bone. If a vertex is set to 1.0 on a bone, it will follow it completely. If it's only 0.5, it would only move half as far as the bone did. When assigned to two bones, it will combine the results. Ex:
- Vertex 1 is connected to bone 1 with a value of 1.0
- Vertex 2 is connected to bone 1 with a value of 0.5 and bone 2 with a value of 0.5
During an animation, bone 1 moves 4 units to the right. Bone 2 moves 2 units left and 2 units up. The result is that vertex 1 would move 4 units to the right, just like bone 1 did. Vertex 2 would get moved 2 units to the right (since it only moves 0.5x as far) but then it would also move 1 unit left and 1 unit up, because it follows bone 2 as well (but again, only 0.5x as far). The result is vertex 2 would go up 1 and right 1.

It's really a process of trial and error. Adjust the weights a little, export and see if it clips too much. A good starting point is often to select a nearby vertex on the underlying model and see what their weight is.

Given how high you've raised the skirt, you'll probably want the first two rows of vertices to be bound mostly to the pelvis skeleton. The second row might need a bit on the legs or flaps, but it might also be fine on just the pelvis. The third row looks like it's not clipping too bad, so it might be ok as-is.

Skirts are especially annoying, since the game doesn't have any proper skeleton bones for them. You have to make due with these bones (bone numbers are for Mithra):

  • 3 - Pelvis
  • 5,11 - Upper Leg
  • 16 - Upper Front Flap
  • 17 - Lower Front Flap
  • 18,20 - Upper Side Flap
  • 19,21 - Lower Side Flap
  • 24 - Upper Back Flap
  • 25 - Lower Back Flap
  • 26,27 - Lower Back Flap Sides
  • 22,23 - Thigh Guards

To get a better idea of how they're used, you can look at like the Wool Robe. It uses all of those except 22 and 23, which are used for metal plate armor, like the Breastplate.

09-21-2018, 08:08 PM
candypants2

Thank very much for the info. This has helped me fix the skirt. I will publish the results soon with all the AF brands.

Huge thanks again ^^

09-21-2018, 08:48 PM
candypants2

The outcome

[CENSORED]

FFXI Tool

Some of you may remember an old 3rd-party program called FFXI Tool that was created way back in 2006 by some Japanese guy. I think he went by the username "Tomato," and his code is the original reverse engineered code from which all other FFXI model viewers (including Noesis) are derived. Here's some links for anyone who's interested:

FFXI Tool Official Website:
http://cosmosa.jp/ffxitool/

解析メモ
Kaiseki Memo (Analysis Memo):

http://cosmosa.jp/ffxitool/kaimemo.html

ジェネレーター 解析メモ
Jenerētā Kaiseki Memo (Generator Analysis Memo):

http://cosmosa.jp/ffxitool/generator.html

ジェネレーター データ番号使用表
Jenerētā Dēta Bangō Shiyō-hyō (Generator Data Number Usage Table):

http://cosmosa.jp/ffxitool/gene.html

メモというぼやき
Memo to iu Boyaki (A Murmur Called a Memo):

http://cosmosa.jp/ffxitool/note.html

Basically the above links are an analysis of how several of the data flags on the FFXI models are used. This should be very useful to anyone trying to mod FFXI models in any significant way. Note that it's all in Japanese, so you'll probably have to use Google Translate to understand it (unless you can read Japanese, of course).

On the FFXI Tool website, there are four email addresses listed, which I assume are the emails for the team members who created FFXI Tool. The project lead appears to be the one named "Tomato."

メールは f on2 あっと c o s m o s a . j p です。
以前使用していた、
http://members.at.infoseek.co.jp/tomato1980/ffxi/
fo@cosmosa.jp
akake@platon.co.jp
tomato1989@lycos.jp
salsa877@hotmail.com は 現在利用不能となっています。

Putting the above through Google Translate gives us this:

The mail is f on2 and c o s m o s a .jp.
I used to,
http://members.at.infoseek.co.jp/tomato1980/ffxi/
fo@cosmosa.jp
akake@platon.co.jp
tomato1989@lycos.jp
salsa877@hotmail.com is currently unavailable.

If you want to try contacting the creators of FFXI tool, there you go. But be forewarned, they're Japanese, and as such, probably don't speak English. Also, I have no idea if any of them still check those email addresses or not.

Mooshywooshy's blog

Ashenbub recently informed me about an old blog from a longtime FFXI modder by the name of Mooshywooshy. Check out his stuff. It's pretty neat.

Mooshywooshy's FFXI Modding Blog

The most recent post appears to be from 2012, so he's most likely retired from the FFXI modding scene at this point, but still some good stuff there.

Monday, February 3, 2020

Noesis updated! Improved compatibility and new features for FFXI

Rich Whitehouse, the creator of Noesis, has recently decided to make some improvements to the program's compatibility with FFXI when users told him that Square-Enix's new game client was crashing Noesis. While Rich was fixing the problem, he added support for FFXI's bump maps, along with a new advanced command (-ff11hton #) to automatically convert those bump maps into normal maps that can be used by modern engines, such as Unity and/or Unreal Engine 4. Make sure to update your Noesis client to the latest version (v4.4191) to get these new features!
New Advanced Commands for FFXI in Noesis version 4.4191:

FF11 Model/Data:

CommandPurpose
-ff11bumpdir <arg>specify directory for bump textures.
-ff11hton <arg>convert height to normal maps, arg=z factor.
-ff11nolodchangedon't try to switch to lod0.
-ff11mapbonescreate bones for map objects.
-ff11keepnames <arg>1=keep map object names, 2=w/index prefix, 3=w/subobj.
-ff11noshinyno special assignment for shiny materials.

Tuesday, January 29, 2019

Separating Out Grass Meshes When Creating a Custom UCX Collision Mesh

This tutorial will teach you how to separate out grass meshes (and other non-solid objects) from the environment when creating a custom UCX collision mesh for use in Unreal Engine 4. The purpose of doing this is so that if you want to convert FFXI's graphical meshes into a collision mesh instead of using FFXI's official collision meshes for whatever reason (such as enhanced collision accuracy or getting rid of invisible walls), grass objects won't become solid blocks (like they are in this video), but rather will allow the player to pass right through them like in the official version of the game. Also, removing the grass objects from the rest of the environment and importing them as their own separate object gives us the ability to make them subject to wind dynamics,which improves the player's sense of immersion in the game world. We will be using 3Ds Max for this tutorial. Another tutorial on how to do the same thing in Maya will be posted at a later date.

Tutorial by Evenger, edited and expanded by Rhianu

Step 1: Import your FBX file into 3Ds Max
I'm assuming here that you have already exported the zone you wanted from Noesis and saved it as an FBX file.

File → Import → Import...

Navigate to and select the zone FBX file which you exported using Noesis, and then click "Open" to import it.

Under the "Advanced Options" section in the FBX Import window, put a check mark in the checkbox labeled "Automatic" to ensure that unit scale is converted automatically.


Step 2: Separate and collapse the grass objects
Select the item you wish to separate. Look for the matching names on the list to select them faster. This can be done with any object, but in this tutorial we're focusing on grass, so only select the grass objects.

Here I have all the grass selected. It is called "kusa," which is the Japanese word for "grass." (  )

Once you have all the grass objects selected, hit the "Collapse Selected" button to combine all the grass meshes into one single mesh.


Step 3: Hide the new combined grass mesh
Click on the icon that looks like an eye to hide the grass mesh.

The grass objects should all become invisible (hidden) when they are disabled by toggling off their visibility via their corresponding eye icon.


Step 4: Delete all the other meshes
Delete everything in the scene except for the grass meshes.

Select All (Ctrl + A) → Delete

Your scene should now be completely empty (except for the grass mesh, which is still hidden).


Step 5: Unhide your hidden grass mesh and export
Unhide your combined grass object by toggling its visibility via the eye icon again.

Your grass objects should be the only thing left in the scene.

Finally, export your combined grass mesh.

File → Export → Export...

Save your grass mesh as an FBX file, and you're done! Just import it into your UE4 project and you should be good to go.

Friday, December 28, 2018

Source code and project files for RZN's MapLib & MapViewer now available!

Big announcement, everybody! Our good friend atom0s managed to finally get ahold of RZN today, and RZN gave atom0s full permission to share the source code and project files for his old MapLib and MapViewer projects in the hopes that doing so will help others in FFXI's modding community. For those who don't know, these two programs are essentially model viewers for zones (MapViewer for viewing the zones, and MapLib for extracting and saving the zones). RZN's source code and project files used to be available on an old version of the FFEvo website which, unfortunately, was lost in a hardware failure back in 2015. FFEvo itself has since returned, but none of the old data could be recovered. Thankfully, atom0s had a backup copy of RZN's source code and project files saved on his own personal hard drive, and he has apparently been sitting on these files for several years. Though out of respect for RZN's privacy, atom0s has been keeping the files to himself until such a time when he could manage to contact RZN and get his permission to share the files with others. And on the morning of Friday, December 28th, 2018, that's exactly what happened! Contact was finally made, and RZN gave atom0s his blessing to share his source code and project files with the world.

You can download RZN's projects below:


Downloads:

Source Code & Project Files:
RZN's MapLib
(Size: 12.0 KB)

  • Source code to the MapLib project by RZN.
  • This lib can open and dump the map DAT files for all areas before the Adoulin expansion.
  • Permission was granted by RZN to allow atom0s to share this source code on Dec. 28, 2018.
  • The source code in this repository is © 2015-2018 to RZN.
RZN's MapViewer
(Size: 40.0 KB)

  • Source code to the MapViewer project by RZN.
  • Permission was granted by RZN to allow atom0s to share this source code on Dec. 28, 2018.
  • The source code in this repository is © 2009-2018 to RZN.
NOTE: In order to compile and run the above source code, you will need to either install the DirectX9 SDK, or at least download the d3d9 header files and libs, and then in Visual Studio add an include path to wherever you saved them.


Compiled, Stand-Alone Applications:
RZN's MapLib
(COMING SOON!!!)

Program library used to generate data -- i.e. extract and save the 3D geometry of zone/areas so they can be imported into other programs. MapLib can read all zones except the ones from the last expansion pack, Seekers of Adoulin.
RZN's MapViewer
(Size: 144 KB)

Application used to view maps (the word "map" here refers to the 3D geometry of the zones/areas).

The following is a simple set of instructions I've put together.

Controls:

Key

Action

Up Arrow Key Move foreward.
Down Arrow Key Move backward.
Right Arrow Key Rotate clockwise.
Left Arrow Key Rotate counterclockwise.
Page Up Move down.
Page Down Move up.
Ctrl Increase speed.
Home Reset position.

Wednesday, December 19, 2018

GalkaReeve's Map Viewer — Model Viewer for Zones

Since 2016, the source code of an unfinished map viewer program for FFXI has been available on the GitHub respository of a Reddit user known as GalkaReeve. You can either download his original source code and project files and compile them yourself, or you can download a standalone application which I compiled myself. The link to the already compiled version is provided further down below in this blog post.

Download Source Code & Project Files:
GalkaReeve's GitHub repository
(Size: 212 MB)

    19 May 2016

    • fix a bug that cause premature stop in extracting dat. Main reason why some dat have missing MMB & img.
    • add a default VAO creation, to fix no Model/Map display for window 10. User need to update latest glm/glfw3 as well, else it will generate compile error.
    • fix DXT3 convert error, should be using BCD2Decode.
    • NOTE: for user that encounter GLFW3 crash when calling glfwInit(), u have to goto Project Properties -> C/C++ -> Code Generation -> Runtime Library, change /MDd to /MD

    7 June 2016

    • fix transparency for mapViewer
    • add func 'v' to view individual Model within each MMB.
    • Note: mapViewer uses VisualStudio NuGet Manager for opengl, glfw2, glew. The packages is 'nupengl.core' access thru 'Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution'
    • Remember to change --- char ffxidir[512]="E:\Program Files (x86)\PlayOnline2\SquareEnix\FINAL FANTASY XI\"; to your folder.
In order to compile GalkaReeve's code, you will need to setup OpenGL Mathematics (GLM) in the project after you've downloaded it. GalkaReeve's code requires GLM, but does not include it. If you're having difficulty figuring out how to setup GLM, watch the following YouTube video tutorial:
Note that the above video is a generic tutorial about setting up GLM for any project, and is not specifically related to GalkaReeve's Map Viewer, or even to FFXI. It's just about setting up GLM in Visual Studio. I did not make this video.

If you'd like additional information about the project from GalkaReeve himself, there's an old Reddit post of his from three years ago, which you can read at the following link:

Reddit Topic: ffxi dat reverse engineering

As you can see, GalkaReeve has (or rather had) multiple FFXI projects in the works, but his mapViewer program is the one I want to focus on. The program hasn't been updated by GalkaReeve himself since 2016, so I'm assuming he has abandoned the project. And so, for the sake of everyone's convenience, I've taken the liberty of compiling his source code into a standalone application and uploading it to my own DropBox account. You can download the program at the following link:

Download Compiled, Standalone Application:
GalkaReeve's Map Viewer
(Size: 2.04 MB)

    At the moment, this program only works if you have FFXI installed in the default directory, which is as follows:

    C:\Program Files (x86)\PlayOnline\SquareEnix\FINAL FANTASY XI\

    If you have FFXI installed in any other directory, or under any other drive letter besides the 'C' drive, the Map Viewer program will not run. I plan to eventually fix this when I have time, but I don't know when that will be.


The following is a simple set of instructions I've put together. Note that I figured out these commands through my own experimentation with the program, and as such, this list may be incomplete.



Controls


Standard Mode:

Key

Action

Notes

ESCQuit ProgramExits the program.
Arrow KeysMove aroundAllows user to navigate the zone by moving the camera around.
MouseAim Camera Allows user to point the camera in a particular direction.
Page UpNext ZoneLoad the next zone.
Page DownPrevious ZoneLoad the previous zone.
WToggle wireframe modeToggles between normal rendering and wireframe rendering.
JGet ID of geometry piece?Warning!!! Crashes the program!!!
CDraw CubeDraws boxes around each geometry chunk.
XToggle model inclusive/exclusiveSeems to toggle between two pieces when viewing an individual chunk.

Visible Set Mode:

Key

Action

Notes

SEnable potential visible set*
DUnknown subcommand*
FUnknown subcommand*
* I haven't figured out how to enable visual sets, so I can't tell what any of the above commands actually do. However, I do know that with no visual set enabled or selected, pressing either 'D' or 'F' prints the following line of text to the console window:
"press S to enable Potential visible set"

Dual Camera Mode:

Key

Action

Notes

GToggle Dual CameraEnables a second rendering camera separate from the viewing camera.
EToggle EyeWhile Dual Camera mode is enabled, press 'E' to activate the "Eye" (i.e. second camera) and use the arrow keys and/or mouse to move the Eye around.
CDraw Cube / View FrustumDraws boxes around each geometry chunk, and also draw the Frustrum (viewing cone) of the "Eye" (second camera)

Octree Mode:

Key

Action

Notes

ORemove octreeToggles between viewing the entire zone and viewing one individual chunk of geometry.
MSwitch between MMB/MZBToggle between object prefabs (MMB) and instances (MZB).
VView sub-pieceCycle through all the various sub-pieces of the currently selected individual chunk.*
*Pressing 'V' outside of Octree Mode prints the following line of text to the console window:
"To view individual MMB/MZB, press 'O' to remove octree, 'M' to switch, 'V' to view subPiece"



There may be more that this program can do, but those are all the functions I can figure out for now. If anyone else thinks they can add to this list, please let me know. Thanks.

Friday, December 14, 2018

JediFirefly Gaming: Old DAT Modding Tutorials from 2008

Here's some old videos from ten years ago (Jesus Christ has it really been that long!?) that go over some of the basics of simple DAT swapping, as well as editing models in a program called Virtual Reality Studio (VRS). I did not make these videos. I'm simply sharing them here for the sake of convenience.

DAT Modding Part 1 - Basic DAT Swapping:


Basic DAT Swapping - Taking 1 in-game model and switching it for another.

DAT Modding Part 2 - Basic DAT Swapping 2:


Basic DAT swapping using downloaded DAT mod's instead of in-game models.

DAT Modding Part 3 - Basic DAT Editing:


Basic DAT editing - Removing unwanted parts of an armor model.

Tuesday, November 20, 2018

AreaDemo Patched to Work With North American Client

Many of you probably remember the old AreaDemo program I talked about back in April of 2017. Well, one of the people who's been helping me with my zone conversion project, a guy who goes by the username atom0s, has taken the initiative to hack AreaDemo and do a custom patch that allows the program to work with the North American version of FINAL FANTASY XI. As a result, AreaDemo is now brain dead easy to use, whereas before it was a huge pain in the ass.

You can download this new patched version of AreaDemo from the following Dropbox folder:

Dropbox Download:
AreaDemo.US.patch.by.atom0s.7z

And if you happen to bump into atom0s anywhere, be sure to tell him thanks!

List of Model Viewer Programs for FINAL FANTASY XI

There are several different model viewing programs for FFXI, and it can be difficult to keep track of them all because they're spread out over many different websites and forums. That's why I decided to put together this list, so people could have a centralized hub that would make it easy to find whatever program they were looking for.

Character Viewer Programs:

Zone Viewer Programs:

Other Community Resources:


Other links and resources will be added to this list as I learn of them.

Fixing Noesis Exports in Maya

While it is certainly possible to just import an FFXI zone model directly into Unreal Engine 4 (or Unity, if that's the game engine you prefer), sometimes it helps to fix the zone up first by editing it in a 3D modeling program such as Maya or 3Ds Max (both published by Autodesk). There don't appear to be any major issues when importing FFXI zone models into 3Ds Max, so I won't bother covering that. However, there are some relatively minor issues that occur when importing FFXI zone models into Maya, and this tutorial will go over how to fix them.

The first issue is that Maya doesn't like for there to be any whitespace in the names of object meshes, materials, or texture nodes. If Maya encounters any whitespace characters in names of these object nodes, it will replace each instance with some variation of "FBXASC0##" (the ## will be either 32, 48, or 49). This is of course assuming you exported your FFXI zone model as an FBX file using Noesis. If you exported using the OBJ file format, you'll probably get something different.

For this tutorial, I loaded the zone Ru'Aun Gardens, which should be located at ROM2/12/107.DAT in the FFXI root directory, and I used the following advanced options in Noesis:

Advanced Load Options:

-ff11blendhack 0.99 -ff11renderunref -ff11keepnames -ff11optimizegeo

Advanced Export Options:

-rotate 180 0 -90 -fbxsmoothgroups -fbxtexrelonly -fbxtexext .tga

I exported the model as an FBX, and used TGA as the file format for my textures. I then opened up a new scene in Maya, and imported the FBX file I had just created. This was the result:


Pretty ugly, right? Nobody wants to deal with object names like that. It's impossible to read! Thankfully, this problem is incredibly easy to fix. Simply go to the "Modify" dropdown menu on the main toolbar, and then select the "Search and Replace Names..." option about halfway down.


In the options box that pops up, simply type "FBXASC032" the field labeled "Search for:", and type an underscore in the field labeled "Replace with:". (An underscore is that short little line character: "_". We use an underscore instead of a space because Maya doesn't like whitespace.) Then just hit the "Apply" button multiple times until every instance of "FBXASC032" has been replaced with an underscore.


Then do the same thing again, except this time search for instances of "FBXASC048" and replace them all with an underscore followed by the number zero (i.e. "_0"). And finally, repeat the process a third time for instances of "FBXASC049" and replace them all with an underscore followed by the number one (i.e. "_1").

Search for:Replace with:
FBXASC032_
FBXASC048_0
FBXASC049_1

Note that you will have to click the "Apply" button many, many times when replacing instances of FBXASC032, but instances of FBXASC048 and FBXASC049 should only require a single click each. When you're done, the names of your mesh geometry should look something like this:


There we go, that's much better!

Double-check the Hypershade window (Windows → Rendering Editors → Hypershade) to ensure that the naming problems have also been fixed on all of your materials, textures, utilities, and shading groups. We don't want there to be any naming issues anywhere.


This should fix all the naming problems that occur when importing FFXI zone meshes into Maya.

This tutorial is a work in progress. If I encounter any other issues with importing FFXI zone geometry into Maya, I will add them into this tutorial.

Tuesday, October 23, 2018

Quick Start Guide: Importing FFXI zones into Unreal Engine 4

This tutorial will teach you how to extract zones from FINAL FANTASY XI and import them into Unreal Engine 4 using a program called Noesis. You will need to have FFXI installed. You can download the FFXI game client from the game's official website. It is not necessary to actually have an active FFXI account in order to extract the zone files. Simply having the game installed is enough, though if your game client is not updated, you will be unable to load zones that were added to the game via updates.

Loading Into and Exporting From Noesis:

The first step is to create or download a Noesis scene file, which is just a text file, except that it uses the extension ".noesis" instead of ".txt" like a regular text file. You can edit the Noesis scene file in Windows Notepad, or any other standard text editor. Notepad++ is a good option, too. When creating or editing a scene file, note that white space doesn't really matter. Noesis will parse the file the same regardless of whether you use tabs or spaces, so use whichever you prefer.

If you would rather just download a ready-made Noesis scene file instead of creating your own, you can grab one from the following Dropbox folder:

Dropbox Download: Noesis Scene Files - FFXI Zones

A proper scene file should look something like this:


The purpose of creating a scene file is so that you can take advantage of the special advanced load options that Noesis provides. Technically, you can load FFXI's zones without creating a scene file by just opening the corresponding DAT file from within Noesis, but doing it that way doesn't allow you to specify any load options, some of which are necessary to render the finalized geometry correctly after we export it. The load options you want to specify in your scene file are as follows:

Advanced Load Options:

-ff11blendhack 0.99 -ff11keepnames -ff11optimizegeo

There is one advanced load option in particular that I would actually recommend against using unless you have a 3D modeling program and corresponding technical skills, and that's the "-ff11renderunref" command  (i.e. Render Unref), which renders unreferenced geometry — such as the skydome and water pieces — out in the middle of the zone. The reason I recommend against using this particular load option if you're new to this whole process is because the Render Unref command does not position the unreferenced geometry pieces correctly, but instead just spits them all out at identity, thus leaving you to pull them apart and manually place them yourself if you actually want to do anything with them. Trying to do that within Unreal Engine 4 is huge pain in the ass, so you practically need some kind of 3D modeling program to do it effectively and efficiently, and that's going to require more time and effort on your part. If you're just trying to extract a zone using Noesis and import it directly into UE4 as quickly as possible, then it's best to just leave off the Render Unref command.

Anyway, once you've created or downloaded your scene file, open it in Noesis, and then go to "File" → "Export from Preview," which will bring up the Export Media window below:


Click on the "Browse" button and create a new folder named after the zone you're exporting. It's also a good idea to use the zone name as the filename. Next, select the following output options:
  • For "Main output type," select ".fbx - Autodesk FBX."
  • For "Additional texture output," select ".tga - TGA Image."
  • For "Additional animation output," just leave it on "Default" as the selection.
  • For the "Advanced options" field, copy and paste the line of code under the "Advanced Export Options" heading below.
All other options can be left on their default settings.

Advanced Export Options:

-rotate 180 0 180 -scale 90 -fbxscalehack -fbxsmoothgroups -fbxtexrel -fbxtexext .tga
The order in which you list the advanced options does not matter.

Please note that there is a difference between Advanced Load Options and Advanced Export Options. Advanced Load Options do nothing if used as export options, and Advanced Export Options do nothing if used as load options.

A detailed explanation of each advanced option used in this tutorial is provided below:

Advanced Load Options:

-ff11blendhack <arg>

FF11 Blend Hack
sw render to determine alpha coverage, <arg>=min frac.
EXAMPLE: -ff11blendhack 0.99

Technically, this option isn't actually necessary at all. The only thing it does is enable transparencies within the Noesis viewer window. Even if this option isn't used, transparencies will still be exported if you save your texture files in a format that includes an alpha channel.

-ff11renderunref

FF11 Render Unref
render unreferenced map geo at identity.

This option will load in the skydome, the sun, the moon, water pieces, and other unreferenced pieces of geometry which are included in the DAT file but for which there is no position specified. It is assumed that in the official game, these pieces of geometry are placed by either SE's servers or the game client.

-ff11keepnames

FF11 Keep Names
keep map object names intact.

This option will prevent Noesis from renaming the mesh geometry pieces in the scene.

-ff11optimizegeo

FF11 Optimize Geometry
remove degenerates and redundant verts.

This option will combine overlapping and duplicate vertices. Without this option, every individual polygon in the entire scene will technically be a separate piece of geometry, which will cause very hard edges on everything.

Advanced Export Options:

-rotate # # #

Rotate X Y Z
transform all vertices by the given angles.
EXAMPLE: -rotate 180 0 180

Rotates the entire scene by 180 degrees on the X axis and the Z axis. Without this option, your zone will load upside down and backwards when imported into Unreal Engine 4.

-scale #

Scale
scale all vertices on the model, where # is the scale factor.
EXAMPLE: -scale 90

Use this option to increase the size of the zone to the proper dimensions. Without this option, the zone will be too tiny to walk around in when imported into Unreal Engine 4. If you forget this option, you can adjust the "Import Uniform Scale" option when importing into Unreal Engine 4.

-fbxscalehack

FBX Scale Hack
transform override for scale correction.

I'm still not entirely sure what this option does. It sounds likes something to do with the transform (i.e coordinate position) of the geometry, and is to be used in conjunction with the -scale option above. Maybe this command isn't necessary, though? I'm not sure. More experimentation is needed here.

-fbxsmoothgroups

FBX Smooth Groups
generate smoothgroups from vertex normals on export.

Unreal Engine 4 will complain at you if you try to import a 3D model that doesn't have smooth groups.

-fbxtexrel

FBX Tex Rel
only set relative paths for texture filenames.

This option is necessary to preserve the connection between materials and textures. Without it, the filepaths to textures will be incorrect, and models will import as grey and textureless.

NOTE: A previous version of this tutorial listed this option as -fbxtexrelonly instead of -fbxtexrel. Although the command -fbxtexrelonly was correct when this tutorial was originally written, the command was apparently changed in an update to Noesis at some point. I am not certain when exactly this change occurred, but the tutorial has now been updated to reflect this change.

-fbxtexext <arg>

FBX Tex Ext
appends given value to texture names on export.
EXAMPLE: -fbxtexext .tga
EXAMPLE: -fbxtexext .png
EXAMPLE: -fbxtexext .bmp

This option is also necessary to preserve the connection between materials and textures, as it allows you to specify the texture filetype extension. Without this option, UE4 won't be able to determine exactly which texture files its supposed to import for the materials, and so it won't import any, thus leaving your models grey and textureless. If you're saving your texture files in a format other than .tga, then replace ".tga" with the format that you're using.

NOTE: A previous version of this tutorial included an Advanced Export Option called -fbxmtlfrommeshname, which allegedly is supposed to create materials with names matching the pieces of geometry they're applied to. However, the option didn't appear to actually work (at least not for models extracted from FFXI), so I removed it from the tutorial.

Importing into Unreal Engine 4:

When you're importing the FFXI zone geometry into Unreal Engine 4, you'll want to enable the "Combine Meshes" option under the Advanced options for the Mesh section. Otherwise you'll get hundreds of little geometry pieces that will bog down your computer and make rendering a nightmare.


If you used the advanced scale option when you exported your zone from Noesis, then when importing into Unreal you should be able to keep the "Import Uniform Scale" option at its default value of 1.0. If you omitted the scale option in Noesis, then you should set "Import Uniform Scale" to 90.0 in Unreal. If you edit the zone in some other third-party 3D modeling software in between Noesis and Unreal, you may have to experiment with the "Import Uniform Scale" option until you find something that looks correct.


Material Setup:

If you entered the correct Advanced Export Options when you exported your zone data from Noesis, all of the materials should already be hooked up to the correct textures automatically. If everything is gray, go back and try to figure out what you did wrong.

Materials in FFXI can be grouped into four basic types: Standard, Decal, Shiny, and Foliage.

Standard Material Setup:

By default, materials in Unreal Engine 4 are slightly shiny, which does not match the aesthetic of FFXI as presented in the official game client. In order to get rid of the shininess, create a Constant with a value of 0 and plug it into the material's Metallic, Specular, and Roughness channels. Do this for all of the materials (this is very tedious and may take a while). Your finished standard material should look like this:


Decal Material Setup:

Some geometry pieces in FFXI are used as decals to add extra detail to the environment. However, in order to get the decals to display correctly in Unreal Engine 4, you will need to set up the corresponding decal material slightly differently from the standard material above. For decal materials, you should set up the material like this:


Foliage Material Setup:

In order to get materials for bushes and tree leaves to display correctly in UE4, plug the Alpha channel of the Texture Sample into the Opacity Mask channel of the material. Select "Masked" as the Blend Mode, change the Shading Model to "Two Sided Foliage," and put a check in the box for the Two Sided option. The finished foliage material should look like this:




Tuesday, September 18, 2018

Noesis – Advanced Commands

On the surface, Noesis may appear to be a relatively simple and straightforward program. But it actually has a lot of hidden depth to it. Most of this depth comes in the form of special advanced commands for loading and exporting data files. You can view a complete list of all advanced commands by opening the "Export Media" window and clicking on the "Advanced commands" button. The "Export Media" window can be opened by going to "File" in the main toolbar, and then selecting either "Export" or "Export from Preview" from the dropdown menu.

For your convenience, I have compiled a list of advanced commands which are most likely to be relevant when using Noesis to view and export data files from FINAL FANTASY XI. Please note that some of these commands can only be invoked when loading a file, while others can only be invoked when exporting a file! In order to invoke a command when loading a file, you must first use Notepad to create a .noesis scene file which points to the model you want to load, and then open that scene file in Noesis instead of opening the actual file directly. I will explain how to create a .noesis scene file in another post.

I'm still not completely sure which commands can only be invoked on load, and which ones can only be invoked on export, but I will continue to experiment and update this post accordingly. For now, I will distinguish between commands which I know for certain can only be invoked on load or export by marking them with either a red "Load" tag or a blue "Export" tag, respectively. If a command is unmarked, that means either that command works on both load and export, or I am uncertain.



Generic Noesis Commands:

CommandPurpose
-rotate # # #transform all vertices by the given angles. (Order is X Y Z)
-scale #scale all vertices on the model, where # is the scale factor.
(There are many more generic commands than just these two, but so far these are the only ones that I've personally found to be useful when working with data files from FFXI.)



FF11 Model/Data:

CommandPurpose
-ff11blendhack <arg>sw render to determine alpha coverage, <arg>=min frac.Load
-ff11optimizegeoremove degenerates and redundant verts.Export
-ff11keepnameskeep map object names intact.Export
-ff11renderunrefrender unreferenced map geo at identity.Load
-ff11forcelightingforce lighting.
-ff11forcecullforce culling.
-ff11novertcolorno vertex colors.
-ff11noshinyno special assignment for shiny materials.
-ff11shiftvertalpha <arg>explicitly shift vert alpha <arg> bits.
-ff11shiftvertcolor <arg>explicitly shift vert color <arg> bits.
-ff11shiftcolor <arg>explicitly shift tex color <arg> bits.
-ff11shiftalpha <arg>explicitly shift tex alpha <arg> bits.



FF11 SQLE Model:

CommandPurpose
-ff11sqleanim load sqle animation as relative path.Load



Autodesk FBX:

CommandPurpose
-fbxnewexportexports current fbx format instead of legacy.Export
-fbxzupsets the scene axis to z up on export.Export
-fbxsmoothgroupsgenerate smoothgroups from vertex normals on export.Export
-fbxtexrelonlyonly set relative paths for texture filenames.
-fbxmultitakeexport a take for each anim sequence.Export
-fbxbsnonormalsdon't use blendshape normals.Export
-fbxbonestomeshtfderive mesh transforms from bones, and don't write bones.
-fbxpreservecpdoes not allow welding between controlpoints.
-fbxnooptimizedisables fbx geometry optimization pass.
-fbxnoesidecarenables .noefbx sidecar files to preserve extra data.
-fbxcanimtimeuse curve key times instead of clamped evaluator time.
-fbxmtlfrommeshnamecreate materials from mesh names.
-fbxunifybi unifies binormals on import. (0=no, 1=yes, 2=flipped)Load
-fbxrottanrotates tangent/binormals on import.
-fbxnotandisables reading/writing tangents for fbx.
-fbxnoextraframeavoids adding an extra frame for timing.
-fbxframecount overrides the fbx anim frame count.
-fbxframerate specifies the fbx framerate. (frames per second)
-fbxtexext appends given value to texture names on export.Export
-fbxscalehacktransform override for scale correction.
-fbxtritopoly tris to polys, is max degrees for combine.
-fbxtritopolyconctol is concavity tolerance.
-fbxcollapsecpcollapse controlpoints.
-fbxreducekeysreduce animation keys.
-fbxnonlinrotspecifies nearest snap for rotations.
-fbxnomeshhierarchyno separate udcommon mesh hierarchy.
-fbxnomeshbonesno bones generated from mesh nodes.



WaveFront OBJ:


CommandPurpose
-objmtlenables export of mtl file with the obj.Export



DDS:

CommandPurpose
-ddsati2nonormdon't derive+renormalize when decoding DXT ATI2/BC5.



That's all for now. Please comment below if you've found any other of the advanced commands for Noesis to be useful for working with FFXI's data files.

Friday, April 14, 2017

AreaDemo

AreaDemo a Japanese program for previewing a limited number of zones in FFXI outside of the game.

EDIT: Do not bother trying to use AreaDemo for modding purposes. It simply isn't worth the hassle, as I've discovered that everything I was using AreaDemo for can be done using only Noesis. It turns out that Noesis has a built-in Data Viewer tool that allows users to see the file names of all textures and materials on any given DAT file, which means that there's simply no point in going through the trouble of installing AreaDemo simply to get the correct file names for the textures (which is all I was using AreaDemo for, anyway). I'll leave this post up for informational purposes in case you still want to try out AreaDemo simply for the sake of curiosity, but don't feel pressured to download and install it for the sake of modding, and don't bother trying to integrate AreaDemo into your development pipeline. You don't need it.

The primary purpose of using AreaDemo for FFXI zone extraction is to get the texture files, since Noesis (the other model viewing program capable of viewing FFXI's zones) often doesn't correctly save all the textures, and when it does, it generally doesn't preserve the file names of the textures for some reason. AreaDemo does not have this problem, and saves all zone textures with their correct file names intact. Without the correct file names, hooking up texture files to their appropriate materials in Unity, Unreal, or Autodesk Maya becomes an almost impossible guessing game. AreaDemo saves us that trouble by keeping the file names intact.

AreaDemo also converts zone geometry, but unfortunately AreaDemo only saves the geometry data as an MQO file, a custom file format created for the Japanese 3D modeling program, Metasequoia, which is not compatible with either the Unreal or Unity game engines. The most common format of 3D model used in Unity and Unreal is FBX, and although Metasequoia does technically have the ability to convert from MQO to FBX, this feature is only available with Metasequoia's EX License, which costs $150. Because of this, I personally prefer to use Noesis to extract geometry data, and AreaDemo to extract texture data, and then I combine the two in Maya. From there, exporting to either Unreal or Unity is a piece of cake (especially since Maya literally has special menu options specifically for exporting to either Unity or Unreal).

Unfortunately, one major limitation of AreaDemo is that, as far as I can tell, the program appears to only provide its users access to the original zones. That means that there is no way for AreaDemo users to access zones from any of FFXI's expansion packs, not even Rise of the Zilart.

Additionally, it should be noted that AreaDemo only works with the Japanese version of FFXI. This isn't a huge problem, since you don't have to actually purchase the Japanese version, you only have to have it installed, and Square-Enix has made the installation files for FFXI available to download for free from the official website, but it does create an issue in that Square has chosen to make it so that the Japanese version and the North American version cannot both be installed simultaneously on the same PC, which makes this whole process rather annoying for people who don't have multiple computers, or who don't want to dual boot multiple operating systems.

Anyway, relevant links below:
AreaDemo
(requires Japanese version)
FFXI Japanese verison
(required to use AreaDemo)

Wednesday, January 6, 2016

Noesis - 3D model viewer and extraction tool

Noesis is a program for viewing, extracting, and converting digital assets from video games, and was created by a guy named Rich Whitehouse. You can visit his personal website at richwhitehouse.com, or follow him on Twitter @DickWhitehouse. Unlike the FFXI Model Viewer and Altana Viewer, Noesis is a universal model viewer designed to work with (almost) any video game. Thankfully, FFXI happens to be one of the games it works with.

You can get Noesis here.

Advantages:
  • Can view any .DAT file, including zones, not just character models.
  • Can export .DAT file models directly into several standard file formats, including .obj and .fbx formats.
  • Unless specifically disabled by the user (and this is a huge selling point), character models retain skeletons and animations upon export.
Disadvantages:
  • Because Noesis was designed as a universal model viewer for all games, and not a model viewer specifically for any one particular game, the process for loading models involves just using a standard file explorer window for loading files, which makes it a pain to find things if you don't already know exactly where to look. It's recommended that you use either the FFXI Model Viewer or Altana Viewer to find the file locations of the character models you want to load before you go browsing through the FFXI game folders via Noesis. Good luck figuring out which files to load for zones, though.
  • The method for accessing model data for player characters in particular is extremely difficult to use. The process requires creating a custom text file, which is then opened in Noesis. Details on how to create this special text file are provided later in this post.
Download:
Noesis can be downloaded for free from the Resources section on Rich Whitehouse's personal website, richwhitehouse.com. The direct link to Noesis version 4.31 is listed below:
Direct Download: Noesis — version 4.31
(22.28 MB) - (uploaded: 7/14/2018)

It's possible there may have been new versions of Noesis released since I wrote this blog entry. If you prefer to get the most recent version, Rich Whitehouse keeps a page in the Projects section on his personal website updated with the latest version of Noesis, which you can access at the following link:

Alternatively, you can also update your version of Noesis after download by going to "Tools" → "Check for Updates" in the main toolbar in Noesis. Using the latest version is recommended.

XeNTaX Game Research Forum:
Additionally, there is a game modding forum called XeNTaX that has an old topic which is specifically about using Noesis with FFXI, and has some useful information (Rich Whitehouse is the moderator with the screen name MrAdults). You can read the topic here:

Code Snippets:
Rich Whitehouse has provided some of his code on his website.

Viewing Player Character Models:
Viewing, displaying and exporting player character models is extremely tricky in Noesis. To do it, you must create a special scene file using one of two different custom file types created by Rich Whitehouse. The reason for there being two different files types is because everyone who has ever played FFXI knows that the game actually has two sets of character models for player characters. There is the standard, low-resolution player character models that are actually used in-game, and then there's a completely different set of special high-resolution character models which appear only during character creation and then are never seen again. Noesis gives us the ability to view and export both types of character models. The Noesis scenes directory located at "C:\...\noesisv42\scenes" has two example files: one called "sample_elf01ff11.noesis" which is used for the high-resolution character models from the character creation screen, and another called "sample_hume01.ff11datset" which is used for the low-resolution character models from in-game. Both of these file formats can be edited with Notepad or any other text editor.

Hi-Rez Player Character Models (From Character Creation):
In order to view the high-resolution character models which appear only during character creation, you must use this special format of text file called ".noesis", which is one of the custom file extensions Rich Whitehouse created. There is example file called "sample_elf01ff11.noesis" located in your Noesis scenes directory at "C:\...\noesisv42\scenes". When opened with Noesis, this file will display the high resolution character model of the female Elvaan as she appears during character creation. Please note, however, that when Rich Whitehouse wrote this particular scene file, he specified only a partial file path, which results in the scene file only working if you place it inside your root FFXI directory, which should be located at "C:\Program Files (x86)\PlayOnline\SquareEnix\FINAL FANTASY XI," unless of course you specified a custom filepath when you installed FFXI. If you want to save this Noesis scene file anywhere on your computer and still have it work, you will have to specify the full file path in the model line, instead of only the partial path  If only the partial path is specified and not the full file path, and you try to open this Noesis scene file while it is located in any other folder besides the FFXI root directory, you will get an error message. Specify the full file path to avoid the error message.

The following is a post that Rich Whitehouse made on the XeNTaX game research forum explaining how to use the file format:

Originally Posted by MrAdults (Rich Whitehouse)
(Click here to view original post.)

To piece the SQLE models together, you can put a .noesis file in your FFXI directory root (above the ROM directories), like the sample_elf01ff11.noesis file included in the latest build. It looks like this:

sample_elf01ff11.noesis:
NOESIS_SCENE_FILE
version 1
physicslib ""
defaultAxis "0"

object
{
name "body"
model "ROM/63/1.dat"
loadOptions "-ff11sqleanim ../64/40.dat"
}
object
{
name "head"
model "ROM/63/5.dat"
loadOptions "-ff11sqleanim ../64/46.dat"
;this uses the relative positions of the neck joints on each skeleton to place the head
offsetWithBones "bone0001" "body" "bone0004"
;combine both objects into a single model
mergeTo "body"
}

Modifying for other body/head/animation combinations should be pretty obvious. The bones for the head snapping may change, so figure out which ones you should be using by looking at the models in the Noesis data viewer.

Low-Rez Player Character Models (From In-Game):
In order to view the low-resolution character models which are used within the actual game itself, you must use this special format of text file called ".ff11datset" which is a special custom file format that Rich Whitehouse created specifically for use with FFXI in Noesis. You can use this to view and extract the standard in-game player character models with a specific set of armor. There is an example file called "sample_hume01.ff11datset" in the Noesis scenes directory, which shows how to set up the file for a male Hume.

Unlike the Noesis scene files, the FFXI Dat Set file does not require the full file path to be specified in order to work outside of the FFXI root directory.

Like the other scene file, this file also can be edited with Notepad or any other text editor. You can use the FFXI Model Viewer or Altana Viewer to figure out which DAT files to specify in the text file.
sample_hume01.ff11datset:
NOESIS_FF11_DAT_SET
;^ must be the first line of the file

;search for dats using a path retrieved from a registry key
setPathKey "HKEY_LOCAL_MACHINE" "SOFTWARE\PlayOnlineUS\InstallFolder" "0001"

;search for dats on a path relative to this file
;setPathRel "./"

;search for dats on an absolute path
;setPathAbs "c:/whatever/ff11/"

dat "__skeleton" "ROM/27/82.dat"
dat "__animation" "ROM/27/82.dat"
dat "face" "ROM/27/87.dat"
dat "head" "ROM/27/103.dat"
dat "body" "ROM/28/7.dat"
dat "hands" "ROM/28/52.dat"
dat "waist" "ROM/28/84.dat"
dat "legs" "ROM/28/116.dat"
dat "weapon" "ROM/29/20.dat"

Loading and Exporting Zones:
There are two ways to load zone models in Noesis. The first is to simply go to "File" → "Open File" on the main toolbar, and then browse the folders on your PC to find the DAT file you want to load. The second method is to create a special Noesis scene file, place that scene file in your root FFXI directory, and then open that scene file instead of directly opening the DAT file. Using this second method allows you to specify several advanced load options which you cannot specify using the first method.

Advanced Load/Export Options:
The following is a list of special options specifically for FFXI which can be used when loading a model in Noesis:
  • -ff11blendhack <arg>: Software render to determine alpha coverage, <arg>=minimum fraction.
    • This uses the Noesis software renderer to render all FF11 map geometry triangles in UV space, and determine how many of each mesh's triangles are only touching zero-alpha pixels in the texture. -ff11blendhack 0.99 is typically a good value to use. This completely demented solution is not foolproof, but catches the vast majority of broken blending cases.
  • -ff11renderunref: Render unreferenced map geometry at identity.
    • Gets model data about sky/moon/water/etc., and spits models out at identity. You have to figure out how to pull them apart and place them yourself if you want to do something with them.
  • -ff11keepnames: Keep map object names intact.
    • Preserves the names of mesh geometry pieces in the 3D model. Use in conjunction with the above option to avoid having a big terrible inseparable triangle mess.
  • -ff11optimizegeo: Remove degenerates and redundant vertices.
    • Collapse redundancies and remove strip degenerates when exporting geometry. Unlike the other options above, which are invoked when loading a model into Noesis, this command is invoked when exporting a model from Noesis.
  • -ff11sqleanim <arg>: Load SQLE animation <arg> as relative path.
    • Option for SQLE animations. Used only for loading the hi-rez character models from the character creation screen.
With the exception of the "-ff11optimizegeo" command, the above options do not do anything if you try to input them into the Advanced Options box on export (explained below). These advanced options can only be invoked when loading zone models, otherwise the model will be exported without these options enabled, even if you try to input them in the export window. In order to use Advanced Options, you have to create a special Noesis scene file, like the one used for the hi-rez character models above, and use the Noesis extension as the file type (i.e. "filename.noesis"). The following is an example scene file for importing zones into Noesis using a scene file:
FFXI_Zone_BastokMarkets.noesis:
NOESIS_SCENE_FILE
version 1
physicslib ""
defaultAxis "0"

object
{
name "Environment"
model "C:/Program Files (x86)/PlayOnline/SquareEnix/FINAL FANTASY XI/ROM/1/35.dat"
loadOptions "-ff11blendhack 0.99 -ff11renderunref -ff11keepnames"
}

Exporting Zones:
In my personal experience, I have found that it's usually best to use the FBX file format for saving the model data (that's the Main output type), and TGA as the file format for textures. Saving the textures as BMP files will destroy their alpha channel, which is often needed for transparency on many objects, while saving the textures as PNG files preserves the alpha channel but causes the textures to not map correctly to the corresponding geometry for some mysterious reason. Saving the textures as TGA files avoids both of these problems.

Another common issue is that for some reason, when you export FFXI zones from Noesis, by default the zones get flipped upside down in most 3D modeling programs. This problem can be fixed by specifying a rotate value in Noesis on export. To specify a rotate value, type the command "-rotate" into the "Advanced options" box in the "Export media" window in Noesis, followed by three numbers (separated by spaces) to indicate the number of degrees to rotate along the XYZ axes. The pattern is "-rotate X Y Z." So if we wanted to rotate 180 degrees on the X axis, 0 degrees on the Y axis, and 270 degrees on the Z axis, we would type "-rotate 180 0 270," like so:
-rotate 180 0 270
You can enter as many commands as you like into the "Advanced export" options box. For our purposes here, the following is a good set of advanced options to use when exporting a model:
-rotate 180 0 0 -scale 100 -fbxscalehack -fbxsmoothgroups -fbxnewexport -ff11optimizegeo
That about wraps it up. If you have any questions, feel free to leave a comment below.