Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 10 11 [12] 13 14 ... 32

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

seanb

  • Bay Watcher
    • View Profile
Re: Dwarf Foreman 0.6 - Tool to automatically dispatch jobs to your workers
« Reply #165 on: March 28, 2011, 04:28:41 pm »

I don't have a clue what any of that means, but i'm glad to see you are back to working on it! This will help out a bunch!
Logged

Aklyon

  • Bay Watcher
  • Fate~
    • View Profile
Re: Dwarf Foreman 0.6 - Tool to automatically dispatch jobs to your workers
« Reply #166 on: March 28, 2011, 04:34:39 pm »

Ooh, a chance to answer a question!

Dwarf Foreman's basic function is to allow you to automatically create jobs to keep a specific stockpile for common items such as fuel, cloth, thread, bins, and barrels.  It helps you never have to say "Whoops!  I forgot to make sure I brewed some drinks this season!"  Instead, you just tell Dwarf Foreman that you always want at least X drinks on-hand, and it will automatically queue up some brewing jobs when your supplies dip below X.
YES. I want this, and am joining the couple people hurrahing your return, devek.
Logged
Crystalline (SG)
Sigtext
Quote from: RedKing
It's known as the Oppai-Kaiju effect. The islands of Japan generate a sort anti-gravity field, which allows breasts to behave as if in microgravity. It's also what allows Godzilla and friends to become 50 stories tall, and lets ninjas run up the side of a skyscraper.

vrga

  • Bay Watcher
    • View Profile
Re: Dwarf Foreman 0.6 - Tool to automatically dispatch jobs to your workers
« Reply #167 on: March 29, 2011, 06:52:18 pm »

quicky question, this is windaz only, right?
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
Re: Dwarf Foreman 0.6 - Tool to automatically dispatch jobs to your workers
« Reply #168 on: March 31, 2011, 09:16:51 pm »

Can you guys help me for a bit? Foreman isn't ready but I have something that needs to be tested.

http://dffd.wimbli.com/file.php?id=4100

Download that and test it for me? All the buttons should work on the left for any vanilla version of df above 0.13. I haven't added the robustness to deal with modded versions of DF, but I will add that once I actually get a release out. The dump jobs obviously won't show anything if your manager isn't trying to assign any :P

The cool thing is that my code no longer relies on offsets and seems to do a good job of finding what it needs

quicky question, this is windaz only, right?

Yes.
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?"

Aklyon

  • Bay Watcher
  • Fate~
    • View Profile
Re: Dwarf Foreman 0.6 - Tool to automatically dispatch jobs to your workers
« Reply #169 on: March 31, 2011, 10:46:07 pm »

SDL or Legacy DF?
Logged
Crystalline (SG)
Sigtext
Quote from: RedKing
It's known as the Oppai-Kaiju effect. The islands of Japan generate a sort anti-gravity field, which allows breasts to behave as if in microgravity. It's also what allows Godzilla and friends to become 50 stories tall, and lets ninjas run up the side of a skyscraper.

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile
Re: Dwarf Foreman 0.6 - Tool to automatically dispatch jobs to your workers
« Reply #170 on: March 31, 2011, 10:53:17 pm »

I can't say for sure, I imagine legacy is just legacy. It might be supported on accident though :P
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?"

seanb

  • Bay Watcher
    • View Profile
Re: Dwarf Foreman 0.6 - Tool to automatically dispatch jobs to your workers
« Reply #171 on: March 31, 2011, 10:53:43 pm »

Appears to work perfect with .31.25
Logged

Aklyon

  • Bay Watcher
  • Fate~
    • View Profile
Re: Dwarf Foreman 0.6 - Tool to automatically dispatch jobs to your workers
« Reply #172 on: March 31, 2011, 11:42:48 pm »

No problems in .31.25 w/Ironhand graphics, but this two sounded a bit odd.
Code: [Select]
20 other materials found!
-snip-
#17 UNKNOWN_SUBSTANCE
-snip-
#19 CREATURE_1
Logged
Crystalline (SG)
Sigtext
Quote from: RedKing
It's known as the Oppai-Kaiju effect. The islands of Japan generate a sort anti-gravity field, which allows breasts to behave as if in microgravity. It's also what allows Godzilla and friends to become 50 stories tall, and lets ninjas run up the side of a skyscraper.

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile
Re: Dwarf Foreman 0.6 - Tool to automatically dispatch jobs to your workers
« Reply #173 on: March 31, 2011, 11:56:52 pm »

That is an actual material, hehe.

Thanks for the testing, hope to have a release out tomorrow. I'm dying to get back to my fort :/
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?"

forsaken1111

  • Bay Watcher
    • View Profile
    • TTB Twitch
Re: Dwarf Foreman 0.6 - Tool to automatically dispatch jobs to your workers
« Reply #174 on: March 31, 2011, 11:59:06 pm »

I'll be testing shortly as well to see how it works on an existing fort, 200+ dorfs

Worked great on everything I tried it on, even some forts which I ported from other versions.
« Last Edit: April 01, 2011, 12:06:43 am by forsaken1111 »
Logged

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile
Re: Dwarf Foreman 0.6 - Tool to automatically dispatch jobs to your workers
« Reply #175 on: April 01, 2011, 04:22:32 am »

FUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU

With the old MSVC, it was forgiving if you tried to free a memory address you didn't allocate.. with the new MSVC compiler he has been using since .13, it crashes every freaking time.

1) Foreman connects to DF.
2) Foreman allocates memory inside of DF and relocates the manager vector to that memory.
3) Foreman creates a job in the allocated memory space and links it into the vector.
4) DF finishes the job and tries to free its memory. "Undefined" behavior by the C standard, but harmless with MSVC 8. Crash under MSVC2010.

So ya, I finished updated it.. but its useless and causes a crash if you ever finish a job and Foreman will be on hold indefinitely until I find a resolution. I've checked, double checked, and triple checked and will check again when I wake up. I'm so spoiled by my own utility, DF isn't even fun to play without it TBH.

Anyone know a forum with REALLY elite windows hackers I can ask for help?
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?"

Kogut

  • Bay Watcher
  • Next account: Bulwersator
    • View Profile
Re: Dwarf Foreman 0.6 - Tool to automatically dispatch jobs to your workers
« Reply #176 on: April 01, 2011, 05:57:39 am »

So why it worked for forsaken?
Logged
The worst bug - 34.11 poll
Tired of going decades without goblin sieges? Try The Fortress Defense Mod
Kogut, the Bugfixes apostle of Bay12forum. Every posts he makes he preaches about the evil of Bugs.

neverknown

  • Bay Watcher
    • View Profile
Re: Dwarf Foreman 0.6 - Tool to automatically dispatch jobs to your workers
« Reply #177 on: April 01, 2011, 06:05:51 am »

hm im no coding expert but why do you relocate the vector? and how does that look like in the source?
Logged

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile
Re: Dwarf Foreman 0.6 - Tool to automatically dispatch jobs to your workers
« Reply #178 on: April 01, 2011, 06:40:12 am »

hm im no coding expert but why do you relocate the vector? and how does that look like in the source?

C++ does this anyway, because the vector needs to grow when you add things to it. I just push the process along and grow it to 1000 entries which is more than I will need and prevents it from up and moving while I am in the middle of using it. This alone isn't a problem and I can continue to use dwarf fortress in any way without a crash, since the entire vector is never freed from memory. When you add jobs from within DF it will allocate them into their own memory and also have no problem freeing them.

A STL vector in MSVC 2010 is 16 bytes. There is a pointer to its base, a pointer to its current position, and a pointer to its highest address, and then 4 bytes of unused padding.

In code, moving it from another process kind of looks like..

Code: [Select]
        const LPVOID lpvResult = VirtualAllocEx(hDF, NULL, 0x20000, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);

        const uint32_t queuebase = readDWord(queuePointer);
        const uint32_t queuepos = readDWord(queuePointer+4);
        const uint32_t queuesize = queuepos-queuebase;

        const uint32_t queue = (uint32_t *) malloc(queuesize);
        ReadProcessMemory(hDF, (void *) queuebase, (void *) queue, queuesize, 0);
        WriteProcessMemory(hDF, (void *) lpvResult, (void *) queue, queuesize, 0);
        free ((uint32_t *) queue);
        writeDWord(queuePointer, (uint32_t) lpvResult);
        writeDWord(queuePointer+4, ((uint32_t) lpvResult) + queuesize);
        writeDWord(queuePointer+8, ((uint32_t) lpvResult) + 0x0FA0);
        writeDWord(queuePointer+12, 0xDEADBEAF);

And of course, the read/write dword code looks kind of like..

Code: [Select]
uint32_t readDWord(const uint32_t address)
{
    uint32_t dword = 0;
    ReadProcessMemory(hDF, (void *) address, (void *) &dword, 4, 0);
    return dword;
}

bool writeDWord(const uint32_t address, const uint32_t data)
{
    return(WriteProcessMemory(hDF, (void *) address, &data, 4, 0));
}

It is all typically stuff we do when we hack games, it is just rare we have to add stuff that the game will want to free later :P So now I am studying the internat heap structure of MSVC 2010 and how to add my own allocations to it, 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?"

forsaken1111

  • Bay Watcher
    • View Profile
    • TTB Twitch
Re: Dwarf Foreman 0.6 - Tool to automatically dispatch jobs to your workers
« Reply #179 on: April 01, 2011, 08:25:56 am »

So why it worked for forsaken?
The test file worked for me. He didn't distribute the actual application.
Logged
Pages: 1 ... 10 11 [12] 13 14 ... 32