If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Yserbius file format documentation

I've spent my evenings this week figuring out the file formats. I've had success deciphering the easy ones: the palette files (TITLPAL, PALETTE), image files (IMAGES, MAIN.TSU, TITLIMG, and WALLS), and text files (HELP and RESOURCE.040). I have my suspicions about what other files contain (most of the RESOURCE files are map scripts, RESOURCE.035 is map data, RESOURCE.038 items, etc.) and I'd like to touch base with other people who have worked on the file formats before I spend hours duplicating someone else's effort. Stepping through DOS assembly is fun, but it's also a huge time sink.

I saw PatchX's discussions from back in 2006 about reading the map scripts, and I've emailed him, but I don't know if he still checks his yserbius@gmail.com address. If anyone is in touch with him, I'd really appreciate it if you would connect us! Likewise, if you or anyone you know has spent time playing with the game formats, I'd appreciate the chance to share notes.

In the meantime, I'm going to continue working on the data formats. I'll post my results in this thread.

I should be studying for the bar - but hey, that's 6 weeks away! Plenty of time to spend on retro data formats.

I had some success in extracting item data from RESOURCE.038. The file is very lightly scrambled: each 16bit value is shifted left 6 bits, rolling over to the right without the carry bit. Once decrypted, each item entry is 46 bytes. The first 24 bytes is an ASCII name string, followed by 2b icon index, followed by 2b item type (0x0C is quest items, at least). Not sure what the rest of the data is, and it looks like the buy/sell price data is in another file.

I am uploading the binary item data here in the hopes that someone might want to go through it and figure out what the other data in each item entry means.

Found the price data in RESOURCE.039 and uploaded it to https://github.com/ZaneDubya/Yserbiu...ee/master/Data. The format is very simple: 2b buy price, followed by 2b sale price. 1024 bytes. I'm pretty sure the rest of RESOURCE.039 is more item data, but that will have to wait - it's back to studying for the bar for me.

The map files (from RESOURCE.035) are being successfully read, and I've posted renderings of the maps at https://github.com/ZaneDubya/Yserbiu...ee/master/Maps.
And I know what every value in that file is, with the exception of the final offset (in the bottom right of the following image):
Not quite sure what that is; it's likely the index of a per-level test that is run when attempting to exit the tile or when performing an action on the tile.

Having decoded the map files, I'm now working on map scripting. These are the scripts associated with Map 1: Dungeon Entrance. While not all the functions have been decoded yet, I've made good progress:

I've completed disassembling the Yserbius map scripts - there are two or three functions remaining that I do not know the purpose of, but I can at least recognize the signatures of these. I've uploaded all the disassembled scripts to https://github.com/ZaneDubya/Yserbiu...ee/master/Maps.

So here's where I am right now: I have extracted and deciphered the maps, map scripts, quest state flags, graphics, and palettes. This is exciting, but I'm still missing the meat of the game: combat statistics (for monsters, items, spells, skills, etc), character progression statistics (dexterity, hits, mana, skill points, etc at each level for each combination of class and guild), item data, and portraits. I'll keep poking around in the files, but it would be really helpful to know if anyone else has already figured these things out.

I've identified the character progression statistics in RESOURCE.039. X-Elf's post from 2011, containing XP data for the first ten levels for all guilds, was extremely helpful in both locating and verifying the data. While fishing around in the same file, I discovered that it also contains the initial statistics for each combination of race and guild! So, with a little parsing and pattern matching to figure out what the data actually holds (for example, which fields are strength, which are skills, etc), I should have character progression 100% figured out.

I also identified what I believe to be either monster or encounter statistics in RESOURCE.036! I'm nowhere near ready to start reading this file, but that's another big step forward.

Item data is in RESOURCE.038. Again, not sure exactly how the data in this file maps to the data you see in the game, but at least I know what the file is.

There are only three kinds of data in the resource files that I have not yet identified: 2252b at the end of RESOURCE.036, 300 6 byte structs in RESOURCE.037, and 313 8b structs in RESOURCE.037. Once I have identified how this data is used, I'll settle into attempts at deciphering. I'd really appreciate the help of any Yserbius veterans in this task, if we still have any active on the board.

I figured out how to unscramble RESOURCE.037 properly - the file has 300x6b structs that I don't yet understand, but the following 288 structs are spell data! For each 8b entry, the format is 2b mana cost, 2x1b flags of some variety, and then 2x2b offsets (for a damage causing spell, the offset is damage. Not sure about other types yet!).

What's even more interesting is - viewing the raw data - it appears that a level 2 control spell is exactly equal in effectiveness to a level 1 control spell (same offsets, but more mana!), and you can achieve the maximum control power (offset 0x05) at level 11 control and only 100 mana, which is as effective as level 12 control at 250 mana.

Please note that I am only spit-balling here, based on the data I'm seeing in the resource files. I may well be wrong. Choose not to max out your spells at your own peril. Injuries, maiming, and perhaps even your untimely demise may be the result of listening to these maunderings. Your faithful party members may abandon your corpse!