Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Drop formula

Imri Persiado
Joined
May 17, 2008
Messages
941
Reaction score
26
You are not funny and your posts are useless.
 
Junior Spellweaver
Joined
Aug 31, 2009
Messages
119
Reaction score
22
And all the help we provided is useless aswell, since EVERY SINGLE time we answer with the correct answer, you feel more clever than all of us and tell us your solution is the best.
GTFO
 
Imri Persiado
Joined
May 17, 2008
Messages
941
Reaction score
26
I never said that my solution is the best and I never said that I am cleaver.. It's not to place to fight so please stop.
 
Skilled Illusionist
Joined
Apr 20, 2009
Messages
351
Reaction score
212
You mentioned that Gregoo said they must add up to 10000; the answer is concise and not wrong, and he's not usually very flexible on "options" or "alternatives", so I can see him doing that. If he was to answer, I wouldn't be surprised to see him just drop that "Holy Grail" on us, "Bye" and watch us all "OMG". (I know he's not likely to respond to this thread [for many reasons] I just love how he does that.:eek:tt1:)
That's completely offtopic, but I'm wondering something.
Why do I appear in your reply ?

EDIT: Here's a little edit to make it a bit less offtopic xD

When reading this monster file (it's just the drop list part) :

Code:
*¾ÆÀÌÅÛÄ«¿îÅÍ		1
*¾ÆÀÌÅÛ		588	¾øÀ½
*¾ÆÀÌÅÛ		7136	µ·	200	375
*¾ÆÀÌÅÛ		1476	ps101 	pl101
*¾ÆÀÌÅÛ		492		wa101	wh101	wp101	wt101	gp101	ws999
*¾ÆÀÌÅÛ		246		gp101	gp101	ds101	db101	dg101
*¾ÆÀÌÅÛ		62		os103	gp109

The server produces this :
Code:
2F0300A0  10 27 00 00|01 00 00 00|00 00 00 00|29 00 00 00| '.........)...
2F0300B0  00 00 00 00|F0 00 00 00|00 00 00 00|4C 02 00 00| ...........L..
2F0300C0  00 00 00 00|00 01 01 05|E0 1B 00 00|C8 00 77 01| ........w
2F0300D0  00 01 03 04|E2 02 00 00|00 00 00 00|00 01 02 04| ........
2F0300E0  E2 02 00 00|00 00 00 00|00 01 01 01|62 00 00 00| .......b...
2F0300F0  00 00 00 00|00 01 03 01|62 00 00 00|00 00 00 00| .....b.......
2F030100  00 01 05 01|62 00 00 00|00 00 00 00|00 01 08 01| .b........
2F030110  62 00 00 00|00 00 00 00|00 01 02 08|62 00 00 00| b........b...
2F030120  00 00 00 00|00 01 02 08|31 00 00 00|00 00 00 00| .....1.......
2F030130  00 01 02 08|31 00 00 00|00 00 00 00|00 01 04 02| .1........
2F030140  31 00 00 00|00 00 00 00|00 01 02 02|31 00 00 00| 1........1...
2F030150  00 00 00 00|00 01 03 02|31 00 00 00|00 00 00 00| .....1.......
2F030160  00 03 35 02|1F 00 00 00|00 00 00 00|00 09 02 08| .5.........
2F030170  1F 00 00 00|00 00 00 00|00 00 00 00|00 00 00 00| ...............
2F030180  00 00 00 00|00 00 00 00|00 00 00 00|00 00 00 00| ................


01. (10 27 00 00) The sum of the numbers : 588 + 7136 + 1476 + 492 + 246 + 62 = 10000(d) = 2710(h).
02. (01 00 00 00) 1 drop at the time (*¾ÆÀÌÅÛÄ«¿îÅÍ).

03. (00 00 00 00) ?
04. (29 00 00 00) ?
05. (00 00 00 00) ?
06. (F0 00 00 00) ?

07. (00 00 00 00) ID#1
08. (4C 02 00 00) Rate#1 : 588
09. (00 00) Gold#1a
10. (00 00) Gold#1b

Code:
08C465AF  00 01 01 05|47 6F 6C 64|00 00 00 00|00 00 00 00| .Gold........
08C465BF  00 00 00 00|00 00 00 00|00 00 00 00|00 00 00 00| ................
08C465CF  00 00 00 00|47 47 31 30|31                       ....GG101
11. (00 01 01 05) ID#2 : GG101
12. (E0 1B 00 00) Rate#2 : 7136
13. (C8 00) Gold#2a : 200
14. (77 01) Gold#2b : 375

Code:
08C3009F  00 01 03 04|53 6D 61 6C|6C 20 20 53|74 61 6D 69| .Small  Stami
08C300AF  6E 61 20 50|6F 74 69 6F|6E 00 00 00|00 00 00 00| na Potion.......
08C300BF  00 00 00 00|50 53 31 30|31                       ....PS101
15. (00 01 03 04) ID#3 : PS101
16. (E2 02 00 00) Rate#3 : 738 (1476/2)
17. (00 00) Gold#3a
18. (00 00) Gold#3b

Code:
08C2F44F  00 01 02 04|53 6D 61 6C|6C 20 20 4C|69 66 65 20| .Small  Life
08C2F45F  50 6F 74 69|6F 6E 00 00|00 00 00 00|00 00 00 00| Potion..........
08C2F46F  00 00 00 00|50 4C 31 30|31                       ....PL101
19. (00 01 02 04) ID#4 : PL101
20. (E2 02 00 00) Rate#4 : 738 (1476/2)
21. (00 00) Gold#4a
22. (00 00) Gold#4b

Code:
08BE5027  00 01 01 01|53 74 6F 6E|65 20 41 78|65 00 00 00| .Stone Axe...
08BE5037  00 00 00 00|00 00 00 00|00 00 00 00|00 00 00 00| ................
08BE5047  00 00 00 00|57 41 31 30|31                       ....WA101
23. (00 01 01 01) ID#5 : WA101
24. (62 00 00 00) Rate#5 : 98 (492/5)
25. (00 00) Gold#5a
26. (00 00) Gold#5b

Code:
08BEAC7F  00 01 03 01|43 6C 75 62|00 00 00 00|00 00 00 00| .Club........
08BEAC8F  00 00 00 00|00 00 00 00|00 00 00 00|00 00 00 00| ................
08BEAC9F  00 00 00 00|57 48 31 30|31                       ....WH101
27. (00 01 03 01) ID#6 : WH101
28. (62 00 00 00) Rate#6 : 98 (492/5)
29. (00 00) Gold#6a
30. (00 00) Gold#6b

Code:
08BF0EFF  00 01 05 01|50 6F 6C 65|00 00 00 00|00 00 00 00| .Pole........
08BF0F0F  00 00 00 00|00 00 00 00|00 00 00 00|00 00 00 00| ................
08BF0F1F  00 00 00 00|57 50 31 30|31                       ....WP101
31. (00 01 05 01) ID#7 : WP101
32. (62 00 00 00) Rate#7 : 98 (492/5)
33. (00 00) Gold#7a
34. (00 00) Gold#7b

Code:
08BFABFB  00 01 08 01|4A 61 76 65|6C 69 6E 00|00 00 00 00| .Javelin.....
08BFAC0B  00 00 00 00|00 00 00 00|00 00 00 00|00 00 00 00| ................
08BFAC1B  00 00 00 00|57 54 31 30|31                       ....WT101
35. (00 01 08 01) ID#8 : WT101
36. (62 00 00 00) Rate#8 : 98 (492/5)
27. (00 00) Gold#8a
38. (00 00) Gold#8b

Code:
08C356CF  00 01 02 08|C8 A3 C7 C7|09 20 20 20|20 20 20 20| .?.
08C356DF  20 20 20 00|00 00 00 00|00 00 00 00|00 00 00 00|    .............
08C356EF  00 00 00 00|47 50 31 30|31                       ....GP101
39. (00 01 02 08) ID#9 : GP101
40. (62 00 00 00) Rate#9 : 98 (492/5)
41. (00 00) Gold#9a
42. (00 00) Gold#9b

Code:
08C356CF  00 01 02 08|C8 A3 C7 C7|09 20 20 20|20 20 20 20| .?.
08C356DF  20 20 20 00|00 00 00 00|00 00 00 00|00 00 00 00|    .............
08C356EF  00 00 00 00|47 50 31 30|31                       ....GP101
43. (00 01 02 08) ID#10 : GP101
44. (31 00 00 00) Rate#10 : 49 (246/5)
45. (00 00) Gold#10a
46. (00 00) Gold#10b

Code:
08C356CF  00 01 02 08|C8 A3 C7 C7|09 20 20 20|20 20 20 20| .?.
08C356DF  20 20 20 00|00 00 00 00|00 00 00 00|00 00 00 00|    .............
08C356EF  00 00 00 00|47 50 31 30|31                       ....GP101
47. (00 01 02 08) ID#11 : GP101
48. (31 00 00 00) Rate#11 : 49 (246/5)
49. (00 00) Gold#11a
50. (00 00) Gold#11b

[...]

Here's a case where the line rate is 10, and we have 11 elements in the line:
Code:
*¾ÆÀÌÅÛ		10		gp102	gp102	gp102	gp102	gp102	gp102	gp102	gp102	gp102	gp102	gp102

Code:
2F030200                          00 02 02 08|00 00 00 00|         .....
2F030210  00 00 00 00|00 02 02 08|00 00 00 00|00 00 00 00| .............
2F030220  00 02 02 08|00 00 00 00|00 00 00 00|00 02 02 08| ..........
2F030230  00 00 00 00|00 00 00 00|00 02 02 08|00 00 00 00| .............
2F030240  00 00 00 00|00 02 02 08|00 00 00 00|00 00 00 00| .............
2F030250  00 02 02 08|00 00 00 00|00 00 00 00|00 02 02 08| ..........
2F030260  00 00 00 00|00 00 00 00|00 02 02 08|00 00 00 00| .............
2F030270  00 00 00 00|00 02 02 08|00 00 00 00|00 00 00 00| .............
2F030280  00 02 02 08|00 00 00 00|00 00 00 00|             .........

51. The drop rate value is the floor value. Here each rate was below 1 causing all the lines drop rate to be 0.

Here's a case of a ridiculously long line :
Code:
*¾ÆÀÌÅÛ		1		gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103	gp103

The server actually crashed on that one.
Code:
0088BAE0  2A BE C6 C0|CC C5 DB 09|09 31 09 09|67 70 31 30| *..1..gp10
0088BAF0  33 09 67 70|31 30 33 09|67 70 31 30|33 09 67 70| 3.gp103.gp103.gp
0088BB00  31 30 33 09|67 70 31 30|33 09 67 70|31 30 33 09| 103.gp103.gp103.
0088BB10  67 70 31 30|33 09 67 70|31 30 33 09|67 70 31 30| gp103.gp103.gp10
0088BB20  33 09 67 70|31 30 33 09|67 70 31 30|33 09 67 70| 3.gp103.gp103.gp
0088BB30  31 30 33 09|67 70 31 30|33 09 67 70|31 30 33 09| 103.gp103.gp103.
0088BB40  67 70 31 30|33 09 67 70|31 30 33 09|67 70 31 30| gp103.gp103.gp10
0088BB50  33 09 67 70|31 30 33 09|67 70 31 30|33 09 67 70| 3.gp103.gp103.gp
0088BB60  31 30 33 09|67 70 31 30|33 09 67 70|31 30 33 09| 103.gp103.gp103.
0088BB70  67 70 31 30|33 09 67 70|31 30 33 09|67 70 31 30| gp103.gp103.gp10
0088BB80  33 09 67 70|31 30 33 09|67 70 31 30|33 09 67 70| 3.gp103.gp103.gp
0088BB90  31 30 33 09|67 70 31 30|33 09 67 70|31 30 33 09| 103.gp103.gp103.
0088BBA0  67 70 31 30|33 09 67 70|31 30 33 09|67 70 31 30| gp103.gp103.gp10
0088BBB0  33 09 67 70|31 30 33 09|67 70 31 30|33 09 67 70| 3.gp103.gp103.gp
0088BBC0  31 30 33 09|67 70 31 30|33 09 67 70|31 30 33 09| 103.gp103.gp103.
0088BBD0  67 70 31 30|33 09 67 70|31 30 33 09|67 70 00     gp103.gp103.gp.

52. The size of a line buffer is 255 characters.

So what did we learn ?

1. The server do save the value of the sum. Is it used after to calculate the percentage ?
Experience showed that a sum of 10000 was working better than random numbers. But who knows, maybe just our imagination ?
2. That's the number of drops configured in the file.
11-14. Drops are saved as 2 DWORDs + 2 WORDs : (ID, Rate, (Gold, Gold))
13-14. Gold being stored on a WORD. But I've seen negative gold ingame. Which means it's a signed WORD. Max gold value would be 32767.
16. Each item in the drop list ends up with its own drop rate. For a line, it's the rate divided by the number of real items in the line.
42-43. If the item doesn't exist (here WS999), it doesn't appear in the list
42-46. If a code appears twice, it will be counted twice.
51. Drop rate for line elements is FLOOR()d. You need value above 1 after the division, else nothing will drop from that line.
52. Don't use ridiculously long lines.

What else could be tested ?
a. If there's a limit of element per line (inside the buffer lenght). I haven't tested any further after crash.
b. If there's a limit of element per drop list.

And the official gibberish part of course !
a. Sub extracting the drop rates
Code:
00433430  /$ /8A08                   MOV CL,BYTE PTR DS:[EAX]                                                               ; server.00433430(guessed void)
00433432  |. |80F9 20                CMP CL,20
00433435  |. |74 05                  JE SHORT 0043343C
00433437  |. |80F9 09                CMP CL,9
0043343A  |. |75 03                  JNE SHORT 0043343F
0043343C  |> |40                     INC EAX
0043343D  |.^\EB F1                  JMP SHORT 00433430
0043343F  |>  8A08                   MOV CL,BYTE PTR DS:[EAX]
00433441  |.  80F9 20                CMP CL,20
00433444  |.  74 1B                  JE SHORT 00433461
00433446  |>  80F9 09                /CMP CL,9
00433449  |.  74 16                  |JE SHORT 00433461
0043344B  |.  80F9 0A                |CMP CL,0A
0043344E  |.  74 11                  |JE SHORT 00433461
00433450  |.  80F9 0D                |CMP CL,0D
00433453  |.  74 0C                  |JE SHORT 00433461
00433455  |.  880A                   |MOV BYTE PTR DS:[EDX],CL
00433457  |.  8A48 01                |MOV CL,BYTE PTR DS:[EAX+1]
0043345A  |.  42                     |INC EDX
0043345B  |.  40                     |INC EAX
0043345C  |.  80F9 20                |CMP CL,20
0043345F  |.^ 75 E5                  \JNE SHORT 00433446
00433461  |>  C602 00                MOV BYTE PTR DS:[EDX],0
00433464  \.  C3                     RETN

b. Instruction doing the rates sum
Code:
00438DB4  |.  019D 80000000          |ADD DWORD PTR SS:[EBP+80],EBX

c. Instruction copying the drop rate table each time a new monster is spawned
Code:
00559FA1  |.  F3:A5                  REP MOVS DWORD PTR ES:[EDI],DWORD PTR DS:[ESI]
 
Last edited:
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
Thanks Gregoo. You featured in my post because Moons mentioned you as the source of his information only.

As I say, his concise relay of your answer is "not wrong" but as Imri is arguing also not complete. Your full response in the post above, as predicted, is complete, and ends any further queries.

Other thing's I can surmise from your post is that the largest "total" (= 100%) is either 4294967295 or 2147483647 depending on whether that DWord is used as a signed DWord or a ULong.

I agree that 10,000 works better than random totals in my experience... but I haven't tried ensuring that they all total to 100,000,000 , which is well within the codes limits and provides much more fine grained control over the drop-rates of each line.

It also suggests that the only performance hit by separating each drop on a different line (thus totally negating the 255 character per line limit) would be in server start-up time, where the server is parsing the text file into it's binary store in memory. With the provision that you would have to divide each lines drop rate by the number of items you separated out from it.

Of course the monster files are read during the server "Initializing" phase, and that was the "official gibberish" provided. (which I love)For the sake of memory usage I'd like to see if I can stop it reading those text files at start-up, and the memory on hostile and re-write the routine to lookup the information from SQL rather than memory... But that's a job for another time.

Thanks again. :D:
 
Last edited:
Back
Top