|
|
Xim: Browser-based Client Simulator
Asura.Aamace
Server: Asura
Game: FFXI
Posts: 1
By Asura.Aamace 2025-12-22 12:06:23
Hello - I'd like to share my hobby project: https://xim.pages.dev/
Feature Summary:
View FFXI assets in a browser-based client simulation
Download the source-code and explore/run locally (under the "Source" header)
Play a proof-of-concept game (under the "Apps" header)
Implementation Details:
Xim:
is a from-scratch implementation, written in Kotlin/JS, compiles to Javascript, and uses WebGL for 3D rendering. It does not use any game/graphics engine.
downloads asset files on-demand & stores them in the browser's cache. Currently, the assets are hosted on Cloudflare (essentially copy/paste of the client installation)
uses copied data-files from LandSandBoat when server-side information is needed (NPC configuration, item->model mapping, etc.)
Source:
The resource-parsing code is mainly under Code src/jsMain/kotlin/xim/resource DatParser.kt is a good starting point for exploring the supported resource-types.
Limitations:
This is not a real FFXI client, it is only a simulation. There's no connection to a FFXI Server (or really any network code at all).
"Client Version" refers to the age of the hosted asset files. Currently, the hosted asset files are from the June 2024 update.
I don't plan to update these files. The project can be downloaded & run locally to view newer asset files.
Reverse-engineering scope: the goal of the project is to be "convincing", rather than 100% accurate
The reverse-engineering process was a mix of DirectX hooks (built using this project), constraint analysis, and (mostly) brute-force guess & check
I did debug the FFXI client a few times (mainly to figure out encryption/obfuscation, and for a few bit-flag fields), but I tried to avoid this because reading assembly is so time consuming
I didn't reference the data-mined debug symbols (didn't know they existed until very recently...)
WYSIWYG!
Audio: due to the complexity of V3 audio files (ATRAC3), all audio files were pre-processed and are served as ogg files.
The code for this is not included in the linked source (since it would require importing ffmpeg).
There's a comment on POLUtils describing almost exactly what I ended up doing.
Because of this, local-project runs won't have any audio (though I might be able to upload the audio separately if there's any demand)
Cutscenes/Events: I have not attempted to reverse-engineer the cutscene-related assets
Performance: from my testing, the simulation runs best in Chrome (& other Chromium-based browsers)
The simulation should work on mobile devices, but I haven't tested it aside from Firefox on Android.
If you'd like to use Firefox, disabling "Lens Flare" effects under the "Environment" section helps with performance
Code Quality: this is a hobby project that I didn't originally intend to release, so the overall quality is... variable.
This is also my first experience with 3D graphics & game development, so there are certainly some questionable choices/designs
I didn't try to optimize code for performance unless there was a built-in feature (zone-terrain culling, particle batching, etc) or it contributed greatly to latency
Known Issues:
This is by no means an exhaustive list, but here are a few of the most notable:
Particle z-fighting - I couldn't figure out how the draw-order works :/
Collision resolution - FFXI's terrain collision meshes are... challenging. I think I must be overlooking some flags in the collision mesh.
Cloth physics - for example, Aldo's cape. These use vertex-based spring-physics, which was cumbersome to implement in the current setup.
Ships in general - I didn't put much effort into these
NPCs in weird positions/poses - these aren't configured on the client-side, so I didn't focus on them
If you'd like to report an issue, please be sure to verify it in-game first. I have spent hours debugging "issues" only to realize that the simulation is accurate to quirky in-game behavior. I can't guarantee that I will fix reported issues.
Tips & Tricks:
In the asset-viewer mode:
the following keys have debug-related functionality: , . / (speed-up, anti-gravity, collision-clip)
'p' will pause the simulator, and 'space' will set the simulator to 25% speed (this is also available in the game-mode)
using "check" on an actor will display its routines, which can then be selected & executed
fog and draw-distance can be disabled under the "Environment" section. This can be useful if the simulator can't detect a good default entrance for a zone (ex: in "Silver Knife")
the "appearance-state" of the targeted actor can be adjusted under the "Animation" section. This is useful for various NPCs, like toggling auras on Naakuals, adjusting the standing state of maroliths and iron giants, etc
add items to your inventory via the "Items" section. If you add & equip a fishing rod, you can fish if you're nearby water.
many effects are associated with invisible doors. For example, the fountain effect in Ro'Maeve is toggled by Door[_3e6], and can be triggered via check->[evst] (event start), and ended via check->[eved] (event end) ('tab' around the fountain to find the door npc)
other effects (generally cutscene related) can be triggered manually under the "Zone Routines" section. For example, in "Hall of the Gods", the lower platform effect is "wt_s/effe/sc_w/open"
to change the player model to a NPC model, use the "Costume" setting under the "Player Look" setting. This is useful for running mob-skill-animations. For example, B41->Dragon Quest slime and use "Frizz"
there are some dummy monsters at the entrance to "East Sarutabaruta". These can be used as targets for spells, abilities, etc.
under the "Position" section, there's a "Copy Link" button which will place a link in the clipboard that corresponds to your current zone & position
talk to the NPCs at the various docks to make ships appear
In the game mode:
Hold the right mouse-button to strafe (imo, more natural than target-lock)
Avoid binding macros to 'ctrl', since 'ctrl+w' closes the browser window and can't be disabled :/
Mining is optional - the game is balanced around not having accessories
In the equip-menu, hover an empty slot to see the bonus summary window. Mouse-over the bonuses to see tool-tips.
Further development:
I probably won't have availability to develop new features at this point. If there's interest, I can improve documentation, though.
The project is licensed under GPL3, so you can fork the project if you'd like.
---
Thanks for taking a look! Feel free to ask any questions.
By Felgarr 2025-12-22 13:08:33
This is literally incredible. One day, because of your work, I will be able to play FFXI on an actual toaster.
[+]
By premiumvirtue 2025-12-22 13:40:36
This is incredible, thank you so much for sharing and allowing people to use your source code.
[+]
Hello - I'd like to share my hobby project: https://xim.pages.dev/
Feature Summary:
View FFXI assets in a browser-based client simulation
Download the source-code and explore/run locally (under the "Source" header)
Play a proof-of-concept game (under the "Apps" header)
Implementation Details:
Xim:
is a from-scratch implementation, written in Kotlin/JS, compiles to Javascript, and uses WebGL for 3D rendering. It does not use any game/graphics engine.
downloads asset files on-demand & stores them in the browser's cache. Currently, the assets are hosted on Cloudflare (essentially copy/paste of the client installation)
uses copied data-files from LandSandBoat when server-side information is needed (NPC configuration, item->model mapping, etc.)
Source:
The resource-parsing code is mainly under Code src/jsMain/kotlin/xim/resource DatParser.kt is a good starting point for exploring the supported resource-types.
Limitations:
This is not a real FFXI client, it is only a simulation. There's no connection to a FFXI Server (or really any network code at all).
"Client Version" refers to the age of the hosted asset files. Currently, the hosted asset files are from the June 2024 update.
I don't plan to update these files. The project can be downloaded & run locally to view newer asset files.
Reverse-engineering scope: the goal of the project is to be "convincing", rather than 100% accurate
The reverse-engineering process was a mix of DirectX hooks (built using this project), constraint analysis, and (mostly) brute-force guess & check
I did debug the FFXI client a few times (mainly to figure out encryption/obfuscation, and for a few bit-flag fields), but I tried to avoid this because reading assembly is so time consuming
I didn't reference the data-mined debug symbols (didn't know they existed until very recently...)
WYSIWYG!
Audio: due to the complexity of V3 audio files (ATRAC3), all audio files were pre-processed and are served as ogg files.
The code for this is not included in the linked source (since it would require importing ffmpeg).
There's a comment on POLUtils describing almost exactly what I ended up doing.
Because of this, local-project runs won't have any audio (though I might be able to upload the audio separately if there's any demand)
Cutscenes/Events: I have not attempted to reverse-engineer the cutscene-related assets
Performance: from my testing, the simulation runs best in Chrome (& other Chromium-based browsers)
The simulation should work on mobile devices, but I haven't tested it aside from Firefox on Android.
If you'd like to use Firefox, disabling "Lens Flare" effects under the "Environment" section helps with performance
Code Quality: this is a hobby project that I didn't originally intend to release, so the overall quality is... variable.
This is also my first experience with 3D graphics & game development, so there are certainly some questionable choices/designs
I didn't try to optimize code for performance unless there was a built-in feature (zone-terrain culling, particle batching, etc) or it contributed greatly to latency
Known Issues:
This is by no means an exhaustive list, but here are a few of the most notable:
Particle z-fighting - I couldn't figure out how the draw-order works :/
Collision resolution - FFXI's terrain collision meshes are... challenging. I think I must be overlooking some flags in the collision mesh.
Cloth physics - for example, Aldo's cape. These use vertex-based spring-physics, which was cumbersome to implement in the current setup.
Ships in general - I didn't put much effort into these
NPCs in weird positions/poses - these aren't configured on the client-side, so I didn't focus on them
If you'd like to report an issue, please be sure to verify it in-game first. I have spent hours debugging "issues" only to realize that the simulation is accurate to quirky in-game behavior. I can't guarantee that I will fix reported issues.
Tips & Tricks:
In the asset-viewer mode:
the following keys have debug-related functionality: , . / (speed-up, anti-gravity, collision-clip)
'p' will pause the simulator, and 'space' will set the simulator to 25% speed (this is also available in the game-mode)
using "check" on an actor will display its routines, which can then be selected & executed
fog and draw-distance can be disabled under the "Environment" section. This can be useful if the simulator can't detect a good default entrance for a zone (ex: in "Silver Knife")
the "appearance-state" of the targeted actor can be adjusted under the "Animation" section. This is useful for various NPCs, like toggling auras on Naakuals, adjusting the standing state of maroliths and iron giants, etc
add items to your inventory via the "Items" section. If you add & equip a fishing rod, you can fish if you're nearby water.
many effects are associated with invisible doors. For example, the fountain effect in Ro'Maeve is toggled by Door[_3e6], and can be triggered via check->[evst] (event start), and ended via check->[eved] (event end) ('tab' around the fountain to find the door npc)
other effects (generally cutscene related) can be triggered manually under the "Zone Routines" section. For example, in "Hall of the Gods", the lower platform effect is "wt_s/effe/sc_w/open"
to change the player model to a NPC model, use the "Costume" setting under the "Player Look" setting. This is useful for running mob-skill-animations. For example, B41->Dragon Quest slime and use "Frizz"
there are some dummy monsters at the entrance to "East Sarutabaruta". These can be used as targets for spells, abilities, etc.
under the "Position" section, there's a "Copy Link" button which will place a link in the clipboard that corresponds to your current zone & position
talk to the NPCs at the various docks to make ships appear
In the game mode:
Hold the right mouse-button to strafe (imo, more natural than target-lock)
Avoid binding macros to 'ctrl', since 'ctrl+w' closes the browser window and can't be disabled :/
Mining is optional - the game is balanced around not having accessories
In the equip-menu, hover an empty slot to see the bonus summary window. Mouse-over the bonuses to see tool-tips.
Further development:
I probably won't have availability to develop new features at this point. If there's interest, I can improve documentation, though.
The project is licensed under GPL3, so you can fork the project if you'd like.
---
Thanks for taking a look! Feel free to ask any questions.
|
|