Exult Inventory: auto-equip the best gear and tidy party bags in Ultima VII

A patch for the Exult engine that adds two keys: one dresses the whole party in the best gear it is carrying, the other spreads the load, merges stacks and sorts every bag.

Patch on GitHub Exult

This is for you if:

Auto-equip: one key for the whole party

Press Q (or whatever key you bind to auto_equip). Each member, the Avatar first, gets the best armour, weapon and shield from everything the party carries but nobody wears — bags, bags inside bags, and the back slots. Gear another member is wearing is never taken.

A slot changes only if it is empty or holds ordinary gear that scores lower. What comes off goes into the wearer's backpack, or back where the new item came from; nothing is dropped on the ground.

Your choices stay. Anything that is not plain armour or a plain weapon — a magic ring, a lit torch, a spellbook, an item that gives immunity or light, a hood with no armour value — is treated as deliberate and is never swapped out.

Tidy: weight, stacks, order

Press Shift-Q (tidy_inventory). Three passes run in this order:

  1. Weight — single items move from the most loaded member to the least loaded one, measured as load ÷ capacity (capacity is 2 × strength stones, so a strong fighter carries more than a weak mage). It stops when everyone is within 5%. Nobody is pushed over capacity; bags themselves and spellbooks stay put. Gold and keys may move: Black Gate counts the whole party's gold and keys.
  2. Stacks — identical gold, arrows, reagents and the like are merged, up to the engine's 100 per stack. Stolen goods never merge with owned ones.
  3. Order — each bag is rebuilt as weapons, armour, ammo, other stacks, miscellaneous, then containers, and laid out again on screen.

A second press right after the first changes nothing. Both keys print what they did to the terminal ([autoequip] Iolo: great helm, [tidy] ...) and show a one-line summary in the game.

Build Exult with the patch

The patch is against upstream Exult commit 97984e9e0cbb4ccacaab0249da9c51b533818f74 (2026-10-29). It adds one source file pair and two key actions.

git clone https://github.com/exult/exult.git
cd exult
git checkout 97984e9e0cbb4ccacaab0249da9c51b533818f74
git apply /path/to/exult-inventory/exult_autoequip.patch
autoreconf -i && ./configure && make
sudo make install

It also applies together with Exult TTS, in either order.

Bind the keys

The patch adds the actions but no default keys. Copy Exult's default key file (data/bg/defaultkeys.txt, or data/si/defaultkeys.txt for Serpent Isle), add two lines, and point exult.cfg at it. Q and Shift-Q are unbound by default.

Q		auto_equip
Shift-Q		tidy_inventory
<config><disk><game><blackgate>
  <keys>/path/to/mykeys.txt</keys>
</blackgate></game></disk></config>

Tested on

Ubuntu 26.04.1 LTS with Exult 97984e9, this patch and Exult TTS, playing Ultima VII: The Black Gate. On a copy of a save, Q put plate armour on the Avatar and a great helm on Iolo and returned the old armour to the bag; Shift-Q moved 7 items, merged a stack and sorted 3 bags, and a second press changed nothing. The patch applies cleanly to a fresh checkout of that commit and builds.

Serpent Isle was not tried. The sudo make install layout above was not itself run; the game was played from a local build.

How it works inside the engine: docs/inventory_patch.md. Not affiliated with the Exult team and not submitted upstream. The patch carries Exult's licence (GPLv2).