Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4]

Author Topic: Save Format  (Read 6341 times)

Zhentar

  • Bay Watcher
    • View Profile
Re: Save Format
« Reply #45 on: April 17, 2007, 12:08:00 pm »

well, I just got my web hosting all figured out, so I'm releasing DwarfSkills v0.1!

http://zhentar.mccambridge.org/DwarfSkills.zip

So what does it do? It prints out a list of all the dwarves names, custom professions, and skill levels, so that you can quickly find what dwarves you have that are good at what.

How do you use it? Extract the .exe to your Dwarf Fortress root directory. If you don't run it from there, it will crash. Then, start your Fortress. Open a command window, go to the dwarf fortress directory, and run "DwarfSkills.exe > filename.csv". Then, finally, open the .csv file in your favorite spreadsheet program!

FAQ:
Q: My dwarf names look funky!
A: Indeed they do.

This doesn't do nearly everything that I want it to yet, but I figured I'd release this much and get feedback now. Future goals include printing out the non-custom profession name, once I figure that out, printing out whether or not a certain labor is enabled (and possibly writing back changes to edit dwarf labor settings), and a more user-friendly UI. And, finally, cleaning up my code so it's a little more uniform and doesn't look like I stole most of it from several different people. (Thanks Erasmus, Flap, and Buffered for all that I borrowed)

[ April 17, 2007: Message edited by: Zhentar ]

Logged

Zhentar

  • Bay Watcher
    • View Profile
Re: Save Format
« Reply #46 on: April 17, 2007, 11:23:00 pm »

Well, I've succeeded in figuring out another part of the dwarf structure; offsets 112 and 116.

112 holds the current profession; 116 seems to hold the original profession.

I've compiled a list of what profession each value represents; I'll post it tomorrow.

As for the original profession, I have no idea what the significance of it is. It is quite puzzling- anyone have any thoughts?

Logged

Zhentar

  • Bay Watcher
    • View Profile
Re: Save Format
« Reply #47 on: April 18, 2007, 09:06:00 am »

Well, as I promised, the profession array. Professions are a number between 0 and 87 (inclusive), indexing into this array:

code:

const char * professions[88] = {
 "Miner",
 "Carpenter",
 "Mason",
 "Trapper",
 "Metalsmith",
 "Jeweler",
 "Craftsdwarf",
 "Queen",
 "Queen Consort",
 "Fisherdwarf",
 "Farmer",
 "Mechanic",
 "Manager",
 "Mayor",
 "Governer",
 "Broker",
 "Trade Minister",
 "Guildmaster",
 "Bookkeeper",
 "Treasurer",
 "Hoardmaster",
 "TaxCollector",
 "Hammerer",
 "Sheriff",
 "Baroness",
 "Countess",
 "Duchess",
 "Baroness Consort",
 "Countess Consort",
 "Duchess Consort",
 "Miners Guild",
 "Carpenters Guild",
 "Masons Guild",
 "Metalsmiths Guild",
 "Jewelers Guild",
 "Craftsdwarves Guild",
 "House Rash",
 "House Fer",
 "House Ber",
 "Philosopher",
 "Advisor",
 "Order of the Axe",
 "Order of the Mace",
 "Order of the Sword",
 "Order of the Hammer",
 "Order of the Crossbow",
 "Order of the Spear",
 "Alchemist",
 "Dungeon Master",
 "Merchant",
 "Diplomat",
 "Guild Representative",
 "Merchant Baron",
 "Merchant Prince",
 "Outpost Liaison",
 "Druid",
 "Champion",
 "Hammerdwarf",
 "Hammer Lord",
 "Speardwarf",
 "Spearmaster",
 "Marksdwarf",
 "Elite Marksdwarf",
 "Wrestler",
 "Elite Wrestler",
 "Axedwarf",
 "Axe Lord",
 "Swordsdwarf",
 "Swordmaster",
 "Macedwarf",
 "Mace Lord",
 "Pikedwarf",
 "Pikemaster",
 "Bowdwarf",
 "Elite Bowdwarf",
 "Blowgunner",
 "Master Blowgunner",
 "Recruit",
 "Hunting Peasant",
 "War Peasant",
 "Master Thief",
 "Thief",
 "Peasant",
 "Child",
 "Baby",
 "Drunk",
 "Lasher",
 "Master Lasher"
}

[ April 18, 2007: Message edited by: Zhentar ]

EDIT: Apparently a couple lines are messed up. Dunno how that one happened!

[ April 19, 2007: Message edited by: Zhentar ]

Logged

Zhentar

  • Bay Watcher
    • View Profile
Re: Save Format
« Reply #48 on: April 18, 2007, 09:23:00 am »

Okay, I have a few more things from my searching last night; I got around to hunting down my big fortresses' unit array. A couple things of note came up:

1. The unit array pointer and the unit array end are not necessarily adjacent! My end pointer was over 100 bytes after the start pointer.

2. The race of my dwarves was not 0x48- It was 0x3C, if I remember correctly. Probably because it was generated with an old creature list.

3. I'm regularly finding dwarves 1480 bytes from each other in memory. I strongly suspect the Dwarf struct is 1480 bytes long.

Logged

Rick

  • Bay Watcher
  • Engineer
    • View Profile
Re: Save Format
« Reply #49 on: April 19, 2007, 05:53:00 am »

quote:
Originally posted by Zhentar:
<STRONG>Okay, I have a few more things from my searching last night; I got around to hunting down my big fortresses' unit array. A couple things of note came up:

1. The unit array pointer and the unit array end are not necessarily adjacent! My end pointer was over 100 bytes after the start pointer.

2. The race of my dwarves was not 0x48- It was 0x3C, if I remember correctly. Probably because it was generated with an old creature list.

3. I'm regularly finding dwarves 1480 bytes from each other in memory. I strongly suspect the Dwarf struct is 1480 bytes long.</STRONG>


This is all stuff I've already figured out.    :)

Note that the list does not only contain dwarves, and dwarves and other creatures share the same structure size.

Creature start is 0x00ACB3EC
Creature end is 0x00ACB3F0

Total creature struct size is 1464.

Check here for my definition of the creature structure thus far (there are more details known, I just havn't checked all of the ones provided by other people yet).

[ April 20, 2007: Message edited by: Rick ]

Logged

Rick

  • Bay Watcher
  • Engineer
    • View Profile
Re: Save Format
« Reply #50 on: April 19, 2007, 06:05:00 am »

quote:
Originally posted by Zhentar:
<STRONG>Well, I've succeeded in figuring out another part of the dwarf structure; offsets 112 and 116.

112 holds the current profession; 116 seems to hold the original profession.

I've compiled a list of what profession each value represents; I'll post it tomorrow.

As for the original profession, I have no idea what the significance of it is. It is quite puzzling- anyone have any thoughts?</STRONG>


Original profession is probably related to combat so when you unrecruit them they return to their original profession.
Logged

Zhentar

  • Bay Watcher
    • View Profile
Re: Save Format
« Reply #51 on: April 19, 2007, 09:00:00 am »

quote:
Originally posted by Rick:
<STRONG>Original profession is probably related to combat so when you unrecruit them they return to their original profession.</STRONG>

Good thinking! I'll test that during lunch today. And that's some good stuff you have on your page; I wish I'd known about it sooner.

Well, I'll post my discovery from last night (it was supposed to be discoveries but you've already figured out most of them, you jerk) Offset 588/0x24C also has something to do with artifacts; only my dwarves with artifacts had a non-zero value for the 12 bytes afterwards. It looks like a set of 3 pointers, but messing around with them did nothing; I have no idea what they do.

Also, there's one inaccuracy that I know of in your own findings; the flags at 0x0DC- 1<<3 is not artifact creator, it's if they've had a strange mood. Dwarves which had a mood and failed have this bit set as well.

Also it looks like you figured out quicker than me that some of the creature types are gender specific. Fortunately, since you also found gender I'll update what I posted for gender stuff later.

[ April 19, 2007: Message edited by: Zhentar ]

Logged

Zhentar

  • Bay Watcher
    • View Profile
Re: Save Format
« Reply #52 on: April 19, 2007, 12:25:00 pm »

Update: That would be a negative, recruiting does not do anything with the original profession; it just recalculates it.

I turned a peasant into a mason, set his original prof. to mason, recruited and unrecruited him. He turned back into a peasant, with an original prof. of mason.

New theory: it's used for dwarves that started off as babies or children? I don't know why anything would care, though.

Logged

Rick

  • Bay Watcher
  • Engineer
    • View Profile
Re: Save Format
« Reply #53 on: April 19, 2007, 04:05:00 pm »

quote:
Originally posted by Zhentar:
<STRONG>

Good thinking! I'll test that during lunch today. And that's some good stuff you have on your page; I wish I'd known about it sooner.

Well, I'll post my discovery from last night (it was supposed to be discoveries but you've already figured out most of them, you jerk) Offset 588/0x24C also has something to do with artifacts; only my dwarves with artifacts had a non-zero value for the 12 bytes afterwards. It looks like a set of 3 pointers, but messing around with them did nothing; I have no idea what they do.

Also, there's one inaccuracy that I know of in your own findings; the flags at 0x0DC- 1<<3 is not artifact creator, it's if they've had a strange mood. Dwarves which had a mood and failed have this bit set as well.

Also it looks like you figured out quicker than me that some of the creature types are gender specific. Fortunately, since you also found gender I'll update what I posted for gender stuff later.

[ April 19, 2007: Message edited by: Zhentar ]</STRONG>


The list is probably pointers to the actual artifact items they have created, or the list of items in their inventory.
Logged

Anticheese

  • Bay Watcher
    • View Profile
Re: Save Format
« Reply #54 on: April 20, 2007, 05:56:00 pm »

Perhaps it is to keep track of all the dwarves who were born and bred in the fortress?
Logged
Why not join us on IRC? irc.newnet.net #bay12games
Pages: 1 2 3 [4]