FFXIV 1.0 Classic Server Dev Blog

Figuring out items

I've been working this cold weekend on finally tackling items. Seventh Umbral had made some leeway on the items, but didn't get very far with figuring out the item blocks themselves. On Saturday I figured out the general layout of how the initial inventory update works. It is made up of a start packet, multiple item packets, and an end packet. The opcodes are 0x146 and 0x147, with both 0x14A and 0x14B used for the items themselves (though the data is the same). 0x149 seems to be a "end of list" packet, showing up if there is only 1 item packet or as the last item packet. The start/end tags define where exactly the items get show: Key Items, Currancy/Crystals, or Normal Inventory. There are also more tags, and these most likely are for the Bazaar, Meld Requests, and Loot tabs.

Today I found a lot of the item block itself. Below is an example of one of those blocks. This is a Vanya Hat +1. I do realized I accidentally left it as 6 Vanya Hat's but it seems the game fixes that anyway.

undefined

The makeup I understand so far is:

0x00: Database ID (used to retrieve unique item info like durability/spiritbind)
0x08: Quantity
0x0C: Item ID (retrieves all the data about it in the dats)
0x10: Index/Slot

0x28: If it's 1: NQ, If it's 2: HQ
0x29: Unknown for now
0x2A: Unknown for now
0x2B: Durability
0x4C: Spirit Bind (0 - 10,000)
0x4E: Melded Materia 1 
0x4F: Melded Materia 2
0x50: Melded Materia 3
0x51: Melded Materia 4
0x52: Melded Materia 5

Knowing the above I have been able to modify various information about an item in the inventory. Here is some examples below:

undefined

undefined

Introduction

Intro

It's a strange thing to try and rebuild a dead MMORPG that was deemed "a failure". Especially when the game still lives on in a new form. I feel like 1.0 is still a historical relic of FFXIV and players should be able to visit it and check it out. The game itself is also chalk full of lore that got cut off after the calamity and it would be nice to be able to revisit and experience those parts of the story. It's also something for me to do after 3.0 turned a bit dull as I wait for 3.1 :P. Regardless, I hope you have a fun time looking over my progress posts and maybe in the future enjoy playing on the server itself (once it's released)!

The Seventh Umbral Server

I'd be a lying if I said the server was all done by me. In fact, this started off as a continuation of the "Seventh Umbral" project. Some of you may have heard of it, but basically it was the first and earliest attempt at building a server emulator for FFXIV 1.23b. I was watching the project closely and was disappointed that no update to the code had happened for over a year. So I decided to continue the project and add features that were missing. The current version of the SU server let's you do some basic things:

  • Login to a pre-defined character only. No lobby functionality other than select character is implemented. The character can be modified using acontrol panel on the SU website.
  • Basic script functionality, mainly to open the cutscene book and exit the inn to the world.
  • Some simple commands to teleport between various zones at pre-defined spots, ride a chocobo, and change the weather.
  • A simple battle system.

Luckily the creator had figured out a lot of the ground work which sped up progress on figuring out the more "interesting" things. I decided to check out the source code and see what I could do to add to it. Setting up the project turned into a bit of a mess. The game used a lot of dependencies from the Boost library, to the creator's own frameworks used in PS2 emulation (so it seemed). Not only that, the whole solution was filled with different projects related to reading FFXIV's game files. It took me a day or two due to my inexperience with Visual Studio but after tons of fiddling, I finally got the message:

Build: 1 succeeded

I booted up the server and connected using the SU launcher. I selected the pre-defined character and he woke up in a Gridanian inn, 5 years before 2.0, with a giant red moon looming over in the sky. It seemed that everything worked!

undefined

First changes

I began to look over the source code and get an idea of how the server and game worked. That is where I learned the server was never designed to actually be multiplayer. Ever player is running in their own separate instance, forever walled off from each other (I am getting Pink Floyd's "Hey You" imagery here). Still, I was able to figure out and implement the chat system (say, yell, and tell) as well as some of the missing scripts for the Armoire and the Bed. To aid in getting around blocked doors (they can't open), I added in a custom teleport command as well as one to get your current position. However one thing really annoyed me; the fact that you had to use some external website to manage your characters. That and you only got one character per account. So I decided to switch work to figuring out the lobby server.

The lobby server

The way SU was designed was that both the lobby and map servers were handled on the same program. I decided to split them since that is how they are suppose to run, and if you ever wanted the lobby to handle more than one server, you'd have to do that anyway. To help figure out the various packet opcodes, I booted up OllyDbg and checked out what was going on underneath the hood. Turned out that the game was still firing off debug messages! Thanks to this, I was able to figure out the modification opcode and it's subcommands: charaReserve (checks if a name is available and makes a DB entry), charaMake (fills the entry with chara info), charaDelete, charaRename, charaRenameRetainer. I was able to implement these functions, as well as the lists that get sent to the client when getCharacters is fired: the Account List, World List, Import Names List (used to import FFXI names into ARR), and Character List. After a month of work, I had completed the lobby server and 90% of the functionality is there. The only thing missing is some GM commands that I could not figure out.

undefined

The map server

Because of the limitations of the SU server, and my own when it comes to C/C++ programming, I decided to write the map server from scratch in C#. So far I've implemented the groundwork and the first few login packets. Unlike SU, these are not hardcoded from the sniffed files he provided, rather filled in with the correct information to allow multiple users. In SU everyone has the same "Actor ID" (the same init packet is sent to everyone)... I've given a unique one for everyone allowing communication between the various clients. I have also documented many of the actor initialization packets, which theoretically should mean NPCs, objects, and even other players should be easily creatable. I'll still be using SU as a test bed but hopefully in the coming months the FFXIV Classic server should overtake the functionality of SU.

Anyway, I hope you have a fun time reading the various progress updates I post as I learn more and more about how FFXIV 1.23b worked!

Newer posts → Home