Forgottenserver: Players gain magic level 4 times as fast as in real Tibia

Created on 7 May 2019  Â·  6Comments  Â·  Source: otland/forgottenserver

Players gain magic level 4 times as fast as in real Tibia, because mana required to go from magic level 0 to 1 is incorrectly set to 400:
https://github.com/otland/forgottenserver/blob/bcb86eac0655c58b8dc9a35c652f8953a0edd033/src/vocation.cpp#L207
The correct value is 1600 (source: http://www.tibia-stats.com/index.php?akcja=skillCalcMagic)

Issue can be easily reproduced by spending some amount of mana on a character with magic level 0 and comparing the progress to the values from tibia-stats.com (and of course taking rateMagic from config.lua into account).

bug

Most helpful comment

I tested it just before posting about the results. There weren't any skill events today (May 7).
As far as the PR goes, I'll open it soon (within 24 hours, most likely).

All 6 comments

If you really are sure that's the intended value for such constant than you could open a pull request.

I've just made sure 1600 is the correct value by making the following test in real Tibia:

  1. I created a new character, turned it into a sorcerer on Dawnport.
  2. It had magic level 4 and about 3% to go, so I advanced to magic level 5 and exactly 100% to go (thanks to the scorcher, which takes 1 mana with every shot).
  3. I advanced to magic level 6 (and exactly 100% to go). To do so, I had to spend exactly 2576 mana (1 mana less wasn't enough).
    1600 * (1.1)^5 = 2576.816
    2576 is also the value given by tibia-stats.com

Did you make sure you had exactly 100.00% to go by verifying your magic level percentage on Cyclopedia -> Character -> Magic? If so, it makes sense, and you should open a PR.

By the way, did you check other vocations too? to make sure their magic level multipliers are still correct with this new 1600 constant.

Actually I haven't thought about using Cyclopedia (forgot that more detailed info about skill progress is there), but my test should ensure this was exactly the case. Although I can confirm that after reaching magic level 6, it is indeed 100.00% to go according to the Cyclopedia.

Anyway, even if I were to be off (but I really don't think this is the case), it would be by 1 or 2 mana – not by 1200.

I also haven't checked other vocations, but exactly the same magic level multipliers are used on tibia-stats.com and if they calculate required mana for sorcerers properly (even rounding is correct), I think it's safe to assume they got other vocations right, too.

This test has also proven that the following way of rounding (to the nearest multiple of 20)
https://github.com/otland/forgottenserver/blob/bcb86eac0655c58b8dc9a35c652f8953a0edd033/src/vocation.cpp#L207-L216
is incorrect, so that's another thing which should be fixed. Although it's of course much less significant than the main bug. Unfortunately I don't know how _exactly_ it should be rounded (my guess is it's simply rounded down to the nearest integer?), so if I were to open a PR, it'd only fix the bug stated in the title.

Yeah, it'd be okay to open a PR to fix just the main issue so that this can be closed as soon your PR is merged. Then you can open another issue detailing the second problem so that it can be easily tracked and probably fixed by someone.

BTW, when did you test this? was it without any skill event bonus?

I tested it just before posting about the results. There weren't any skill events today (May 7).
As far as the PR goes, I'll open it soon (within 24 hours, most likely).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Imperians picture Imperians  Â·  4Comments

MillhioreBT picture MillhioreBT  Â·  4Comments

GoularPink picture GoularPink  Â·  3Comments

irenicus30 picture irenicus30  Â·  5Comments

Zbizu picture Zbizu  Â·  5Comments