Bay 12 Games Forum

Please login or register.

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

Author Topic: Research  (Read 9832 times)

Roses

  • Bay Watcher
    • View Profile
Re: Research
« Reply #30 on: June 03, 2017, 02:20:07 pm »

Ah, that makes a lot of sense, thank you! So if I follow, for my previous testing with dwarves

Normal Bite Attacks (maybe more specifically, normal attacks with the attack skill as BITE?)
4 -> bit 2 set
5 -> bit 2 and 0 set

Normal Grasp Attacks
6 -> bit 2 and 1 set
7 -> bit 2 and 1 and 0 set

Normal Stance Attacks (Kick has ATTACK_FLAG_BAD_MULTIATTACK, maybe that's why bit 10 is set?)
1030 -> bit 10 and 2 and 1 set
1031 -> bit 10 and 2 and 1 and 0 set

Quick Bite Attacks
36 -> bit 5 and 2 set
37 -> bit 5 and 2 and 0 set

Quick Grasp Attacks
38 -> bit 5 and 2 and 1 set
39 -> bit 5 and 2 and 1 and 0 set

Quick Stance Attacks
1062 -> bit 10 and 5 and 2 and 1 set
1063 -> bit 10 and 5 and 2 and 1 and 0 set

Wrestling Attack
12 -> bit 3 and 2 set

It looks like;
  • bit 0 is set when targeting body parts >15 on Dwarves, which corresponds (I believe) to small body parts.
  • bit 1 is set for grasp and stance attacks and not bite attacks
  • bit 2 is set for all the attacks (maybe bit 2 is set for body part attacks and not set for item attacks? I will test)
  • bit 3 is set for wrestling attacks
  • bit 5 is set for quick attacks (which is what is listed in the DF-Structures
  • bit 10 is listed for stance attacks (possibly because the KICK attack has ATTACK_FLAG_BAD_MULTIATTACK)
I didn't find any cases where bit 4 was set, but I will do a more exhaustive test now that I know what I am looking at/for.

EDIT: All of the above information is now out of date since the attack action structure changed a bit and now has correctly identified all of the necessary items.
« Last Edit: February 08, 2018, 11:43:04 am by Roses »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Research
« Reply #31 on: February 08, 2018, 12:30:34 pm »

So a new version of DF means new research to be done! I am going to start with this updates major feature, sending units out on raids. I'll start by identifying some of the anon fields

Starting with the [c] screen (the one with the world map on the left and different "tabs" on the right). Inspecting it with dfhack.gui.getCurViewscreen we get a list of entires
Code: [Select]
child = nil
parent = <viewscreen_dwarfmodest>
breakdown_level = 0
option_key_pressed = 0
page = 2
sel_idx = 0
entities = <vector<historical_entity*>[1]>
map_x = 11
map_y = 17
site = <world_site>
anon_1 = <vector<void*>[0]>
anon_2 = <vector<void*>[0]>
anon_3 = <vector<void*>[0]>
anon_4 = 0
anon_5 = <vector<void*>[1]>
anon_6 = <vector<void*>[0]>
anon_7 = 0
anon_8 = <vector<void*>[0]>
anon_9 = 0
anon_10 = 0
anon_11 = 0
anon_12 = <vector<void*>[0]>
anon_13 = <vector<void*>[0]>
anon_14 = 0
anon_15 = 0
anon_16 = 0
artifact_desc = <vector<string*>[0]>
anon_17 = 0
anon_18 = 0
anon_19 = 0
anon_20 = 0
anon_21 = <vector<void*>[#]>
anon_22 = <vector<void*>[0]>
anon_23 = 0
anon_24 = 0
anon_25 = 0
anon_26 = 0
anon_27 = 0
anon_28 = 11
anon_29 = 13
anon_30 = 587
anon_31 = 0
anon_32 = 0
anon_33 = 0
unk1 = <viewscreen_civlistst.T_unk1>
anon_34 = <vector<string*>[#]>
This is what pops up for me when I use it on a freshly created world/fort. Let's go through them and see if we can identify them
  • page <= This is the "tab" you are on. 0 is Civilizations, 1 is News and rumors, 2 is World, 3 is Missions, 4 is the squad select for Missions 5 is People, and 6 is Artifacts
  • entities <= I only ever got one entry in this table and that was my entity, possibly the number of entries in 'Civilizations', which might make set_idx the index of the entry in 'Civilizations' that you are looking at
  • map_x, map_y <= These are the x, y coordinates your cursor is currently over on the world map
  • site <= This is a link to the site you are currently selecting, nil if not selecting a site
  • anon_1 and anon_2 <= While these were always blank for my, I assume they have something to do with 'News and rumors'
  • anon_3 <= While this table is initially empty, every mission you create will create a new entry in this table
  • anon_4 <= The index of the entry from anon_3 that you are currently selecting
  • anon_5 <= A list of currently active missions (or possibly squads)
  • anon_8 <= Presumably a list of missing citizens from 'People' (I never had any, but based on anon_10 and anon_11 and the structure of the other anons it makes sense)
  • anon_9 <= Presumably the index you are selecting from anon_8
  • anon_10 and anon_11 <= The x and y coordinates for your cursor when using 'People'
  • anon_12 and anon_13 <= These tables have something to do with artifacts. While initially empty the moment you go to page 6 they will be populated with a number of entries equal to the number of artifacts. Presumably one is for the actual item entry and one is for the artifact entry
  • anon_14 <= The index of the artifact you are currently selecting
  • anon_15 and anon_16 <= The x and y coordinates of the artifact you are currently selecting
  • artifact_desc <= A table of strings for the description of the artifact you are currently selecting
  • anon_21 <= No idea, but do not try to access, will cause a crash
  • anon_28 and anon_29 <= The x and y coordinates selected while using 'News and rumors'
The rest I have no idea about, especially unk1. it contains 11 anons each of which are 1000 long tables of integers. anon_21 and anon_34 are also weird because they can be vectors that have, supposidly, 100000+ entries.

Next up I will look at the squads and armies entries to figure out how the missions actually work.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: Research
« Reply #32 on: February 09, 2018, 04:11:53 am »

anon_20 allows you to bypass the lacking a leader check though it might be there to prevent folks from just Crashing the game I havent figure out what the numbers lead to but I do know -1 the value will lock you out of sending folks out to raids.
wanted to mess with this  menu more but ended up just fiddling with the army and the army's controller instead.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

Roses

  • Bay Watcher
    • View Profile
Re: Research
« Reply #33 on: February 09, 2018, 11:48:22 am »

anon_20 allows you to bypass the lacking a leader check though it might be there to prevent folks from just Crashing the game I havent figure out what the numbers lead to but I do know -1 the value will lock you out of sending folks out to raids.
wanted to mess with this  menu more but ended up just fiddling with the army and the army's controller instead.

Interesting, I started looking in to the army, army controllers, and squads last night. I'll be posting my findings today, For the most part it seems the additions to the newest DF version are the new orders for squads that tell them they are going out on a raid. I still want to see what happens if I artificially give a squad the raiding order without going through the world map interface.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Research
« Reply #34 on: February 09, 2018, 02:10:38 pm »

Is it actually printing "vector<void*>[#]", or did you replace some number with "#"?

I think I identified most of the fields with names... are the names not clear enough? The various page IDs are defined in df.viewscreen_civlistst.T_page. Also, in both gui/gm-editor and the lua interpreter, you can use "scr" or "screen" instead of "dfhack.gui.getCurViewscreen()".

I'm pretty sure I added vectors in the right places on Linux/macOS, so if anon_22 is misaligned on Windows, that means everything after it is also wrong on Windows, and maybe things as early as anon_17 (since anon_17-21 are all integers).

Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Roses

  • Bay Watcher
    • View Profile
Re: Research
« Reply #35 on: February 09, 2018, 02:30:48 pm »

Is it actually printing "vector<void*>[#]", or did you replace some number with "#"?

I think I identified most of the fields with names... are the names not clear enough? The various page IDs are defined in df.viewscreen_civlistst.T_page. Also, in both gui/gm-editor and the lua interpreter, you can use "scr" or "screen" instead of "dfhack.gui.getCurViewscreen()".

I'm pretty sure I added vectors in the right places on Linux/macOS, so if anon_22 is misaligned on Windows, that means everything after it is also wrong on Windows, and maybe things as early as anon_17 (since anon_17-21 are all integers).

Yeah, I just replaced the number printed with #, it was usually >100000, but seemed rather random. I don't see any names for any of the anon stuff. Similarly looking at armies and squads I see a lot of anon stuff as well. It's worth noting that the tables (like anon_13) just contain <user_data> entries, not anything actually accessible.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Research
« Reply #36 on: February 09, 2018, 04:11:47 pm »

Alright, squads, armies, and army controllers time!

Small note, I use the nomenclature World map x/y and Block map x/y. World map refers the coordinates when looking at the world map, so for a small world they can be 0-31 (32x32). Block map refers to the entire block a single world map tile takes up, I believe this is always 48*32? Maybe, actually maybe I don't know what block map means, but you typically see numbers between a few hundred up to about 1300 so I think it's the smaller grained x,y information.

For squads all we really need to look at are the squad.orders (although anon_1 in squad is the army controller ID). I'm going to just be looking at the df.squad_order_raid_sitest order.
Code: [Select]
<squad_order_raid_sitest>
unk_v40_1 = -1
unk_v40_2 = -1
year = 23
year_tick = 17122
unk_v40_3 = 52                       -- The army controller ID of the squad
anon_1 = 0
squad_order_raid_sitest.anon_1 = 4   -- The ID of the site being raided
anon_2 = <coord>                     -- This is the coordinate your squad left the forts map from
Short and sweet.

Now armies, nothing really of note here, most things are identified and pretty self explanatory. So I will just do a snip
Code: [Select]
<army>
id = 128
<snip>
unk_pos_x = <vector<int32_t>[9]>  -- Block map x coordinates left in the current blocks travel
unk_pos_y = <vector<int32_t>[9]>  -- Block map y coordinates left in the current blocks travel
unk_70 = <vector<int32_t>[11]>    -- World Map x coordinates left in the armies travel
unk_80 = <vector<int32_t>[11]>    -- World Map y coordinates left in the armies travel
<snip>
These were already known from others work and used in mifki's script to force a siege, they are just here for completeness

Moving on to army_controllers, this gets a little confusing so I won't snip anything
Code: [Select]
<army_controller>
id = 53
entity_id = 75
unk_8 = 10                       -- ID of the site the army is going to
pos_x = -1
pos_y = 616                      -- Are we sure this isn't a block pos_x
unk_14 = 1177                    -- And this isn't a block pos_y
unk_18 = 0
unk_1c = 0
unk_20 = <vector<int32_t>[0]>
year = 23
year_tick = 17122
unk_34 = -1
unk_38 = 53                      -- ID of the army controller again?
unk_3c = 286
unk_40 = -1
unk_44 = <vector<int32_t>[0]>
unk_50 = 8
unk_54 = <vector<int32_t>[1]>    -- I think this is the ID of the mission being done, squads going on raids have a number here, other squads don't
unk_60 = <army_controller_unk60> -- Another construct, will discuss below
unk_64 = <army_controller.T_unk_64>
type = 2


<army_controller_unk60>
anon_1 = <vector<army_controller_unk60.T_anon_1*>[1]>         -- Another construct! Discussed below
anon_2 = 0
anon_3 = 25                                                   -- Armies current world map x position
anon_4 = 20                                                   -- Armies current world map y position
anon_5 = -1
anon_6 = Mission Report: Raid Dreadfought (Set out Spring 23) -- The description of the mission
anon_7 = 0
anon_8 = 23                                                   -- Year
anon_9 = 17790                                                -- Year tick
anon_10 = vector<int32_t>[0]>
anon_11 = -1
anon_12 = -1


<army_controller_unk60.T_anon_1>
anon_1 = <int32_t[]>  -- World map x coordinate of army, gets filled in as the unit moves
anon_2 = <int32_t[]>  -- Cooresponding world map y
anon_3 = <int32_t[]>  -- Year of the cooresponding move to new x,y
anon_4 = <int32_t[]>  -- Year tick to go with the year
anon_5 = 4            -- Number of steps taken
anon_6 = <int32_t[]>  -- Looks like it could be the x or y block coordinate of the site explored, but only having one is weird, probably something else
anon_7 = <int32_t[]>  -- A list of years the site was explored
anon_8 = <int32_t[]>  -- A list of year ticks the site was explored
anon_9 = 0            -- Number of filled in integers in anon_6,7,8

That is as far as I have gotten, I was thinking there would be some df.global.world.missions or something of the sort, so I went through some of the unknowns in world but wasn't able to find anything that would match, except maybe anon_1.

As for my last stuff;
My guess for anon_8,9,10,11 was correct
My guess for anon_5 was not correct, it may instead be the number of known entities?
I think anon_6 is actually the list of currently active missions
Which makes anon_7 the currently highlighted active mission maybe?
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Research
« Reply #37 on: February 20, 2018, 12:17:35 pm »

Well research continues with squads, armies, and missions. Right now I am trying to create a mission completely through DFHack. That is, create a squad, an army, and an army controller, assign a unit to said squad, and then send the squad out on a squad_order_raid_sitest order. So far I haven't gotten it to work so I thought I would ask to see if anyone else has tried something similar.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Research
« Reply #38 on: March 14, 2018, 11:01:31 am »

I finally got "custom" missions to sort of work, that is to say I was able to create a mission and send a unit off on it by creating a squad, army, army controller, and squad order and linking them all together all with a script. The trouble is at some point (maybe when the unit arrived at the destination, maybe when they got back, maybe somewhere in between) the game crashed. I'll keep investigating on my end, there may have been an incorrectly set flag or variables (there are a lot of them), but after seeing the 44.07 update I'm hopeful that maybe what I saw was one of the crashes that Toady fixed. Once a new version of DFHack is available I'll try again and see if it's fixed.
Logged

bloop_bleep

  • Bay Watcher
    • View Profile
Re: Research
« Reply #39 on: March 14, 2018, 12:23:25 pm »

PTW.

I really want to do some kind of research into this at some point, since it seems like the kind of puzzle I would like.  :D
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

Roses

  • Bay Watcher
    • View Profile
Re: Research
« Reply #40 on: March 15, 2018, 11:50:10 am »

PTW.

I really want to do some kind of research into this at some point, since it seems like the kind of puzzle I would like.  :D

There's always more research that can be done!
Logged

Atomic Chicken

  • Bay Watcher
    • View Profile
Re: Research
« Reply #41 on: March 26, 2018, 03:21:10 pm »

creature_raw.flags.unk_69

Was set to true for every race except for the following creatures in a vanilla test world:
Spoiler: unk_69 == false (click to show/hide)
Seems to me that this flag refers to whether or not a creature is organic as opposed to inorganic.

creature_raw.flags.unk_49

Set to true for the following creatures:
Spoiler: unk_49 == true (click to show/hide)
These are all the creatures which form civilisation-type entities at the beginning of worldgen.

creature_raw.flags.unk_6e

Spoiler: unk_6e == true (click to show/hide)
Mostly animal people, but the list also includes gorlaks and plump helmet men. Not entirely sure what to make of this.

creature_raw.flags.unk_6f

Spoiler: unk_6f == true (click to show/hide)
Refers to OUTSIDER_CONTROLLABLE.

creature_raw.flags[114]

Spoiler: 114 == false (click to show/hide)
Set to false for sea creatures, wagons and the non-existent chimera, centaur and griffon.

creature_raw.flags[115]

Spoiler: 115 == false (click to show/hide)
Appears to to be set to false for creatures which have at least one caste capable of flight.

creature_raw.flags[116]

Spoiler: 116 == true (click to show/hide)
Probably refers to SLOW_LEARNER.

creature_raw.flags[117]
to
creature_raw.flags[135]
Appear to be identical to creature_raw.flags[116].
« Last Edit: March 26, 2018, 03:25:13 pm by Atomic Chicken »
Logged
As mentioned in the previous turn, the most exciting field of battle this year will be in the Arstotzkan capitol, with plenty of close-quarter fighting and siege warfare.  Arstotzka, accordingly, spent their design phase developing a high-altitude tactical bomber. 
Pages: 1 2 [3]