@Weng
Well, the most recent encounter in ImpMisA was a graveyard, lots of undead. Seems to have been spontaneous necromancy though, rather than an actual necromancer.

Dammit, now I need to find some wood to knock on...

I haven't looked closely at the save/maps, but some evil biomes can have a resurrection effect on anything within their square on the local map. It's randomized, and the only way to know is to test it (or DFHack).

Necromancer attacks will only happen if you're within 10 world map squares of a tower (Tab on embark screen to check). They can happen at any point until the tower runs out of necromancers. Necromancers can ambush onto the map and invisibly raise stuff. You're going to want a LOT of hammer dwarfs to put them down, and you don't want anything that can dismember crud, because of a bug where a moving feather and such can't be put down and it can end a fortress by itself.

Ah, I'm not using Ben's worldgen. I didn't have the patience for that shit

12:58 * EldrickWT imagines a time when buildmaster is compiling, TESTING, and
!!RUNNING!! df and making !@#$%^&*(DEMANDS)*&^%$#@! of BenLubar,"Give
This Unit more tags, more scripts, more mods. . . /NOW/. End of Line."
12:59 * EldrickWT returns you all to your regularly scheduled, unk_571,
already in progress.

I set my AI to force a migrant wave to happen every day instead of once per season at most. This effectively locks the population of the fortress at the population cap (200 via migrants, 220 total, by default, so that fortresses aren't able to slow themselves down to a halt). So far the only issue it's run into is that it ran out of food (but not booze) and some dwarves started trying to find rodents and bugs to eat and then they found a corpse and got "interrupted" by their emotions.

13:23 < BenLubar> autolabor status says this: 1392 IDLE, 11 BUSY, 15 MILITARY,
102 CHILD, 177 OTHER
13:23 < zombifier> did you rent your CPU from NASA
13:23 < BenLubar> nah it's running at 0 fps
13:24 < BenLubar> I have it set to force a migrant wave every day
13:24 < BenLubar> surprisingly, RAM usage isn't up very much from when I
started the embark
13:26 < zombifier> your house should be on fire by now
13:33 < ab9rf> i'm impressed that it hasn't crashed outright

So @Quietust did some research on the algorithm traders use to determine whether a trade is acceptable. It turns out the algorithm is insanely complicated and interacts with the cultural values, personal opinions, skills, and some random numbers for both the broker and the trader, as well as the total and relative values of the trade goods, which is computed using a complicated algorithm mifki reverse engineered for the remote control iOS app.

So I ended up switching to a slightly simpler algorithm:

Offer 110% of the value of the items being requested.

If the trader rejects the offer, request 10% fewer items by value.

If the trader gives a counter-offer, immediately accept it.

Stop when the trade is accepted or the trader gets too annoyed and makes the caravan leave.

Here's the output once I fixed a fencepost error and a bug where the AI would offer wooden barrels full of food to elves, who would be offended by the murdered trees while somehow not changing the "mood" value at all:

All aside, Plump Helmets are a variety of mushroom in the Dwarf Fortress world that grow as big as standard foodstuff crops, which they're used for. They're (in my opinion) one of the easiest plants to farm in the game, and you can make both meals and booze from them, so they're super-useful for dwarves, especially to bring with to a new fortress if you're playing Fortress Mode.

It appears my AI is severely undervaluing musical instruments and any trade it successfully completes is just out of pure luck. The 283☼ instrument only adds 188☼ to the total, and it only desynchronizes more from that point:

The trade being slightly in the trader's favor makes them willing to negotiate:

Changes since the previous version

Lockstep Mode

Lockstep mode replaces the entire event loop of Dwarf Fortress, making Dwarf Fortress run inside df-ai instead of the other way around. This allows df-ai to make the game think it's running at the default frame rate regardless of how fast the game is actually running, and add information about what the AI is thinking to the recorded CMV files.

Enable or disable lockstep mode at any time using ai enable lockstep or ai disable lockstep.

Lockstep mode is saved in df-ai-config.json, so it can also be toggled in that file if Dwarf Fortress is not running.

Dwarf Fortress will ignore all input while lockstep mode is active, but DFHack commands will work normally.

Lockstep mode does not work with [PRINT_MODE:TEXT], so Linux and Mac users that want headless df-ai will need Xvfb or a similar program and [PRINT_MODE:2D].

Lockstep mode modifies code in memory when it is enabled or disabled, so there is a risk of crashing Dwarf Fortress. However, there should not be any higher risk of crashing when not in the middle of toggling lockstep mode.

Lockstep mode pretends to run at 100 simulation frames per second.

Lockstep mode pretends to run at 50 graphical frames per second during gameplay and 100 graphical frames per second when menus are open.

I say "pretends" because lockstep mode will run as fast as the resources given to Dwarf Fortress will allow it to run.

If a CMV is already being recorded when lockstep mode is enabled, the console will not be displayed. To avoid this, restart Dwarf Fortress after enabling lockstep, or enable lockstep in df-ai-config.json before starting Dwarf Fortress.

Trading

df-ai now attempts to trade with merchants! Currently, the goods offered and requested are from a hard-coded list, but this may be extended in the future. This is also the first use of the "exclusive" mode in df-ai, where the AI can stop everything it's doing to focus on menus. Watch it in action!

When a caravan arrives, dwarves are ordered to bring all prepared meals and food storage containers containing exclusively prepared meals to the depot.

The broker is tracked, and if they are taking too long to arrive, other dwarves will be requested instead.

If the trade goods take too long to arrive at the depot, trading will happen before all the goods have arrived.

The dwarves will trade for (in order, from "need" to "would be nice to have"):

Logs

Anvils (only if none are available and a forge is waiting to be built)

Books and other items containing writing

Musical instruments

The rest:

Boulders

Bars (metal, ash, soap, etc.)

Cloth

Leather

Thread

Cooking ingredients

The AI does not attempt to handle modded worlds where multiple civilizations can arrive during the same season to trade. In this case, some caravans may be ignored, depending on the timing of arrival and departure.

The AI will attempt to please civilizations opposed to plant murder, but wood products such as soap, certain types of glass, and decorations are not handled.

Civilizations opposed to animal murder are also handled, but this has no effect in unmodded worlds.

The AI will attempt to give the trader a good deal, starting with offering at least 110% of the requested value, and adding offerings or removing requests each time the trade is declined. Counter-offers are accepted immediately.

Fortress Layout

This update fixes several bugs that could ruin or halt the progress of a fortress. Steps have been taken to streamline the fortress building process and to make the AI more efficient.

Fixed some cases where the AI would try to dig a room that was not connected to any room the dwarves could access and get stuck.

The AI will no longer attempt to patch the floors it removed from the well.

Room, furniture, and item types are now identified internally by numbers instead of text. This will make the AI faster as well as reduce the chance of bugs related to typos.

Farms can now be built in places with trees or shrubs. The plants will be removed before the farm is built.

Furniture-related tasks have been split into a separate queue, so having a large migrant wave no longer slows down workshop building by requesting a large amount of furniture.

Claimed bedrooms, noble rooms, rooms being built while idle, and cavern exploration no longer count towards the limits of other room types being built.

Rooms that are planned but not yet ready to be dug are highlighted in blue instead of yellow.

Room priority has been modified. For example, the trade depot will now be built much earlier and the library and temple will be built much later.

Certain rooms will be smoothed and then engraved when the AI is idle.

Walls will no longer be smoothed if they are to be removed later.

The dwarves will keep the pitting tower free of trees and other objects that could break the fall of its victims.

Added an additional level below the fortress for food storage.

The trade depot now has ramps on the eastern side if it is to the east of the fort entrance.

Fixed some cases where aqueduct tunnels would not line up, causing flooding and death.

Custom workshops and furnaces can now be built if you edit the floorplan manually.

Other Changes

The camera position will be saved in more situations, most noticeably when migrants arrive.

AI camera control can now be enabled and disabled while the game is running with ai enable camera and ai disable camera.

The AI no longer freezes when the outpost liaison greets a land-holding dwarf.

Unpausing now happens after a specific number of frames, not an amount of real time.

The AI is less interested in watching people sleep.

Dwarves will now remove clothing from goblins even if they are outside.

The embark information screens will now be displayed before confirming the embark location.

Immigrant mothers will still drop their babies on the floor, but now they'll go back to pick them up. (See Dwarf Fortress bug 0005551.)

Book bindings will be made, and library books will now be bound.

Toys will be made for the children to play with.

Above-ground farm plots will now consider biome when deciding what plants to grow.

Including DFHack 0.43.05-r2, all 16 of the binary downloads were built using BuildMaster in my mother's basement tonight.