Yserbius.Org is undergoing a change in forums. Please be patient during this process.

Yserbius file format documentation

ZaneDubya

Yserbius In House Expert
#1
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.
 
Last edited:

ZaneDubya

Yserbius In House Expert
#2
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.

https://github.com/ZaneDubya/YserbiusData/tree/master/Data
 

Attachments

Last edited:

ZaneDubya

Yserbius In House Expert
#5
The map files (from RESOURCE.035) are being successfully read, and I've posted renderings of the maps at https://github.com/ZaneDubya/YserbiusData/tree/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.
 

ZaneDubya

Yserbius In House Expert
#6
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:
Code:
TOMINES_01:
0000                          BEGIN
0003                          GoMap(03, FD, 02, 01)
001E                          RETURN

TOTREAS_02:
0000                          BEGIN
0003                          GoMap(02, 10, 04, 01)
001E                          RETURN

TOSOLDQU_03:
0000                          BEGIN
0003                          GoMap(01, 0F, 06, 01)
001E                          RETURN

EXITDUNG_04:
0000                          BEGIN
0003                          ExitDungeon()
000B                          RETURN

DOORMESA_05:
0000                          BEGIN
0003                          ShowMessage(03FC) = The gateway leads to THE MINES.
0010                          RETURN

DOORMESB_06:
0000                          BEGIN
0003                          ShowMessage(041C) = The gateway leads to THE HALL OF DOORS.
0010                          RETURN

DOORMESC_07:
0000                          BEGIN
0003                          ShowMessage(0444) = The gateway leads to THE SOLDIERS  QUARTERS.
0010                          RETURN

DOORMESD_08:
0000                          BEGIN
0003                          ShowMessage(0471) = The gateway is the DUNGEON EXIT.
0010                          ax = CheckState2(02, 6A)
0023 74 1A                    jz 0x3f
0025                          ShowMessage(0492) = Hail, conquering HERO OF YSERBIUS!
0032                          ShowMessage(04B5) = All of Twinion bows to your prominence!!
003F                          RETURN

TELEPORT_09:
0000                          BEGIN
0003                          GoMap(00, 5D, 01, 33)
001D                          RETURN

TELEMESS_0A:
0000                          BEGIN
0003                          ShowMessage(04DE) = There is a teleport in the west wall.
0010                          RETURN

DOORMESS_0B:
0000                          BEGIN
0003                          ax = CheckLevel(0014)
0011 75 03                    jnz 0x16
0013 E9 09 01                 jmp 0x11f
0016                          ax = CheckState(02, 78, 01)
002A 75 2E                    jnz 0x5a
002C                          ShowMessage(0504) = This room contains the gateway to the Labyrinth.
0039                          ax = SetExitability(01)
0044                          ax = GetNextTile(ax)
004C                          Move(ax, stk[0], stk[1])
0057 E9 C3 00                 jmp 0x11d
005A                          ax = HasItem(FB)
0068 75 03                    jnz 0x6d
006A E9 A3 00                 jmp 0x110
006D                          ShowMessage(0535) = The Thieves' Key unlocks this door!
007A                          ShowMessage(0559) = This room contains the gateway to the Labyrinth.
0087                          SetState(02, 78, 01)
009C                          RemoveItem(FB)
00A8                          RemoveItem(D2)
00B4                          RemoveItem(D3)
00C0                          RemoveItem(D9)
00CC                          RemoveItem(E1)
00D8                          RemoveItem(E2)
00E4                          RemoveItem(F8)
00F0                          ax = SetExitability(01)
00FB                          ax = GetNextTile(ax)
0103                          Move(ax, stk[0], stk[1])
010E EB 0D                    jmp 0x11d
0110                          ShowMessage(058A) = The Thieves' Key is needed to unlock this door.
011D EB 37                    jmp 0x156
011F                          ShowMessage(05BA) = The Thieves' Key is needed to unlock this door.
012C                          ShowMessage(05EA) = Only heroes of the twentieth level or higher may venture beyond this door.
0139                          ax = SetExitability(00)
0143                          ax = GetNextTile(ax)
014B                          Move(ax, stk[0], stk[1])
0156                          RETURN

PRTYPORT_0C:
0000                          BEGIN
0003                          ax = CheckLevel(0014)
0011 74 0F                    jz 0x22
0013                          ShowMessage(0635) = Good Journeys, brave hero.
0020 EB 27                    jmp 0x49
0022                          ShowMessage(0650) = Only heroes of the twentieth level or higher may venture beyond this door.
002F                          GoMap(00, 02, 01, 01)
0049                          RETURN

NOJOIN_0D:
0000                          BEGIN
0003                          TileIsNoJoinArea()
000B                          RETURN

03FC: The gateway leads to THE MINES.
041C: The gateway leads to THE HALL OF DOORS.
0444: The gateway leads to THE SOLDIERS  QUARTERS.
0471: The gateway is the DUNGEON EXIT.
0492: Hail, conquering HERO OF YSERBIUS!
04B5: All of Twinion bows to your prominence!!
04DE: There is a teleport in the west wall.
0504: This room contains the gateway to the Labyrinth.
0535: The Thieves' Key unlocks this door!
0559: This room contains the gateway to the Labyrinth.
058A: The Thieves' Key is needed to unlock this door.
05BA: The Thieves' Key is needed to unlock this door.
05EA: Only heroes of the twentieth level or higher may venture beyond this door.
0635: Good Journeys, brave hero.
0650: Only heroes of the twentieth level or higher may venture beyond this door.
 
Last edited:
#7
This is great work! I'll admit that I've started gaming in Elder Scrolls Online and that's really sapped my interest for any other game right now!
 

ZaneDubya

Yserbius In House Expert
#8
@Reonis I've heard a good deal about ESO, but have not played it.

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/YserbiusData/tree/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.
 
Last edited:

ZaneDubya

Yserbius In House Expert
#9
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.
 

ZaneDubya

Yserbius In House Expert
#10
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!
 
Last edited:

ZaneDubya

Yserbius In House Expert
#11
Spent two hours deciphering Resource.038, which is 256 item data entries. Each entry consists of an item name and 20 data fields - I've figured out 16 of the data fields, but have no idea what the other four are. After the bar, I'd like to sit down with a veteran and discuss the values I'm seeing. I'm sure someone who knows more about the game than I do would have a better idea what they might mean.

I really should be spending more time studying. Back to reviewing torts.
 

ZaneDubya

Yserbius In House Expert
#13
Just a quick note - I do intend to return to this project, but with just a month left before the bar, I have to knuckle down. Hopefully I'll catch some of you in the interim.
 

ZaneDubya

Yserbius In House Expert
#16
So much for studying. :D
Hahaha! Appearances to the contrary, I only stop to play with Yserbius when I'm too tired to property reason how Blackacre should devise. :)

Another breakthrough today - I deciphered the character progression resource file. I now have enough information to replicate the entire character building / level up portion of the game. I also posted what I've figured out for the spell and skill files.

I appreciate your checking in Reonis. Good to hear at least one other voice on this board!
 

ZaneDubya

Yserbius In House Expert
#17
Ripped all the strings out of the game. Every last one of them. Like everything else, posted to https://github.com/ZaneDubya/YserbiusData/tree/master/Data

I'm almost done ripping all the data in the game. I still need to:
Parse the monster data.
Parse the item data.
Parse the spell data.
Parse the skill data.
Parse the anim_seq file.
Identify the random encounter data <--- possibly the 34x32 shorts at the end of Resource.036. Not sure.
Identify or recreate the formulas used to calculate chance to hit, damage, and resistance.

... and I think that would be everything!
 
Last edited:

ZaneDubya

Yserbius In House Expert
#19
Spent an hour last night trying to figure out what the values in Resource.036 represented. While I know that the file itself represents the monster / encounter data, the individual values don't make sense. So I decided to edit Resource.036 and run the game with custom monsters. But the game rigorously checks each of its Resource files each time the player enters the cano or changes maps; editing a file results in a 'Version control' error.

Not to be thwarted, I decompiled the ysbox executable (using IDA Pro), located the offending version checking routine (this took three hours), and edited it so that the routine succeeds regardless of the integrity of the resource files (deciphering x86 opcodes using http://ref.x86asm.net/coder32.html and modifying the exe with a simple hex editor).

In summary, I now control every statistic that a monster can possibly have, and have thus taken another step towards figuring out the monster data format and yserbius combat formulas. I've already figured out the fields for Strength, Defense, Dexterity, PhysicalAttackReduction, and MagicalAttackReduction. And I'm sure I could use similar techniques to edit and decipher the item data format!
 
Last edited:

ZaneDubya

Yserbius In House Expert
#20
A quick personal update: I passed the bar (back in Summer 2016)! The intervening years have been a blur. Do you ever get the sense that time is speeding up?

I picked up this project again last month. Since then, I've deciphered the remaining item data, skill and spell data, and made more progress on the monster data. I've also transcoded the map script files from 16-bit x86 overlays to c# code. You can view the transcoded dungeon entrance script file here. n.b. I admit the code is ugly, but it's machine-based transcoding, not done by hand!

My inspiration to continue looking at this game data comes from my love of Yserbius. The game was fun, but my fondest memories of that old platform are of the community. Most everyone was positive, helpful, and affirming. I'd like there to be a way to replicate that place, and make it accessible in a modern way.
 
Top