Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Modding the Amount of Embark Dwarves  (Read 2708 times)

Legitimation

  • Escaped Lunatic
    • View Profile
Modding the Amount of Embark Dwarves
« on: February 20, 2012, 03:23:30 pm »

Since DFHack and DFusion haven't been updated yet and the previous methods used that I had been using to change the amount of dwarves I embarked with hadn't had their offsets located, I decided to find these myself.

The methods I am referring to are memory hacking via cheat engine and simple hex editing of the df executable. I learned about these methods here:

http://www.bay12forums.com/smf/index.php?topic=78311.0
http://www.bay12forums.com/smf/index.php?topic=59928.0

Memory Hacking

With this method, you have to edit the memory each time you wish to embark.

  • Open up dwarf fortress 0.34.02
  • Open up cheat engine and open the dwarf fortress process
  • From here you have to add an address manually
  • The address you are looking for is 9AA180
  • Right click on the newly add item in the list box at the bottom and select "Change Record -> Value"
  • You can change this value to anything you want that is above 7. Less than 7 will crash DF. I believe this value is a 32 bit unsigned int but the program freezes up after a couple hundred million dwarves... In theory, a 4 billion dwarf outpost on embark, in reality, probably a couple thousand for those with beefy machines.


Hex Editting the DF Executable
  • DF SDL executable
  • Hex editor such as HXD or Hex Workshop

This change is persistent and as long as you use this executable, the amount of embark dwarves will be the same.
  • Launch your hex editor and open up your dwarffortress.exe
  • Bring up the go function (ctrl+g) and go to the offset 0x5A9580
  • You should see the string of bytes "24 18 07 00 00 00 8B 35" and as you probably guessed, the 07 00 00 00 string of bytes is the amount of embark dwarves.
  • If you read the memory hacking segment, you would know that these bytes allow for a lot larger amount of dwarves than your computer can handle. Ideally this should be left well under 1000 dwarves. These bytes are also little endian aligned so instead of being 7000000 its actually 00000007. Remember to convert the amount of dwarves you want into hex before changing the value.

A problem I have noticed is that if you edit a number of dwarves for your embark that is larger than your population cap, immigrants will keep coming.

I also don't see a point in finding the offsets for 0.34.01 as Toady has said they have a save corrupting glitch in them and these methods require you to make a new fortress so it really makes no sense to create a new fort in a version that has a save corrupting bug.
Logged

jocan2003

  • Bay Watcher
    • View Profile
Re: Modding the Amount of Embark Dwarves
« Reply #1 on: May 19, 2012, 06:17:13 am »

I just want to confirm this is working for the latest 0.34.09 version.
Logged
Quote from: LoSboccacc
that was a luky dwarf. I had one dabbling surgeon fail so spectacularly that the patient skull flew a tile away from the table.
Quote from: NW_Kohaku
DF doesn't mold players into its image - DF merely selects those who were always ready for DF.
Quote from: Girlinhat
Minecraft UI is very simple. There's only so many ways you can implement "simple" without copying something. We also gonna complain that it uses WASD?

Boes

  • Bay Watcher
    • View Profile
Re: Modding the Amount of Embark Dwarves
« Reply #2 on: May 22, 2012, 04:30:39 pm »

do you happen to have the address for 34.10?

Edit:   Nvm I just found it with your search pattern.


Code: [Select]
0079E0D0
use the same as above for cheat engine memory editing
« Last Edit: May 22, 2012, 04:39:42 pm by Boes »
Logged
Life has a 100% mortality rate.

MegaLowVoltage

  • Escaped Lunatic
    • View Profile
Re: Modding the Amount of Embark Dwarves
« Reply #3 on: December 11, 2013, 11:55:48 pm »

Continuing confirmation... works with 0.34.11.

Thank you!  :)
Logged
“Slabs for the dead! And chains of silver for the living!”

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Modding the Amount of Embark Dwarves
« Reply #4 on: December 12, 2013, 01:02:33 am »

Continuing confirmation... works with 0.34.11.

Thank you!  :)

There's also a DFHack Ruby script.