weirdgloop / osrs-dps-calc

Web-based DPS calculator for Old School RuneScape
GNU General Public License v3.0
30 stars 42 forks source link

Revisit ToA scaling mechanics #158

Closed LlemonDuck closed 5 months ago

LlemonDuck commented 9 months ago

Although the ToA path scaling seems to be correct in most cases, it is not correct in all cases. We should learn more about how this is implemented and try to get closer to the actual implementation.

The current confusions stems from the formulas derived by others using round() instead of truncate(). Jagex does not typically use round() at all, so we should see if there is a fitting formula that works using truncate() instead.

Some test case data has been provided in a google doc by discord user Orion: https://docs.google.com/spreadsheets/d/1UMhrL8NMSZBSw5AtlT0QRnN0TK-UWDd6BorZvoD3WWQ/edit?usp=sharing

jmyaeger commented 9 months ago

Not sure if you saw in the Discord channel, but Cook came up with a way to make it work with just truncate().

Here is my Python code that uses that implementation (this is in the context of being a method of a Monster class:

toa_level_bonus = 1000 + self.toa_level * 4
toa_path_level_bonus = 1080 + (self.toa_path_level - 1) * 50 if self.toa_path_level > 0 else 1000
level_scaled_hp = int(self.hitpoints * toa_level_bonus / 1000)
path_scaled_hp = int(level_scaled_hp * toa_path_level_bonus / 1000)

if self.name in constants.TOA_PATH_MONSTERS:
    unrounded_hp = path_scaled_hp
else:
    unrounded_hp = level_scaled_hp

if unrounded_hp < 100:
    return unrounded_hp
elif unrounded_hp < 300:
    return int((unrounded_hp + 2) / 5) * 5
else:
    return int((unrounded_hp + 5) / 10) * 10

This has worked in all of my test cases.

LlemonDuck commented 5 months ago

Embedding the sheet values here so they aren't lost:

150 RL solo    
Monster Path level HP
Level 56 Baboons 0 6
Level 68 Baboons 0 12
Baboon Shaman 0 25
Baboon Thrall 0 3
Cursed Baboon 0 16
Ba-Ba 0 610
Kephri (shield up) 0 240
Kephri (shield down) 0 130
Spitting/Soldier/Arcane Scarabs 0 64
Akkha 0 640
Akkha's Shadow 0 110
Zebak 0 930
Obelisk   420
Wardens P2   225
Core   5180
Wardens P3   1410
300 RL solo    
Monster Path level HP
Level 56 Baboons 2 8
Level 68 Baboons 2 17
Baboon Shaman 2 35
Baboon Thrall 2 4
Cursed Baboon 2 22
Ba-Ba 2 940
Kephri (shield up) 1 360
Kephri (shield down) 1 190
Spitting/Soldier/Arcane Scarabs 1 95
Akkha 1 950
Akkha's Shadow 1 165
Zebak 0 1280
Obelisk   570
Wardens P2   310
Core   5850
Wardens P3   1940
350 RL solo    
Monster Path level HP
Level 56 Baboons 0 9
Level 68 Baboons 0 19
Baboon Shaman 0 38
Baboon Thrall 0 4
Cursed Baboon 0 24
Ba-Ba 0 910
Kephri (shield up) 1 390
Kephri (shield down) 1 205
Spitting/Soldier/Arcane Scarabs 1 105
Akkha 1 1040
Akkha's Shadow 1 180
Zebak 2 1570
Obelisk   620
Wardens P2   340
Core   6080
Wardens P3   2110
400 RL solo    
Monster Path level HP
Level 56 Baboons 0 10
Level 68 Baboons 0 20
Baboon Shaman 0 41
Baboon Thrall 0 5
Cursed Baboon 0 26
Ba-Ba 0 990
Kephri (shield up) 1 420
Kephri (shield down) 1 225
Spitting/Soldier/Arcane Scarabs 1 110
Akkha 2 1180
Akkha's Shadow 2 205
Zebak 1 1630
Obelisk   680
Wardens P2   360
Core   6300
Wardens P3   2290
405 RL solo    
Monster Path level HP
Level 56 Baboons 3 10
Level 68 Baboons 3 20
Baboon Shaman 3 41
Baboon Thrall 3 5
Cursed Baboon 3 26
Ba-Ba 3 1170
Kephri (shield up) 1 420
Kephri (shield down) 1 225
Spitting/Soldier/Arcane Scarabs 1 110
Akkha 3 1240
Akkha's Shadow 3 215
Zebak 1 1640
Obelisk   680
Wardens P2   370
Core   6300
Wardens P3   2310
450 RL solo    
Monster Path level HP
Level 56 Baboons 6 11
Level 68 Baboons 6 22
Baboon Shaman 6 44
Baboon Thrall 6 5
Cursed Baboon 6 28
Ba-Ba 6 1420
Kephri (shield up) 3 500
Kephri (shield down) 3 265
Spitting/Soldier/Arcane Scarabs 3 130
Akkha 4 1380
Akkha's Shadow 4 240
Zebak 3 1920
Obelisk   730
Wardens P2   390
Core   6530
Wardens P3   2460
500 RL solo    
Monster Path level HP
Level 56 Baboons 2 12
Level 68 Baboons 2 24
Baboon Shaman 2 48
Baboon Thrall 2 6
Cursed Baboon 2 30
Ba-Ba 2 1290
Kephri (shield up) 3 530
Kephri (shield down) 3 285
Spitting/Soldier/Arcane Scarabs 3 140
Akkha 4 1480
Akkha's Shadow 4 260
Zebak 3 2050
Obelisk   780
Wardens P2   420
Core   6750
Wardens P3   2640
540 RL solo    
Monster Path level HP
Level 56 Baboons 2 12
Level 68 Baboons 2 25
Baboon Shaman 2 50
Baboon Thrall 2 6
Cursed Baboon 2 31
Ba-Ba 2 1360
Kephri (shield up) 3 560
Kephri (shield down) 3 295
Spitting/Soldier/Arcane Scarabs 3 150
Akkha 4 1550
Akkha's Shadow 4 270
Zebak 3 2160
Obelisk   820
Wardens P2   440
Core   6930
Wardens P3   2780
Raid level Path level Scarab HP Kephri (Shield up) HP
150 1 69 260
150 2 72 270
150 3 75 285
160 0 65 245
160 1 70 265
160 2 73 275
160 3 76 290
170 3 79 295
180 2 76 290
180 3 80 300
190 3 82 310
200 3 84 320
210 3 86 330
220 3 88 330
230 3 89 340
240 3 92 350
260 3 95 360
270 3 97 370
290 3 100 380
300 3 105 390