New debug command #wizobjprobs for listing item probabilities

As of the change to allow for item probabilities that don't add up
to 1000, it's become a little difficult to figure out the exact
probabilities from the source code, which makes it hard to balance
item generation. Adding a tool to list the probabilities helps.

Part of the problem is that changing an item's probability without
balancing it elsewhere is usually wrong: doing that would in effect
take the probability equally from (or add the probability equally
to) all other items in the class, which might break the balancing
of those items due to the probability change.

As such, it is usually better to make an intentional decision about
which items should be less and which items should be more likely to
generate, then change them in a balancing way (meaning that the
probabilities of objects that weren't intentionally changed remain
unchanged). Doing a complex such change makes arithmetic errors
fairly likely, though, so it's useful to have a command that verifies
that it's been done correctly.

This command is primarily intended as a development aid, so it's
included only in debug builds and pre-release builds (the same as
other similar commands like #wizmondiff).
This commit is contained in:
Alex Smith
2026-03-21 05:05:48 +00:00
parent 26fd5e7d73
commit 62a50413d3
4 changed files with 46 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ Debug-Mode Quick Reference:
#wizloadlua == load and execute a lua script
#wizmakemap == recreate the current dungeon level
#wizmondiff == [Opt] check for discrepancies in monster difficulty ratings
#wizobjprobs == [Opt] list actual probabilities of item generation
#wizrumorcheck == validate rumor indexing; also show first, second, and last
random engravings, epitaphs, and hallucinatory monsters
#wizseenv == show map locations' seen vectors