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

Job system info #387

Open
warmist opened this issue Mar 26, 2020 · 0 comments
Open

Job system info #387

warmist opened this issue Mar 26, 2020 · 0 comments
Labels
official from Toady, etc research

Comments

@warmist
Copy link
Member

warmist commented Mar 26, 2020

I've asked Toady One for some info about jobs:
Me:

I've got a few questions about the job system:

  • is there anything special about plant gathering?
  • What is in the 'job manager' (dfhack sees a pointer to job linked list, job postings and then two unknowns)

ToadyOne:

The gather job has several special flags, there should be a single unsigned int32 with those. Bits are gather from zone, pick trees, pick shrubs, gather fallen items, no ladder search, ladder restricted, 'pick trees ground'. Would take a while to figure out what some of those do at this point (haven't looked at it for years). Dunno if this is the kind of info you meant.
Job manager: yeah, the list, the job posting, and then there's one struct after that, the job application binary heap. The first member of that is an array of job application nodes (size 2000), and a size variable. Job applications have an applicant (unit ptr), job posting index, and value. The value determines how far applications climb up the heap when pushed on, so the top value application is always assured to be on the top (though the whole implementation is questionable, as with any of my data structures.)

Hopefully this helps identifying some fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
official from Toady, etc research
Projects
None yet
Development

No branches or pull requests

2 participants