v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

User:Bpuk

From Dwarf Fortress Wiki
Revision as of 00:24, 20 April 2010 by Bpuk (talk | contribs) (Another material ID field - Sorry for the edit spam. Keep thinking I've found everything for the night and then spotting something new.)
Jump to navigation Jump to search

0.31.03

Manager queue found at 0x0165c418

Looks like each queue item is 88 60 bytes long. Some offsets defined in constructor.


Offset Size Type Name Notes
00h 2 Short Job ID Mostly matches up with job ID's in Dwarf Therapist. One or two seem off
02h 2 Short Unknown. May be part of 04h Only seen 0xFFFF
04h 2 Short Item ID Is 0xFFFF for jobs with only one output item (i.e. rock door) - pulls from enums for armour/weapons
06h-0Bh SNS
0Ch 1 BYTE Set to 0 by the constructor. No change observed to date
0Dh-1Bh SNS
1Ch 4 DWORD Set to 0 by the constructor. No change observed to date


20h 4 DWORD Set to 15 by the constructor. No change observed to date
24h-27h probably 4 SNS
28h 4 long Material definition. 0xFFFF for jobs with no material choice.
2Ch 2 bitfield Target definition? changes to 4/64/1024 for Encrust Ammo/Furniture/Finished Goods with <mat> - operates as a bitfield
2Eh SNS


30h 2 bitfield Another material bitfield. This one covers plant/cloth/wood/leather/bone/horn/pearl at a minimum.


32h SNS


34h 2 Short Runs remaining
36h 2 Short Total Number of runs
38h 4 DWORD Validated Looks like a very large bool. Set to 0 by the constructor. Wonder why it's so large - guessing alignment packing

Item ID

04h - Weaponsmithing (J:97) 04h - Armoursmithing (J:101) 2Ch - Encrust with (J:87)
0 Whip Breastplate 4: Furniture
1 Battle Axe Iron Shirt 64: Ammo
2 War Hammer Armor 1024: Finished Goods
3 Short Sword Coat
4 Spear Shirt
5 Mace Cloak
6 Crossbow Tunic
7 Pick Toga
8 Bow Vest
9 Blowgun Dress

Material ID

Partial list only

0 Iron
1 Gold
2 Silver
3 Copper
4 Nickel
5 Zinc
6 Bronze
7 Brass
8 Steel
9 Pig Iron
10 Platinum

0.28.40d19

Initial passes of a couple of memory structures. This should all be taken as low confidence until at least another pass has been run over them.

I'm going to cross check some of the values found here against the raws and see if they match up. I'll come back to the building structure once I've had a quick look at the job and item structures.

Never did get around to updating these... Ah well, archiving them

Building Structure

Found at the addresses found by Mithaldu. See User:Jifodus/Memory research

The building structure is 248 bytes in length

Offset Size Type Name Notes
0000h 2 Short Unknown Always 0x0097 on the saves I've tested to date. Possibly a race ID?
02h 2 Short Building Type Multiple building 'types' seem to share the same designation. For example all workshops are 0x0E10C. Changing this type often results in the building 'dissapearing'
04h 4 long X co-ordinate (left) This, and the following co-ords, could be shorts. I've yet to see a value that isn't 0x00XX
08h 4 long Y co-ordinate (top)
0Ch 4 long X co-ordinate (centre)
10h 4 long X co-ordinate (right)
14h 4 long Y co-ordinate (bottom)
18h 4 long Y co-ordinate (centre)
1Ch 4 long Z co-ordinate
20h 4 long Built Could simply be a boolean padded to 4 bytes.
24h 4 long Material? Workshops built out of the same type of wood have the save value. Values for furniture match those for workshops
28h 4 long Unknown Usually 0 for workshops and furniture. Stockpiles appear to have a pointer
2Ch 4*4 long*4 Stockpile dimensions Top left co-ord, width, height
3Ch 4 long Unknown Varies while the game is unpaused. Part of AI?
40h 4 long Building ID? This is a counter, each building has a unique value. Values do not appear to be reused.
44h 4 long Unknown Only appears to be defined for stockpiles.
48h 16 vector List of jobs Remove building appears to be classed as a 'job'. Vector increases/decreases as jobs are added to workshops. Has values for some farm plots, workshops, stockpiles.
58h 16 vector Unknown Seen once on a chair. The chair was defining a throne room, which had items in it. It was also overlapped with a dining room.
68h 16 vector? Unknown
78h 4 long/pointer Defines Room? For furniture the lowest bit is 0/1 if that building is defining a room. Also often looks like a pointer.
7Ch 16 vector? Unknown
8Ch 16 vector? Unknown
9Ch 4 pointer Owner? Only seen on furniture allocated as a room with an owner.
A0h 16 vector? Unknown
B0h 4 long Unknown Appears to be a bitfield for stockpile storage settings.
B4h 16 vector Items Seems to be a list of items contained within the building (T). Doesn't seem to be relevant for stockpiles or ropes.
C4h 4 pointer? Unknown Seen on trade depot and an archery target
C8h 4 long Unknown/Part of stockpile profile?
CCh 16 vector Profile/Part of stockpile profile Seems to contain workshop profile, or part of the stockpile profile if it is a stockpile. Untested on furniture
DCh 4 long Minimum skill level For workshops this details the minimum skill level. For stockpiles it seems to be part of the stockpile settings
E0h 4 long Maximum skill level For workshops this details the maximum skill level. Dabbling is 0. Grand Master is 14. Legendary is 3 million.
E4h 6*4 long[6] Unknown Some of these appear to have useful values for workshops. Generally seem to be part of stockpile profiles.


Building Job Structure

Appears to be 128 bytes long. Appears that this is actually a 'task' structure for any task. I suspect that there will be a pointer to one of these in the creature structure. Maybe even pointing to the same object?

Offset Size Type Name Notes
00h 4 long ID Increases with each new job. Doesn't appear to reuse. Haven't tried to rollover
04h 4 pointer? Unknown
08h 2 short Material Type? Common types for wood, cloth, rock etc. Sure I've seen a list on the wiki of these, but if not I'll throw one together
0Ah 2 short Task Interestingly contains all dwarf tasks. Including half a dozen strange moods.
0Ch 4 long Unknown Generally the same for the same workshop. Probably a pair of shorts
10h 4 long Work left on item Unstarted jobs are 0xFFFFFFFF. When job becomes active changes to a job specific value then counts down. At 0 job is complete and removed from vector.
14h 4 long Unknown Often 0, FFFFFFFF or 80008
18h 2 short Unknown Generally 0, 0C00, FFFF
1Ah 2 short Status bitfield 1 is repeat, 2 is suspend, 4 is active. 8 has been seen - appears to be 'about to start'.
1Ch 4 long Unknown Remains 0xFFFFFFFF. May be non-workshop related
20h 2 short Unknown Usually FFFF
22h 2 short Unknown Usually 0000. Active job sometimes has a different value. Kitchens usually do. May be a quantity modifier?
24h 4 long Unknown
28h 5*4 long[5] Unknown Active jobs usually have values. Sometimes these look like pointers. Sometimes not. Inactive jobs are almost always 0
3Ch 4 long Unknown Never seen it anything other than 0
40h 4 long Unknown Never seen it anything other than F
44h 4 long Unknown Active jobs sometimes have values.
48h 16 vector Unknown Active jobs only. List of materials? list of dwarves?
58h 16 vector Unknown I'm not convinced this one is a vector, but it looks a lot like one. I'll keep looking at it
68h 16 vector Unknown Pretty sure this one is a vector. Generally seems to have 1-2 somethings each.
78h 4 pointer? Unknown
7Ch 4 long Unknown

Building Types

This table lists the known building ID's (at offset 2) to date. This is likely to be incomplete

B50C Door
E10C Workshop
B0EC Cabinet
DCEC Farm Plot
D1EC Bed
DE4C Animal Trap
9FE4 Stockpile
E26C Trade Depot
C00C Trap?
D4AC Chair
D34C Table
D8CC Statue
CF2C Cage
9D34 Rope
B3AC Armour Stand
C84C Archery Target
AF8C Coffer
E3CC Wagon