Bay 12 Games Forum

Please login or register.

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

Author Topic: DFHack 0.5.15 (legacy)  (Read 297200 times)

smjjames

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #45 on: June 25, 2010, 02:13:05 pm »

Just a slight word of warning, if you open one of the stuff (DFflows in my case) while the world is genning, I think it may cause it to wierd out and lock up cause my errorlog got a spam of random buffer overload and DF stopped responding.

The worldgen settings I use occasionally spawn one which gives buffer overload error in the errorlog while genning, so it could just be a fluke of timing and the RNG. No actual harm was done to the game though.
Logged

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #46 on: June 27, 2010, 05:50:05 pm »

Not sure if you know this already or not (too lazy to checkout the repo) but i found few offsets:
Code: [Select]
In creature gloss:
276 bytes from beginning -> pref list ( cows for hounting moos)
324 bytes  -> caste list (pointers to caste struct)
Caste struct:
0-> std::string token
28-> std::string name
56-> std::string name_plural
84-> std::string adjective
0x510 -> ptr to flag array 
0x514 -> flag array size or similar
yes last two are in hex all other are in base 10
and last one:
in caste flags offset 7 byte value 02 is can_work, or intelligent or something that enables labour menu.
Logged

jaked122

  • Bay Watcher
  • [PREFSTRING:Lurker tendancies]
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #47 on: June 27, 2010, 06:30:07 pm »

does the java virtual machine really allow memory of other processes to be edited? this would seem like a bad idea.

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #48 on: June 27, 2010, 07:25:31 pm »

does the java virtual machine really allow memory of other processes to be edited? this would seem like a bad idea.
No, the OS can do that for you. You have to deal with the OS-level stuff... or DFHack. I'd say dealing with DFHack would be easier than rewriting it from scratch in Java... or whatever other language.
Not sure if you know this already or not (too lazy to checkout the repo) but i found few offsets ...
Hmm.. the caste flags and pref list stuff seems to be new. Added to my TODO list :) I assume this is for the SDL 0.31.08 version?
Just a slight word of warning, if you open one of the stuff (DFflows in my case) while the world is genning, I think it may cause it to wierd out and lock up cause my errorlog got a spam of random buffer overload and DF stopped responding.
I'll take a look at that. But yeah... those tools aren't meant to be used outside of the 'game' mode. I honestly have no idea how the memory looks during worldgen...
Hey, I just wanted to jump in and show my support for this util. Also if it isn't too much trouble could you add an "enable magma buildings" option? Because that would go well with the liquid editor.
This needs some more infrastructure that's not currently there yet. See issue 22

I'm currently learning how to use Doxygen properly... stuff went a bit slower than I'd like. I got stung by some insect in my leg and can't walk now, so I should have some time for DFHack again... although it hurts like hell :P

Snook

  • Bay Watcher
  • Sultan of Swing
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #49 on: June 28, 2010, 01:15:18 pm »

For casting obsidian, I run into some annoying issues sometimes. I'll put down a block of magma and then try to go up a level and put down a block of water. Sometimes it works, sometimes it doesn't, saying "invalid block location" or something like that. Any reason why?
Logged
Hello my name is Kristoffer Jørgensen and I am from Norweigen
I come to see hot USA girls and history landmarks!!

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #50 on: June 28, 2010, 06:09:31 pm »

For casting obsidian, I run into some annoying issues sometimes. I'll put down a block of magma and then try to go up a level and put down a block of water. Sometimes it works, sometimes it doesn't, saying "invalid block location" or something like that. Any reason why?
Are you building towers with this?
In that case, the reason is that DF doesn't have the map entirely 'created' at all times. You can't place anything in those 'not created' places.

Otherwise it could be a bug.

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #51 on: June 29, 2010, 04:09:50 pm »

I agree.  You may have to make a construction that enters that 16x16 map block -- e.g. a ramp from the Z level below or a pair of stairways.  It is possible that a constructed wall might do as well, given that it creates a sort of floor above it.

Alternately... what happens if you save and reload the game?  That might force the map to be recomputed.  There ought to be a fully allocated and populated map block containing only air above every map block containing something solid.

Eventually I hope that DFHack will be able to reach inside DF and call its subroutines.  Then it would be possible (though hard) to populate map blocks as needed.
Logged

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #52 on: June 29, 2010, 04:43:29 pm »

Eventually I hope that DFHack will be able to reach inside DF and call its subroutines.  Then it would be possible (though hard) to populate map blocks as needed.
Well, I hope so too... it needs a layer of abstraction on top of it and a way to make it maintainable. People tried to add this already, but it was only for a single version of DF on one OS. Not very useful. I remove hacks like that eventually.

Similar approach is employed for manipulating STL strings inside DF. Code is sneaked into DF using the SDL library and DF's STL strings are accessed normally (something equivalent to std::string * name = 0x12345678). This is very low-cost when it comes to maintenance and survived... unlike the other stuff.

Brillig

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #53 on: June 30, 2010, 08:54:04 am »

Great utility

An 'enable magma buildings' utility would be very useful I believe. I spent ages making a nice volcano for my map so I wouldn't have to search for magma in the world gen for ages, then I couldn't use it :(

Edit: I just read back and noticed that someone already said the same thing :D
« Last Edit: June 30, 2010, 08:58:07 am by Brillig »
Logged

UristMcStudent

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #54 on: July 02, 2010, 05:05:39 am »

Is it possible to write something like "tile edit" and "for each tile" from gibbed's DF tweak for now?
Logged

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #55 on: July 02, 2010, 05:15:53 am »

Is it possible to write something like "tile edit" and "for each tile" from gibbed's DF tweak for now?
That would be actually trivial.

UristMcStudent

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #56 on: July 02, 2010, 05:49:22 am »

That would be actually trivial.
Sounds easy, but I never worked with DF memory before :\ Where can I found some tips?
I mean i have no idea about how and where in memory DF stores tile data.
« Last Edit: July 02, 2010, 07:00:01 am by UristMcStudent »
Logged

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #57 on: July 02, 2010, 12:51:10 pm »

That would be actually trivial.
Sounds easy, but I never worked with DF memory before :\ Where can I found some tips?
I mean i have no idea about how and where in memory DF stores tile data.
You don't have to.

One possibility is to update the addresses used by tweak. You won't be able to work with any of the coverings like mud/snow in new DF versions. Get offsets from DFHack, feed them to tweak, done. I tried to use it with 40d under win7 and got only errors back though :/
Second possibility is recreating those things on top of DFHack. This requires actual work. With tweak's sources nowhere to be found, I see no other way than this one.

You should be able to use DFHack for the actual 'hacking' part and just create a GUI on top of that. Looking at the wiki page of ForEachTile, it will need some bits a compiler would have -- lexical and syntactic analysis of expressions. Some other thing could be salvaged to create this... I have some code like that laying around in my uni projects folder :) Of course, you could cut some features and remove the text parsing part.

About tile edit: quite simple

UristMcStudent

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #58 on: July 02, 2010, 01:38:31 pm »

You don't have to.
One possibility is to update the addresses used by tweak.
I dunno why, but tweak with hashes and other stuff rewrited for 0.31.08 does not see the game launched. Neither sdl nor legacy. (dtil sees "legacy", but hangs after any action);
You won't be able to work with any of the coverings like mud/snow in new DF versions.
I won't be able to work with them in tweak or at all? If second, then how "cleanmap" works?
Well, for now i don't ever know C#, only delphi :\ But i have some books and manuals on it, and wish to do something   ::)
Logged

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.4.0.2 - tools and memory access library
« Reply #59 on: July 02, 2010, 02:27:15 pm »

I dunno why, but tweak with hashes and other stuff rewrited for 0.31.08 does not see the game launched. Neither sdl nor legacy. (dtil sees "legacy", but hangs after any action);
Well, as I said, I can't get it to work with 40d under Win7. There must be some bugs in it or I'm doing it wrong... Without the source, it's hard to tell.
I won't be able to work with them in tweak or at all? If second, then how "cleanmap" works?
Well, for now i don't ever know C#, only delphi :\ But i have some books and manuals on it, and wish to do something   ::)
In tweak. It won't understand the changes. For how it works, you can look at the source. But basically, every 16x16 block of tiles has a bunch of bitmaps. Some are default and part of the 'block' structure, and some are treated as special objects. In 31.0x, the splatter bits were moved from one of the default bitmaps to special objects to add support for all the /fun/ stuff like poisons. I just set the 'opacity' of those bitmap objects to zero, which means they don't show up in the map (and more importantly, don't interact with your dwarves).

For working with DFhack, you need C++ (or possibly Python, but that part isn't ready for general use I think).
Pages: 1 2 3 [4] 5 6 ... 108