[Fixed] Discrepancy in spell hunger


Ask fellow adventurers how to stay alive in the deep, dark, dangerous dungeon below, or share your own accumulated wisdom.

Halls Hopper

Posts: 89

Joined: Friday, 8th January 2016, 15:50

Post Friday, 19th February 2016, 14:21

[Fixed] Discrepancy in spell hunger

Edit : I have updated the wiki after this message

It seems the algorithm or values defined here are wrong :

http://crawl.chaosforge.org/Spell_Hunger

According to the above formula, with 22 int and 12 spell casting I should have a hunger reduction of 22 *12 = 264.

For a 5 level spell, that translates to 350 - (22 * 12) = 86 hunger cost, which according to the same page should be represented by ###...

However I got something like :

  Code:
Health: 88/88      AC: 22    Str: 11    XL:     14   Next: 98%
Magic:  30/30      EV: 21    Int: 22    God:    Vehumet [****..]
Gold:   763        SH:  6    Dex: 14    Spells: 6 memorised, 18 levels left

 + Level 12.0 Spellcasting

d - Lee's Rapid Deconstr  Erth           ######....   1%          5    ####...
e - f - Fireball              Conj/Fire      ######....   1%          5    ####...


I got 4 # instead of the 3 I was expecting.

So either the calculation is wrong, the spell cost is higher than 350 at lvl 5, or the display is wrong.

The page seems to be rather old (0.13) so is anyone aware of a change between 0.13 and 0.17. I'd like to understand what is my "real" hunger cost. It is not game changing but between a hunger cost of 80 and 120 that is 50% percent difference which is not that negligible.

In the other case, I'll go source diving and try to find the explanation.

Should be able to find out from spl-cast.cc
  Code:
string spell_hunger_string(spell_type spell, bool rod)
{
    return hunger_cost_string(spell_hunger(spell, rod));
}
Last edited by seren on Friday, 19th February 2016, 15:11, edited 3 times in total.

Dungeon Master

Posts: 388

Joined: Monday, 18th August 2014, 20:04

Post Friday, 19th February 2016, 14:36

Re: Discrepancy in spell hunger

I found the following change:

  Code:
--------------------------------------------------------------------------------
3d54b91 | Nicholas Feinberg | 2014-10-15 08:34:19 -0700

Tweak spell hunger numbers
Only notable effect is increasing level 5 spell hunger (by <15%),
to smooth over an odd discontinuity that minmay noticed.

The old numbers seem to date back to pre-Stone-Soup; I of course
can find no reasoning on them.


Seems like that covers exactly your case.

For this message the author advil has received thanks:
seren

Halls Hopper

Posts: 89

Joined: Friday, 8th January 2016, 15:50

Post Friday, 19th February 2016, 14:42

Re: Discrepancy in spell hunger

Thanks a lot ! Given the name of the branch (or the time range), I assume this was introduced in 0.16 ?

This is just to provide the right information in the wiki history.

Edit: Updating the wiki means I need to regenerate the table with the right color, it might take longer than expected..

It is true that looking at the table, the "yellow" part is bigger than expected.

Oddly enough, the code also contains code for spell outside of [1 - 9] range :

  Code:
    if (level < 10 && level > 0)
        hunger = basehunger[level-1];
    else
        hunger = (basehunger[0] * level * level) / 4;


And -2 spell cost as much as a 1 level spell :)

Dungeon Master

Posts: 388

Joined: Monday, 18th August 2014, 20:04

Post Friday, 19th February 2016, 15:04

Re: Discrepancy in spell hunger

seren wrote:Thanks a lot ! Given the name of the branch (or the time range), I assume this was introduced in 0.16 ?

This is just to provide the right information in the wiki history.


That's what I'd assume, it's tagged with 0.16-b1. Btw I didn't do any kind of thorough search, so I could have missed something else that happened -- I really just searched in the full changelog (warning, big file). I have used that table recently and it seemed accurate for higher level spells though.

Halls Hopper

Posts: 89

Joined: Friday, 8th January 2016, 15:50

Post Friday, 19th February 2016, 15:10

Re: Discrepancy in spell hunger

advil wrote:
seren wrote:Thanks a lot ! Given the name of the branch (or the time range), I assume this was introduced in 0.16 ?

This is just to provide the right information in the wiki history.


That's what I'd assume, it's tagged with 0.16-b1. Btw I didn't do any kind of thorough search, so I could have missed something else that happened -- I really just searched in the full changelog (warning, big file). I have used that table recently and it seemed accurate for higher level spells though.


I checked that the cost was still 400 in 0.17 and updated the wiki accordingly.

Dungeon Master

Posts: 388

Joined: Monday, 18th August 2014, 20:04

Post Friday, 19th February 2016, 15:30

Re: Discrepancy in spell hunger

seren wrote:
advil wrote:
seren wrote:Thanks a lot ! Given the name of the branch (or the time range), I assume this was introduced in 0.16 ?

This is just to provide the right information in the wiki history.


That's what I'd assume, it's tagged with 0.16-b1. Btw I didn't do any kind of thorough search, so I could have missed something else that happened -- I really just searched in the full changelog (warning, big file). I have used that table recently and it seemed accurate for higher level spells though.


I checked that the cost was still 400 in 0.17 and updated the wiki accordingly.


Thanks for doing this, it's a very useful table. In that same patch there were very tiny tweaks to L2,3 spells as well that it looks like you might have missed?

Halls Hopper

Posts: 89

Joined: Friday, 8th January 2016, 15:50

Post Friday, 19th February 2016, 15:35

Re: Discrepancy in spell hunger

advil wrote:Thanks for doing this, it's a very useful table. In that same patch there were very tiny tweaks to L2,3 spells as well that it looks like you might have missed?


Ah you are right, I was focused on fixing "my" problem. I'll fix it later today. Thanks for the reminder

Return to Dungeon Crawling Advice

Who is online

Users browsing this forum: No registered users and 54 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.