Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005179 [DCSS] Patches feature N/A 2012-01-06 03:40 2012-01-14 16:54
Reporter dtsund View Status public  
Assigned To evilmike
Priority normal Resolution done  
Status resolved   Product Branch 0.10 ancient branch
Summary 0005179: Fraction-based success indicator
Description Attached is a patch that replaces adjective-based success rates with probability fraction failure rates. It is somewhat more brute-force than I originally intended, but I figured hard-coded strings might be better than a binary search and heap allocation every time failure_rate_to_string was called.
Additional Information
Tags No tags attached.
Attached Files txt file icon fraction_success_patch.txt [^] (11,973 bytes) 2012-01-06 04:43 [Show Content]
png file icon fail_2.png [^] (81,146 bytes) 2012-01-11 05:35


png file icon fail_1.png [^] (21,740 bytes) 2012-01-11 05:35

- Relationships

-  Notes
(0016537)
dtsund (reporter)
2012-01-06 04:10
edited on: 2012-01-06 04:44

Ignore the first patch, I was being a dumb; that's what I get for writing code while tired.

Better patch incoming soon.

EDIT: Uploaded. Note that this one actually does put the char array on the heap, so anything calling failure_rate_to_string must also call free().

(0016538)
KiloByte (manager)
2012-01-06 04:55

I do prefer fixed strings over hard-coded fractions, they're easier to localize.
(0016589)
evilmike (developer)
2012-01-09 04:17

I have tried this patch locally and I have to say, I think percentages (for failure rates) work better than fractions. Fractions do have some advantages, but I also see a serious disadvantage in that it requires the display to use a mixture of fractions and adjectives (applies to success rates worse than 1/2). I also think it's best if it only displays unit fractions, but this isn't possible for success rates worse than 1/2.

Making this display percentages is easy. The only tricky part is how to display spells that have a failure rate between 0% and 1%. For those I think displaying "< 1%" might work, but maybe that's ugly. Better than misleading the player by displaying 0%, though.

Aside from those minor issues, I'm quite in favour of this. I think this is one case in crawl where numbers are more useful to the player than adjectives (and I also think showing failure rates is better than showing success rates). I recall there being a lot of opposition to this in the past though. Is that still the case?
(0016607)
dtsund (reporter)
2012-01-10 04:47

For what it's worth, the original version of this code, used in Light, was actually meant to use percentages; I adapted it to fractions because I thought more of the DevTeam liked them, but changing from one to the other with this is easy.

I avoided the 1% problem in Light by making failure rates below 2% translate to flawless success, but I think the DevTeam was against doing that in Stone Soup.
(0016611)
minmay (reporter)
2012-01-10 20:55

I think the most graceful way to solve the problem of displaying rates between 0 and 1% as what they actually are: 0.53% or whatever. Round up from 0, so that something with a failure rate of 0.0001% displays as 0.01%; the difference between those is actually small enough to not matter in practice.
(0016612)
Galefury (updater)
2012-01-11 02:23

Just always round up. That way 1% is shown for failure rates <1%. 1% is one failure in 100 casts, 0.1% is one failure in 1000 casts, who cares about that difference? The spell is reliable either way.

In fact displaying steps of 5% would be sufficient. Steps of 1% would be better though: spell success increases continuously, not in 5% steps, and the interface should reflect that (this is currently not a problem because adjectives are expected to be vague; numbers aren't). Also only displaying 5% steps doesn't simplify the interface, it just loses information for no reason.
(0016614)
ion_frigate (reporter)
2012-01-11 04:19
edited on: 2012-01-11 04:22

@Galefury: One failure is 100 casts is significant for a cheap, common escape spell like Blink. You cast it many times, and losing a turn to miscasting it matters. How about simply rounding it to the nearest percent? That way, if you see 0%, you know that it will fail less than 1/200 of the time, while if you see 1%, you know that the failure rate is between 1/200 and 3/200. It's more precision where it matters, without being any more cluttered.

However, I would also like to point out that there's nothing particularly ugly about displaying '<1%'. Since you'll need three characters to display '99%' anyway, there's nothing screwy with spacing. Still, I would round to the nearest percent, with '<1%' meaning that 0 < failure <= 0.5%.

(0016615)
evilmike (developer)
2012-01-11 05:35

On my own computer, I currently have it so at percentages below 1% it will display 0.8%, 0.6%, etc (it uses no decimal above 1%, and only one decimal place below 1%). And if it's lower than 0.1%, it just says it's 0.1%. I don't think the interface looks too cluttered this way... I've attached two screenshots (from a tiles build, but console looks almost identical) as a demonstration.

After a few days of toying with this, I have to say I like the way I have it now a lot more than other ways:

Letting it show 0% for near-perfect spells is bad (I prefer to reserve 0% for spells that are actually perfect).

Rounding up to 1% also isn't great, because spells can go much, much lower than that, and in my opinion this is relevant information (as ion_frigate has pointed out). Plus it would be possible for players to figure out which spells are a "high 1% and which are a "low 1%" if that makes any sense.

Also, I didn't like "< 1%" much when I tried it. It gets the point across but it doesn't seem to me like there's an advantage to doing it this way. (There's also some annoying issues with using the '<' character here that need to be worked around.)

And finally, fractions just wind up being a cluttered mix of numbers and adjectives (winds up being harder to read than any of the other choices).
(0016646)
evilmike (developer)
2012-01-12 23:09

This has been applied (with percentages).
(0016673)
pivotal (reporter)
2012-01-13 17:37

This change is awesome.
(0016687)
Jack Trades (reporter)
2012-01-14 14:38

I wonder why it's decided to have Failure Rate rather than Success Rate?
I would find it much more intuitive to have a success rate in there, like in any other game.
(0016689)
ion_frigate (reporter)
2012-01-14 16:54

@Jack Trades: Nethack also uses failure rates; in most roguelikes, if you're casting a lot you want your spells near perfect, given the often-dire consequences of failure (one turn lost to failing a spell is a LOT more significant than 1-2 seconds lost in a real-time RPG). Of course, a success rate technically gives you the same information, but in roguelikes you're much more likely to think "This spell has a .5% chance of failing and costing me a turn, possibly costing me my life" than "This spell has a 99.5% chance of success."

- Issue History
Date Modified Username Field Change
2012-01-06 03:40 dtsund New Issue
2012-01-06 03:40 dtsund File Added: fraction_success_patch.txt
2012-01-06 04:09 evilmike File Deleted: fraction_success_patch.txt
2012-01-06 04:10 dtsund Note Added: 0016537
2012-01-06 04:43 dtsund File Added: fraction_success_patch.txt
2012-01-06 04:44 dtsund Note Edited: 0016537
2012-01-06 04:55 KiloByte Note Added: 0016538
2012-01-09 04:17 evilmike Note Added: 0016589
2012-01-10 04:47 dtsund Note Added: 0016607
2012-01-10 20:55 minmay Note Added: 0016611
2012-01-11 02:23 Galefury Note Added: 0016612
2012-01-11 04:19 ion_frigate Note Added: 0016614
2012-01-11 04:22 ion_frigate Note Edited: 0016614
2012-01-11 04:22 ion_frigate Note Edited: 0016614
2012-01-11 05:35 evilmike Note Added: 0016615
2012-01-11 05:35 evilmike File Added: fail_2.png
2012-01-11 05:35 evilmike File Added: fail_1.png
2012-01-12 23:09 evilmike Note Added: 0016646
2012-01-12 23:09 evilmike Status new => resolved
2012-01-12 23:09 evilmike Fixed in Branch => 0.10 development branch
2012-01-12 23:09 evilmike Resolution open => done
2012-01-12 23:09 evilmike Assigned To => evilmike
2012-01-13 17:37 pivotal Note Added: 0016673
2012-01-14 14:38 Jack Trades Note Added: 0016687
2012-01-14 16:54 ion_frigate Note Added: 0016689


Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker