Bay 12 Games Forum

Please login or register.

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

Author Topic: Relationships Utility  (Read 17625 times)

Tierre

  • Bay Watcher
    • View Profile
Re: Relationships Utility
« Reply #45 on: May 16, 2012, 11:25:22 am »

Hm... Good thread is going necro:( Telgin did you have anything to add to your research?
Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Relationships Utility
« Reply #46 on: May 16, 2012, 12:10:00 pm »

Not yet.  I haven't had much of a chance to poke around any more.  The biggest stumbling block is finding the right pointers to the various relationship types, which I haven't quite figured out.  So far my attempts have only led to the game crashing and burning.  :)

How the DFHack people figured this out, if they have, is a bit of a mystery to me for the moment.

The rest of the stuff, like the Spouse ID and terminating / stealing pregnancies I've already figured out, and will show you how to do in the next part.
Logged
Through pain, I find wisdom.

Tierre

  • Bay Watcher
    • View Profile
Re: Relationships Utility
« Reply #47 on: May 16, 2012, 02:27:47 pm »

Cool:) Thanks for your work:) Did you ask about finding pointers on dfhack thread and maybe in their github page?
Logged

Tierre

  • Bay Watcher
    • View Profile
Re: Relationships Utility
« Reply #48 on: June 01, 2012, 03:14:43 pm »

Necro:( And it was such a good opportunity:(
Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Relationships Utility
« Reply #49 on: June 01, 2012, 04:16:49 pm »

Ah, sorry I haven't updated this yet.  I started an internship that is sapping my free time in the extreme.  I haven't asked in the DFHack thread or their Github page yet, but I'll do that if I can't figure it out on my own soon.

I won't make any promises on when the next part will be up, since I'm so busy, but "soon" I hope.
Logged
Through pain, I find wisdom.

Dsarker

  • Bay Watcher
  • Ἱησους Χριστος Θεου Υἱος Σωτηρ
    • View Profile
Re: Relationships Utility
« Reply #50 on: June 01, 2012, 05:32:20 pm »

Soon™.
Logged
Quote from: NewsMuffin
Dsarker is the trolliest Catholic
Quote
[Dsarker is] a good for nothing troll.
You do not convince me. You rationalize your actions and because the result is favorable you become right.
"There are times, Sember, when I could believe your mother had a secret lover. Looking at you makes me wonder if it was one of my goats."

Tierre

  • Bay Watcher
    • View Profile
Re: Relationships Utility
« Reply #51 on: June 02, 2012, 12:41:13 pm »

Well anyway thatnks in advance:) And good luck with your internship:)
Logged

Tierre

  • Bay Watcher
    • View Profile
Re: Relationships Utility
« Reply #52 on: July 10, 2012, 12:07:27 pm »

soooo necro:( and he even got that trademark on soon:(
Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Relationships Utility
« Reply #53 on: July 10, 2012, 04:51:13 pm »

Thanks for jogging my memory and jogging my priority schedule.  I've still got about 5 weeks of this internship left to do, but with the end of my community fort around the corner I'll have a little more time to devote to stuff like this.  So... maybe within a week or two I'll have something else for you.
Logged
Through pain, I find wisdom.

Tierre

  • Bay Watcher
    • View Profile
Re: Relationships Utility
« Reply #54 on: July 11, 2012, 02:30:47 am »

Thanks a lot:) I think that being able to change relationships is a very good thing to do. then if it would be possible to get that into Runesmith or DT or dfhack... or even make a tool of its own - that can make life way easier.
Logged

EmperorJon

  • Bay Watcher
  • Still waiting...
    • View Profile
Re: Relationships Utility
« Reply #55 on: July 27, 2012, 10:39:01 am »

As it seems to be welcomed, I'll give another little prod. If at any time you just want to say SHUT UP I'M NEVER GOING TO DO IT, then feel free. :)
Logged
I think it's the way towns develop now. In the beginning, people move into a town. Then they start producing tables, which results in more and more tables. Soon tables represent a significant portion of the population, they start lobbying for new laws and regulations, putting people to greater and greater disadvantage...
Link for full quote. 'tis mighty funny.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Relationships Utility
« Reply #56 on: July 27, 2012, 12:12:32 pm »

Relationships are stored in several different places and, as previously stated, each one is one-way - there's unit.relations.* for pet owner, spouse, mother, father, last attacker, group leader, dragger, dragee, steed, and lover, and there's also unit.status.acquintances (sic), a vector of records used for describing friends (and possibly also grudges).
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Relationships Utility
« Reply #57 on: July 30, 2012, 06:53:25 pm »

As it seems to be welcomed, I'll give another little prod. If at any time you just want to say SHUT UP I'M NEVER GOING TO DO IT, then feel free. :)

I do intend to work on this some more soon, so I don't mind the prodding.  :)  I've got two more weeks of being extremely busy, but after that I will have a chance to actually work on this.

Relationships are stored in several different places and, as previously stated, each one is one-way - there's unit.relations.* for pet owner, spouse, mother, father, last attacker, group leader, dragger, dragee, steed, and lover, and there's also unit.status.acquintances (sic), a vector of records used for describing friends (and possibly also grudges).

Yep, that coincides with what I've seen, although I didn't realize the relationships vector also covered things like dragging and steeds.  That's interesting.  I still haven't done any poking around with this in a memory editor, but I'm curious how you're supposed to find the pointer to the relationship type without using DFHack's library.  Some offset from the start of the world structure I suppose.

DFHack is open source right?  I might just have to see how it's done by looking at the source.
Logged
Through pain, I find wisdom.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Relationships Utility
« Reply #58 on: July 31, 2012, 12:03:33 pm »

Yep, that coincides with what I've seen, although I didn't realize the relationships vector also covered things like dragging and steeds.  That's interesting.  I still haven't done any poking around with this in a memory editor, but I'm curious how you're supposed to find the pointer to the relationship type without using DFHack's library.  Some offset from the start of the world structure I suppose.

DFHack is open source right?  I might just have to see how it's done by looking at the source.

The "unit.relations.*" field I mentioned is not a vector - it's just a fixed-length array of integers. The "pointer to the relationship type" isn't a pointer - strictly speaking, it's just an array index, but df-structures doesn't actually define the relations info as an array, but instead as a bunch of distinct fields.

DFHack is very much open source, but the information you really want is in df-structures, most conveniently within the [windows|linux]/*.csv files.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Relationships Utility
« Reply #59 on: August 29, 2012, 11:02:41 pm »

Ah, yes, I think we're talking about different things.  I was thinking of the vector of historical figure links, which is entirely different.

Anyway, I spent a little time today trying to decipher how the type is deduced for these links (I realize I could just go ahead with writing this as a DFHack plugin, but the chase is just as interesting as the goal here), and I have sort of made some unhelpful progress.

I'm pretty sure the pointer is a function pointer, as I disassembled the memory that it points to, and it looks like a function call.  Quite why this is the case I'm not sure, it could just be a callback function as part of the structure, or could be something more exotic like a polymorphic class vtable entry (I know almost nothing about how this is implemented, but from what I gather it's normally part of the object, not just a random pointer floating around).

I think I'll just resort to checking some stuff in another save I have, for .34.11, but I don't think the structure would change between versions.  Hopefully I'll glean a bit from that and finish the manual part of this tutorial soon.
Logged
Through pain, I find wisdom.
Pages: 1 2 3 [4] 5