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.

No comments:

Post a Comment