![]() |
#1 |
Prophet
Join Date: Dec 2009
Posts: 9,022
![]() |
Sort brands by damage
Just a random suggestion: when viewing damage for a weapon, sort the listing by how much damage is dealt, and combine entries where the damage output is the same. E.g. this is the current output from an awesome randart pike I just found:
Average damage/round: 448.5 vs. evil, 550.5 vs. demons, 550.5 vs. trolls, 550.5 vs. creatures not resistant to electricity, 550.5 vs. creatures not resistant to poison, 753.5 vs. undead, and 347 vs. others. It'd be cleaner like this: Average damage/round: 753.5 vs. undead, 550.5 vs. demons, trolls, creatures not resistant to electricity, and creatures not resistant to poison, 448.5 vs. evil, and 347 vs. others. This would help emphasize that the best brand is chosen when possible, and would generally be less redundant. Obviously it's pretty minor though. |
![]() |
![]() |
![]() |
#2 |
Angband Devteam member
|
It's one of those fixes that's quite a lot of work for a definite but very modest gain. If someone sends a patch that works, it'll go straight into the nightlies - but it might be a while before the dev team get to it, since the current situation isn't terribly broken. Just sayin'.
(I say quite a lot of work because I am really bad at handling text in C, but maybe it's less difficult than I think?) |
![]() |
![]() |
![]() |
#3 |
Prophet
Join Date: Dec 2009
Posts: 9,022
![]() |
I guess the braindead way to handle it is via multiple passes through the list of valid slays. First you go through and print all the x5 slays, then all the x3, then all the x2. Because we only have a limited number of slay types and even more limited number of slay multipliers, this kind of approach works well without actually having to sort anything.
Maybe I'll take a look at this this evening, see if I can come up with something. No guarantees though. |
![]() |
![]() |
![]() |
#4 | |
Angband Devteam member
|
Quote:
|
|
![]() |
![]() |
![]() |
#5 |
Prophet
Join Date: Dec 2009
Posts: 9,022
![]() |
Well yes, clearly you'd want to have an enumeration of slay multipliers somewhere if there isn't one already. Magic numbers are (almost always) bad. I wrote it out explicitly not to say that the program would be written that way, but rather that that would be the set of steps it ends up executing...if that makes sense at all.
|
![]() |
![]() |
![]() |
#6 |
Adept
Join Date: Apr 2010
Location: Zürich, Switzerland
Age: 35
Posts: 156
![]() |
Here, try this patch: http://trac.rephial.org/ticket/1386
Implemented by sorting brands list first, then formatting adjacent items with the same multiplier. Some gruesome conditional expressions inside, but hey, that's C after all. |
![]() |
![]() |
![]() |
#7 | |
Prophet
Join Date: Apr 2007
Location: Climbing up from hole I just dug.
Posts: 4,096
![]() |
Quote:
Average damage/round: 753.5 vs. undead, 550.5 vs. demons, trolls, creatures not resistant to electricity or poison, 448.5 vs. evil, and 347 vs. others More brands: "...to acid, electricity, fire, cold, or poison..." (BTW, game uses word "lightning" in place of "electricity" in resists.) |
|
![]() |
![]() |
![]() |
#8 | |
Angband Devteam member
|
Quote:
|
|
![]() |
![]() |
![]() |
#9 | |
Adept
Join Date: Apr 2010
Location: Zürich, Switzerland
Age: 35
Posts: 156
![]() |
Quote:
|
|
![]() |
![]() |
![]() |
#10 |
Prophet
Join Date: Dec 2009
Posts: 9,022
![]() |
I purposefully didn't unify the brand descriptions because it would be easier to implement without doing so, and it doesn't make that big a difference. It would be more nicely-formatted though, I have to admit.
Thanks for making the patch, Ycombinator! I'll have to give it a shot this evening. |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Just found this place (sort of) | diabloblanco | Vanilla | 0 | February 3, 2011 08:27 |
Damage and elemental brands question | gwarguy | Vanilla | 3 | August 5, 2010 00:14 |
My own variant (sort of) | Therem Harth | Variants | 33 | July 1, 2010 09:51 |
why sort the pack? | PowerDiver | Development | 8 | April 16, 2010 02:21 |
Should brands be obvious? | Magnate | Vanilla | 8 | November 30, 2009 02:54 |