DGoldDragon28 / Unangband

A roguelike originally created (and developed until version 0.6.4c) by Andrew Doull.
https://dgolddragon28.github.io/Unangband/
GNU General Public License v2.0
59 stars 6 forks source link

Please consider displaying total charges instead of average in stacks #13

Open aeoo opened 7 years ago

aeoo commented 7 years ago

Unangband allows one to stack items with charges such as torches, lanterns, and most importantly wands.

However, it displays only the average charges-per-item when displaying a stack. So if I have a stack of "6 Pewter Wands of Spark (17 charges)" and I zap it once, I may get a message saying "17 charges remaining" even after I zap it a few times. This is deceptive and uninformative, but mathematically it is correct because the game is dividing the charge total by the number of wands to get the average.

I think it would be better to display the charge total instead, so for example, the above line might read "6 Pewter Wands of Spark (101 charges)" where 17 * 6 is 102. That way I will know my charge count exactly, and when the game prints feedback after each zapping, a correct and informative charge total will be displayed like "100 charges remaining" and then "99 charges remaining" instead of the average.

And when the player unstacks the wands by dropping one, the game can continue behaving like it does now: calculate the average-per-item charges and drop one item with that number of charges on the ground.

aeoo commented 7 years ago

Also if the long numbers become an issue when the charges are in the thousands, I think it may be a good idea to abbreviate them as for example "14.9k", which gives one plus or minus 100 charges accuracy, which is good enough when one has that many charges. Once the charges drop below 1000, then they can be displayed as 999, 867 and so on. It might even be OK, or better maybe, to drop the decimal, which will save 2 characters. Then the player would see 2k, 3k, and so on, whenever they had at least that many charges (so no rounding up). Right now a full lantern has 15000 charges which is 5 characters, so the number with the decimal will not exceed this number of characters (5), and will print a pretty accurate total of charges up to 99.9k.

A nice side effect of using only 3 or fewer characters instead of 5 to display charges on lanterns, (so 15k for a full lantern and 7k for a store-bought lantern, up to 99k for a big stack, and then **k for a huge stack) is that it will leave a bit more space to display any other special properties of lanterns, like all their (+1) enchantment bonuses and whatnot.

I don't know if anyone will ever stack enough full lanterns to get into the millions of charges to worry about that, but who knows. Anything over 99.9k could be displayed as **.*k to just let the player know that it's too many to worry about, and then maybe the exact count of charges could be displayed when "I"inspecting the stack and in any relevant play feedback messages.

I don't think it should be an issue with wands. I think this huge charge count issue will only affect lanterns and torches.