Bay 12 Games Forum

Please login or register.

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

Author Topic: Dwarf Foreman 0.7.2 - Tool to automatically dispatch jobs to your workers  (Read 114835 times)

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile

Exceptions work.

I can do

try { throw 30; } and catch it properly.

I just can't catch exceptions from dfhack inside qt designer, I can from eclipse cdt...

Guess I'll try copying everything over to eclipse and seeing what happens.

Edit: Looks like there are two types of exception models used by gcc... my buddy is telling me all about dwarf and sjlj lol.

Edit2: Ha, he was right. I still don't quite get it(20 years of experience with C, maybe 2 weeks of experience with c++), but now my program is using dw2 for both and exceptions work fine.

« Last Edit: July 29, 2010, 01:03:33 pm by devek »
Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile

Hey, I tried but I couldn't get the drinks to work. I set it to 600, I had 550 (according to z->food menu), and it only "read" 45 so it kept giving 550+ manager jobs. I also tried to keep my logs around 150 (I had 120) but nothing was marked for cutting. Then I tried to mark all the trees, and it worked once, but on the next tick, it crashed foreman. I used dfhacks unstuck to get dwarf fortress going again, but I couldn't start foreman again, it gave the same error as if DF wasn't even running.

This was on windows 31.12.

Could you try it again please? Updated a bunch of stuff.
Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

NRN_R_Sumo1

  • Bay Watcher
    • View Profile



You must load this program after you load your world and close it before you save.

What will happen if it saves before you close it? and wouldnt this interfere with autosaves?
Logged
A dwarf is nothing but an alcohol powered beard.

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile

What will happen if it saves before you close it? and wouldnt this interfere with autosaves?

Honestly I don't know lol. Nothing bad seems to happens by saving with it running, and there is no specific reason I think anything bad would happen, I just can't say for certain. That is kind of why I put this out there, to see what happens :D
Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

Heavenfall

  • Bay Watcher
    • View Profile

Making drinks works, but you should keep in mind that each drink brewed nets 5 drinks for each plant used (up to 25 for a job, since plants can come in 1-5). So if I have 400 drinks and I want 500 drinks, I shouldn't queue 100 drinks, I should queue at the most 20. Another problem I ran into was that if the drinks for some reason exceeded the quota, the task didn't disappear. This might be a "problem" if I buy drinks, or get very lucky with what plants are chosen by the brewer. Just a function to think about.

Also, is it possible to make a simple checkbox toggle to make the new task manager jobs require managing, and not be instantly validated? Would feel a lot less like "cheating".

I tried setting for more logs than I had, but nothing seemed to happen over a tick. (had 147, set to 200).

I tried cutting all trees, and it worked without any problem (and a lot faster). On the second tick, nothing in particular happened, except the slight slowdown. Maybe "cut all trees" should be "run once" instead of every tick?


Logged
Upon him I will visit famine and a fire, until all around him desolation rings
and all the demons in the outer dark look on amazed and recognize
that vengeance is the business of a dwarf

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile

Making drinks works, but you should keep in mind that each drink brewed nets 5 drinks for each plant used (up to 25 for a job, since plants can come in 1-5). So if I have 400 drinks and I want 500 drinks, I shouldn't queue 100 drinks, I should queue at the most 20. Another problem I ran into was that if the drinks for some reason exceeded the quota, the task didn't disappear. This might be a "problem" if I buy drinks, or get very lucky with what plants are chosen by the brewer. Just a function to think about.

Thank you for your feed back :)

I was thinking about that too and they both seem part of the same solution. The fact that the amount of items produced isn't consistent irritates me, but culling excess jobs would deal with it. Another thing I was thinking about is culling any job with just 1 item remaining (and changing the target label to max) to remove the spam of jobs being completed.

I tried setting for more logs than I had, but nothing seemed to happen over a tick. (had 147, set to 200).
I tried cutting all trees, and it worked without any problem (and a lot faster). On the second tick, nothing in particular happened, except the slight slowdown. Maybe "cut all trees" should be "run once" instead of every tick?

Well, with cutting trees and nabbing vegetation.. it is always growing.  The idea is to be as much efficient as possible in eradicating all of it. On my machine there isn't a slowdown at all on map with tons of vegetation and I set seconds to 0 so it is always running. I still plan on making it more efficient as time goes on, and by efficient I mean removing/caching calls to dfhack which seem to be slow for some reason...

I guess I'll max it so it respect the target/max, but I don't see why you would want to do anything but cut them all down.  :D

Right now my specific problem is the mill, it is always a disaster for me in my fort. There are 8 different things that can be processed at a mill. You can't pick what gets processed directly. 4 of them are dyes and 4 of them are flour OR alcohol.  Trying to process everything is a bad idea because you run out of bags and end up with retarded amounts of stuff you don't use.

The only solution I can see is to mark each of the 8 plants totally forbidden except the ones you want to be milled. This works great, EXCEPT for the fact you will never be able to brew dwarven beer, longland beer, dwarven rum, or whip wine because the ingredients will be forbidden. You would have to import those and by content with the 11 other types of alcohol that can be brewed :P I think it is a fair compromise to get targeted milling.

Was curious if anyone had a better idea.

Edit: I just had an inspiration.. People create custom reactions all the time. I bet it would be possible to insert them via memory to do things like make specific dyes/flours. So rather than mill the plant, you can mill a specific plant that way.


« Last Edit: July 30, 2010, 12:39:57 pm by devek »
Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

Mason11987

  • Bay Watcher
    • View Profile

Downloading program now

Tiny non-program suggestions: How about a picture in the OP if possible?  And if you list version by version updates there, I would expect the newest version to be listed first.

Edit - Wow!  This is really cool.  Lots of potential here, I'll be following this.
« Last Edit: July 31, 2010, 12:24:44 am by Mason11987 »
Logged

bpuk

  • Bay Watcher
    • View Profile


Right now my specific problem is the mill, it is always a disaster for me in my fort. There are 8 different things that can be processed at a mill. You can't pick what gets processed directly. 4 of them are dyes and 4 of them are flour OR alcohol.  Trying to process everything is a bad idea because you run out of bags and end up with retarded amounts of stuff you don't use.

The only solution I can see is to mark each of the 8 plants totally forbidden except the ones you want to be milled. This works great, EXCEPT for the fact you will never be able to brew dwarven beer, longland beer, dwarven rum, or whip wine because the ingredients will be forbidden. You would have to import those and by content with the 11 other types of alcohol that can be brewed :P I think it is a fair compromise to get targeted milling.

Was curious if anyone had a better idea.

Edit: I just had an inspiration.. People create custom reactions all the time. I bet it would be possible to insert them via memory to do things like make specific dyes/flours. So rather than mill the plant, you can mill a specific plant that way.

I know almost nothing about how custom reactions are implemented in memory - might be one way of doing it. Another would be to scan the workshops for querns/millstones and grab the job objects from each. In theory you should be able to change the object that is tasked - but it's not a particularly clean way of doing it.

A cleaner method would be to find the get_item_to_mill() function and patch it - but that is problematic in terms of version changes.

But a very nice program :) I haven't looked at it in any detail yet, bit hectic with a different segment of memory at the moment. Oddly enough, I looked at doing something similar a while back - got a working proof of concept and realized that my method would be a nightmare to update for any version change - so gave up.

The general method you're using is very neat - and one that would have never occurred to me. Bravo

Logged

vrga

  • Bay Watcher
    • View Profile

Why not go directly to the job manager and input all the crafting related job in there? i find myself extremely frustrated when i have some specific amount of something i need made, and i'm stuck at 30. especially when the first three letters arent enough to get the related job to be near the cursor.
Logged
Zeocin's take on the current situation in Ardentdikes:
Otherwise known as the Release Urist Now Apocalyptic Weapon of Arse Yerking, or the R.U.N.A.W.A.Y. system.

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile

Making a custom reaction in memory is a bad idea! lol, oh man. My save won't load....

Forbidding items or making people patch their raws and regenerate their world to use my utility... I guess forbidding is the way to go.


Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile

Sorry I haven't made a release in a few days.. I got an i7 finally(laptop), and have been have fun playing with the processor in my free time. Should have something out tomorrow lol.
Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

sizeak

  • Bay Watcher
    • View Profile

How are you dealing with vector resizing inside DF?
Logged
Runesmith - http://www.bay12forums.com/smf/index.php?topic=59056.0 - A Dwarf Companion like tool

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile

Kind of ghetto, I allocate memory inside of the process and copy a larger vector there and leave a pointer to the region that was allocated in the unused 4 bytes at the start of the vector struct.

If you want I can post the code when I get home.

Doing it over and over would be stupid so I make it larger than I would need.

The correct way is to have dfhack inject code into df and malloc memory and push to vectors from there, until then this is the only way.
Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

sizeak

  • Bay Watcher
    • View Profile

Might be worth trying to add something to DFHack, would be handy for attempting to spawn creatures
Logged
Runesmith - http://www.bay12forums.com/smf/index.php?topic=59056.0 - A Dwarf Companion like tool

Untelligent

  • Bay Watcher
  • I eat flesh!
    • View Profile

Very nice, but what happened to the old labor management functionality this used to have?
 
Or is this a completely different utility from the old Dwarf Foreman?
Logged
The World Without Knifebear — A much safer world indeed.
regardless, the slime shooter will be completed, come hell or high water, which are both entirely plausible setbacks at this point.
Pages: 1 2 3 [4] 5 6 ... 32