- 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.
Difference between revisions of "User:Bpuk"
m (→Building Structure: Corrected internal link) |
(→Building Job Structure: Added very crude first pass of job struct) |
||
Line 243: | Line 243: | ||
===Building Job Structure=== | ===Building Job Structure=== | ||
− | Appears to be 128 bytes long. Haven't | + | 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? |
+ | {| border="1" cellpadding="2" width="100%" | ||
+ | ! width="5%" | Offset | ||
+ | ! width="10%" | Size | ||
+ | ! width="10%" | Type | ||
+ | ! width="20%" | Name | ||
+ | ! width="55%" | Notes | ||
+ | |||
+ | |- | ||
+ | | <code>00h</code> | ||
+ | | 4 | ||
+ | | long | ||
+ | | ID | ||
+ | | Increases with each new job. Doesn't appear to reuse. Haven't tried to rollover | ||
+ | |||
+ | |- | ||
+ | | <code>04h</code> | ||
+ | | 4 | ||
+ | | pointer? | ||
+ | | Unknown | ||
+ | | | ||
+ | |||
+ | |- | ||
+ | | <code>08h</code> | ||
+ | | 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 | ||
+ | |||
+ | |- | ||
+ | | <code>0Ah</code> | ||
+ | | 2 | ||
+ | | short | ||
+ | | Task | ||
+ | | Interestingly contains all dwarf tasks. Including half a dozen strange moods. | ||
+ | |||
+ | |- | ||
+ | | <code>0Ch</code> | ||
+ | | 4 | ||
+ | | long | ||
+ | | Unknown | ||
+ | | Generally the same for the same workshop. Probably a pair of shorts | ||
+ | |||
+ | |- | ||
+ | | <code>10h</code> | ||
+ | | 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. | ||
+ | |||
+ | |- | ||
+ | | <code>14h</code> | ||
+ | | 4 | ||
+ | | long | ||
+ | | Unknown | ||
+ | | Often 0, FFFFFFFF or 80008 | ||
+ | |||
+ | |- | ||
+ | | <code>18h</code> | ||
+ | | 2 | ||
+ | | short | ||
+ | | Unknown | ||
+ | | Generally 0, 0C00, FFFF | ||
+ | |||
+ | |- | ||
+ | | <code>1Ah</code> | ||
+ | | 2 | ||
+ | | short | ||
+ | | Status bitfield | ||
+ | | 1 is repeat, 2 is suspend, 4 is active. 8 has been seen - appears to be 'about to start'. | ||
+ | |||
+ | |- | ||
+ | | <code>1Ch</code> | ||
+ | | 4 | ||
+ | | long | ||
+ | | Unknown | ||
+ | | Remains 0xFFFFFFFF. May be non-workshop related | ||
+ | |||
+ | |- | ||
+ | | <code>20h</code> | ||
+ | | 2 | ||
+ | | short | ||
+ | | Unknown | ||
+ | | Usually FFFF | ||
+ | |||
+ | |- | ||
+ | | <code>22h</code> | ||
+ | | 2 | ||
+ | | short | ||
+ | | Unknown | ||
+ | | Usually 0000. Active job sometimes has a different value. Kitchens usually do. May be a quantity modifier? | ||
+ | |||
+ | |- | ||
+ | | <code>24h</code> | ||
+ | | 4 | ||
+ | | long | ||
+ | | Unknown | ||
+ | | | ||
+ | |||
+ | |- | ||
+ | | <code>28h</code> | ||
+ | | 5*4 | ||
+ | | long[5] | ||
+ | | Unknown | ||
+ | | Active jobs usually have values. Sometimes these look like pointers. Sometimes not. Inactive jobs are almost always 0 | ||
+ | |||
+ | |- | ||
+ | | <code>3Ch</code> | ||
+ | | 4 | ||
+ | | long | ||
+ | | Unknown | ||
+ | | Never seen it anything other than 0 | ||
+ | |||
+ | |- | ||
+ | | <code>40h</code> | ||
+ | | 4 | ||
+ | | long | ||
+ | | Unknown | ||
+ | | Never seen it anything other than F | ||
+ | |||
+ | |- | ||
+ | | <code>44h</code> | ||
+ | | 4 | ||
+ | | long | ||
+ | | Unknown | ||
+ | | Active jobs sometimes have values. | ||
+ | |||
+ | |- | ||
+ | | <code>48h</code> | ||
+ | | 16 | ||
+ | | vector | ||
+ | | Unknown | ||
+ | | Active jobs only. List of materials? list of dwarves? | ||
+ | |||
+ | |- | ||
+ | | <code>58h</code> | ||
+ | | 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 | ||
+ | |||
+ | |- | ||
+ | | <code>68h</code> | ||
+ | | 16 | ||
+ | | vector | ||
+ | | Unknown | ||
+ | | Pretty sure this one is a vector. Generally seems to have 1-2 somethings each. | ||
+ | |||
+ | |- | ||
+ | | <code>78h</code> | ||
+ | | 4 | ||
+ | | pointer? | ||
+ | | Unknown | ||
+ | | | ||
+ | |||
+ | |- | ||
+ | | <code>7Ch</code> | ||
+ | | 4 | ||
+ | | long | ||
+ | | Unknown | ||
+ | | | ||
+ | |||
+ | |} | ||
=== Building Types === | === Building Types === |
Revision as of 23:41, 2 May 2009
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.
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 |