Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

47 #400

Merged
merged 44 commits into from
Aug 6, 2020
Merged

47 #400

Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
642955d
Merge branch 'master' of https://github.com/DFHack/df-structures into 47
PatrikLundell Apr 15, 2020
bce7e34
further identification
PatrikLundell Apr 22, 2020
e5bdfdb
Merge branch 'master' of https://github.com/DFHack/df-structures into 47
PatrikLundell Apr 22, 2020
946fe92
minor army_controller adjustments
PatrikLundell Apr 22, 2020
3f5d0c9
additional minor army_controller research
PatrikLundell Apr 26, 2020
d98d680
merge
PatrikLundell Apr 26, 2020
30235b6
corrected botched comment
PatrikLundell Apr 26, 2020
f051d86
another schema validation correction
PatrikLundell Apr 26, 2020
337a393
Merge branch 'master' of https://github.com/DFHack/df-structures into 47
PatrikLundell Apr 26, 2020
d5f952e
sanity, identification, and research
PatrikLundell Apr 30, 2020
cf9aca8
history field identification
PatrikLundell Apr 30, 2020
6e98409
season_type used for cur_season and moved
PatrikLundell Apr 30, 2020
da8e9a7
intrigue and event collection field identification
PatrikLundell May 1, 2020
884a6ad
fixed misspelled attributes
PatrikLundell May 1, 2020
d1d81d1
misaligned identified fields, found enum value
PatrikLundell May 1, 2020
391b8a8
was still misaligned, but found another enum type in the process
PatrikLundell May 1, 2020
4301eca
identified a couple of enum values, general identification
PatrikLundell May 2, 2020
6e841a5
field identification
PatrikLundell May 8, 2020
c55994b
more musical_forms field identification
PatrikLundell May 9, 2020
d1106db
musical_form/scale field identification
PatrikLundell May 10, 2020
b699e98
field identification
PatrikLundell May 12, 2020
8f223a3
merged conflict
PatrikLundell May 12, 2020
a3ab7f3
region_weather fields, some enum values
PatrikLundell May 14, 2020
861ed52
addressed base-type comments
PatrikLundell May 15, 2020
b2df97d
dance form field identification
PatrikLundell May 16, 2020
e0cfb1f
more dance field identification
PatrikLundell May 17, 2020
d849c9b
identified enum value
PatrikLundell May 21, 2020
0d3cb0f
schema limitation work around + fixed syntactic error
PatrikLundell May 22, 2020
b1f5473
second schema limitation work around attempt
PatrikLundell May 22, 2020
bdc4978
merge
PatrikLundell May 22, 2020
c37f1bf
Merge branch 'master' of https://github.com/DFHack/df-structures into 47
PatrikLundell May 29, 2020
f16932f
identity enums identified and picked growths object data named
PatrikLundell May 29, 2020
dd109f1
adapted to comments
PatrikLundell May 29, 2020
41f763c
dead civ flag identified + minor adjustments
PatrikLundell May 31, 2020
2bb7f37
reverted incorrect flag 'identification'
PatrikLundell Jun 2, 2020
56d2d60
named field
PatrikLundell Jun 7, 2020
89452ec
tedious and error prone merge
PatrikLundell Jun 26, 2020
b994d2a
fixed one merge error
PatrikLundell Jun 26, 2020
fa23ca6
Merge master into PatrikLundell/47 (INCOMPLETE) (#400)
lethosor Aug 6, 2020
37d9df8
Manually apply historical_figure_relationships.intrigues changes to l…
lethosor Aug 6, 2020
ef219bf
Merge enums, remove duplicate types
lethosor Aug 6, 2020
e9b1108
Merge master into #400 again
lethosor Aug 6, 2020
6169998
Change historical_figure_relationships.hf_visual.rank back to int16_t
lethosor Aug 6, 2020
546c0fa
Remove season_type (unused, duplicates "season")
lethosor Aug 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions df.history.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@

<enum-item name='PreserverOfKnowledge'/>
<enum-item name='Intruder'/>
<enum-item name='Preacher'/>
</enum-type>

<!-- This enum is tentative -->
Expand Down Expand Up @@ -810,6 +811,10 @@
<enum-type type-name='identity_type' base-type='int32_t'>
<enum-attr name='id_tag' comment='for identity.id'/>

<enum-item name='None' value='-1' comment="Seen on adventurer assuming an identity for reasons unknown">
<item-attr name='id_tag' value='histfig_id'/>
</enum-item>

<enum-item name='HidingCurse' comment="Inferred from Units.cpp after examining code using 'unk_4c'">
<item-attr name='id_tag' value='histfig_id'/>
</enum-item>
Expand All @@ -826,8 +831,8 @@
<item-attr name='id_tag' value='nemesis_id'/>
</enum-item>

<enum-item name='Unk_4'>
<item-attr name='id_tag' value='histfig_id' comment="guess as to what the ref-target is"/>
<enum-item name='InfiltrationIdentity' comment="A guess. The cases seen all had the HFs fool the same entity that they were members of it, but no actual purpose was seen">
<item-attr name='id_tag' value='histfig_id'/>
</enum-item>

<enum-item name='Identity' comment="Claim a new official identity, seen when religious appointments are received">
Expand Down
24 changes: 13 additions & 11 deletions df.world-data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@

<struct-type type-name='world_object_data'
instance-vector='$global.world.world_data.object_data' key-field='id'>
<int32_t name="id"/>
<int32_t name='id' comment="World MLT of the data according to: i + x * 16 + k * 16 * world_width + y * 256 * world_width, where (x, y) is the world tile and (i, k) the MLT within it"/>
<stl-vector name="altered_items" type-name='int32_t' comment='world_data_subid'/>
<stl-vector name="offloaded_items">
<pointer>
Expand Down Expand Up @@ -703,18 +703,20 @@
<int32_t name="year_tick"/>

-- v0.40.14:
<stl-vector name='unk_c0' type-name='int16_t' comment="6 bytes allocated seen. Cannot be pointer"/>
<stl-vector name='unk_d0' type-name='int16_t' comment="6 bytes allocated seen. Cannot be pointer"/>
<stl-vector name='unk_e0' type-name='int16_t' comment="6 bytes allocated seen. Cannot be pointer. Seen on the same element, so c0, d0, and e0 may be connected"/>
<stl-vector name='unk_f0' type-name='int32_t' comment="4 bytes allocated seen. Cannot be pointer"/>
<stl-vector name='unk_100' type-name='int32_t' comment="4 bytes allocated seen. Cannot be pointer"/>
<stl-vector name='unk_110' type-name='int32_t' comment="4 bytes allocated seen. Cannot be pointer. Seen on the same element, so f0, 100, and 110 may be connected"/>
<compound name='picked_growths' comment="also includes 'automatically picked' i.e. fallen fruit that becomes item_spatter">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to move the version into a since attribute:

Suggested change
<compound name='picked_growths' comment="also includes 'automatically picked' i.e. fallen fruit that becomes item_spatter">
<compound name='picked_growths' since='v0.40.14' comment="also includes 'automatically picked' i.e. fallen fruit that becomes item_spatter">

<stl-vector name='x' type-name='int16_t' comment="within the MLT"/>
<stl-vector name='y' type-name='int16_t' comment="within the MLT"/>
<stl-vector name='z' type-name='int16_t' comment="uncertain coordinate system. 100 = surface on my flat embark, 101 in the air, while the normal coordinates don't go that high"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it match either of the coordinates on the right edge of the screen?

Copy link
Contributor Author

@PatrikLundell PatrikLundell May 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it didn't match any of those.

Edit: Correction it does indeed seem to match the lower value, which looks like the Elevation of the tile (not sure why I did see a different value there previously). I don't know how to translate from Elevation to whatever format is used elsewhere, though, but regardless, the comment should be updated.

<stl-vector name='subtype' type-name='int32_t' comment="subtype of the growth within the raws of the implicit plant"/>
<stl-vector name='density' type-name='int32_t' comment="unknown why the raw density field is placed here, as there's nothing left"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this allows for partial harvests of extremely dense growths, so you can pick the rest of it later.

Copy link
Contributor Author

@PatrikLundell PatrikLundell May 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly, although I've seen only 1, possibly 2, and 1000 here. If your idea is correct we'd briefly see something in between 2 and 1000 for trees, but that would require a bit of luck (or care) with the timing.
I haven't seen anything indicating a gradual picking graphically, but the "graphics" might not show the full picture, and I haven't studied fruit picking for hours...

Edit: I've run a callback script that checks these fields every frame, and it hasn't registered a single case of a density value in the range 3 - 999, which ought to happen while dorfs are vigorously picking fruit (at least the durians and olives had a raw density value of 1000).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible that it only happens when gathering items in Adventurer mode - I'd try it myself, but I don't have a script handy for finding the correct object_data entry for my current location.

Copy link
Contributor Author

@PatrikLundell PatrikLundell May 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  local embark_x = df.global.world.world_data.region_details [0].pos.x
  local embark_y = df.global.world.world_data.region_details [0].pos.y
  local embark_min_x, embark_max_x, embark_min_y, embark_max_y
  local object_id
  
  for i = 0, 15 do
    for k = 0, 15 do
      if df.global.world.world_data.region_details [0].biome [i] [k] >= 48 then
        if not embark_min_x then
          embark_min_x = i
        end
        
        embark_max_x = i
        
        if not embark_min_y then
          embark_min_y = k
        end
        
        embark_max_y = k

        object_id = i + embark_x * 16 + k * 16 * df.global.world.world_data.world_width + embark_y * 256 * df.global.world.world_data.world_width
        dfhack.println (df.world_object_data.find (object_id), object_id)        
      end
    end
  end

This snippet gets the object ids for an embark. It obviously would have to be adapted to adventurer mode, where I guess the region_details [0] part remains the same, but there'd have to be some other logic to find the current MLT. I'm rather unfamiliar with adventurer mode, though.

Copy link
Member

@quietust quietust May 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Adventurer mode, region_details[4] is the one that contained >=48 biome values (possibly because it corresponded to the town I started in), but none of the calculated object_id values corresponded to existing world_object_data records.

I tried a more brute-force approach and simply searched through all records to find ones with non-empty picked_growths lists, and it looks like Adventurer mode just doesn't use them at all - no matter how many finger limes I picked from a nearby tree, all of those lists remained empty.

It's possible Toady added the ability to handle partial harvests but just never finished implementing it - perhaps in a later version, dwarves won't harvest the entire tile at once.

Did you only monitor those values while dwarves were harvesting, or did you also check while growths were falling off and landing on the ground as spatters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brute force is what I've used mostly, until trying a callback every frame, where the frame rate dropped to 28 even when accessing only the appropriate entries. It's odd, however, that different structures would be used for the same purpose in Adventurer mode and Fortress mode, as I assume the trees actually were picked visually (and not possible to pick indefinitely).

A fruit tree density of 1000 looks like some kind of max value rather than a sensible one, when shrubs tend to have a value of 1, so it might be that partial picking was waiting for the agriculture overhaul.

Have you used tools to look at what code Adventurer mode picking uses? It might be something different that uses different data structures.

<stl-vector name='year' type-name='int32_t' comment="4 bytes allocated seen. Cannot be pointer. Seen on the same element, so f0, 100, and 110 may be connected"/>
quietust marked this conversation as resolved.
Show resolved Hide resolved
</compound>

-- v0.43.01
<stl-vector name='unk_v43_1'/>
<stl-vector name='unk_v43_2'/>
<stl-vector name='unk_v43_3'/>
<stl-vector name='unk_v43_4'/>
<stl-vector name='unk_v43_1' type-name='int16_t' comment="2 bytes allocated seen. Cannot be pointer"/>
<stl-vector name='unk_v43_2' type-name='int16_t' comment="2 bytes allocated seen. Cannot be pointer"/>
<stl-vector name='unk_v43_3' type-name='int16_t' comment="2 bytes allocated seen. Cannot be pointer"/>
<stl-vector name='unk_v43_4' type-name='int32_t' comment="4 bytes allocated seen. Cannot be pointer"/>
</struct-type>

<enum-type type-name='mountain_peak_flags'>
Expand Down