lioran 2 Posted May 17, 2015 (edited) Ok I know how people react when you start talking about RNG and such. people say its luck and all but this can be tested by devs. So I started to notice weird things when I moved to hercules. Bunch of stuff that just make you go "damn that's bad luck"... or is it? Here are a few occurrences . cases 1 killed 40 monster and not getting its 25% drop 40 times in a row . If you do that math it comes down to 1 out of 99437 to happen. cases 3 killing 15,000 of a monster on a x5 rate server not getting a single card (multiple case of that in a short span of time for a lot of people) cases 2 Getting 3 cards on a x5 rate server in 10 kills (you calculate that on your own) So now with that being said. Most people would be incline to say "well that's just bad luck". Problem here is not that it happened...the problem is that it happened to several people in a short amount of time on a small community. Saw it happening a bunch of time on a low population server(100+) in a short amount of time and now seeing it happen on a big population server(700+) repeatedly. If you do the math just getting no card after 15000 on a x5 server is about 1 out of 1811 occurence. (0.9995^15000) So once in a while you expect it to happen. but not multiple time in a really short period of time that's just absurd. Even it just happening twice in your entire life is absurd. (more number crunch 1 out 3,281,303 to happen twice in a row but hunting 15000 takes alot of time) I heard that the RNG seed used for drop takes character ID, process ID, and clock. My question is this... Why would you ever include a number that never changes in a Random number generator seed. I don't know if that's the problem but there is obviously something wrong here. I know I would never host a server with a RNG like that. So it would be good to look into that, run tests to try different IDs. See if some IDs are more bias toward small number vs big numbers. It is NOT RNG if the seed is bias toward certain numbers. This post is not to start argument... this is just to try to get someone to check maybe whats wrong. I have some programming knowledge but not enough to dive into this. Edited May 17, 2015 by lioran Quote Share this post Link to post Share on other sites
Haru 290 Posted June 16, 2015 Hello. I apologize for replying after a month, but it was jsut brought to my attention, and since there were no replies during this time, I feel I should. Your maths is absolutely correct, and one could think it is indeed quite weird to see that happening. Your statements about the RNG are absolutely incorrect though. You claim that we use (among other things) the character ID to seed the PRNG. This would make it sound like we use a different RNG for each character (and that we only use random numbers for character-related things). We don't. The RNG is one and only one, and it is not attached to the current character, nor it uses any character identifiers or any kind (or even knows what a character is). The very same RNG is used by the server for all sorts of calculations in-between the item drops you mention (from mob walk direction and distance, to damage calculation during attacks, to teleport or mob spawn destinations or skill success chance. There are so many calls to the RNG between two mob drops, that it would be impossible to find any correlation or pattern just by observing the game. Now, while the RNG we're using isn't perfect, it's still renown as one of the best for use cases like ours. We're using a Mersenne Twister (specifically, the mt19937ar implementation by Matsumoto Makoto (http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html). As stated by the author, there are better versions of it now (we're going to switch to the SFMT implementation, which is faster and resolves some issues in case the RNG isn't initially well seeded, as soon as possible - we need to verify that it is supported by all compilers we currently target.) This said, I've personally tested the current RNG several times, and never seen anything that makes me think it's broken. I'm attaching some test results, that show how the distribution of generated numbers (I generated numbers in the [0~9999] range, since that's what we use mostly in Hercules) looks pretty good and unbiased. All the tests were done with the following code (pasted at the end of the do_init function in map.c): #define TEST_COUNT 1000000#define NORMALIZE 10000 int64 buckets[NORMALIZE]; memset(buckets, '0', sizeof(buckets)); for (i = 0; i < TEST_COUNT; ++i) { int num = rnd()%NORMALIZE; ++buckets[num]; } FILE *fp = fopen("rng.txt", "w"); for (i = 0; i < NORMALIZE; ++i) { fprintf(fp, "]: %5"PRId64" (%2.3f%%)n", i, buckets[i], buckets[i]*100.0/TEST_COUNT); } fclose(fp);and compiled with the following hardware/software, as reported by Hercules itself:[Info]: Hercules 64-bit for Mac OS X[Info]: Git revision (src): '9a0b3ad4fb551028f593500698dd560f85cdda6c'[Info]: Git revision (scripts): '9a0b3ad4fb551028f593500698dd560f85cdda6c'[Info]: OS version: 'Mac OS X 10.10.3 14D136 [x86_64]'[Info]: CPU: 'Intel Core i5 (2.3 GHz) [2]'[Info]: Compiled with Clang v6.1.0[Info]: Compile Flags: -g -O2 -pipe -ffast-math -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wempty-body -Wnewline-eof -Wint-conversion -Wenum-conversion -Wshorten-64-to-32 -Wconstant-conversion -Wbool-conversion -Wformat-security -Wno-format-nonliteral -Wno-switch -Wno-missing-field-initializers -Wshadow -fno-strict-aliasing -ggdb -DMAXCONN=16384 -I../common -DHAS_TLS -DHAVE_SETRLIMIT -DHAVE_STRNLEN -DDEBUG -DDISABLE_RENEWAL -I/usr/includeThe tests show the distribution of, respectively, the first million, hundred millions, billion, ten thousands random numbers after server startup. http://jmp.sh/V12VZ7I 1,000,000 http://jmp.sh/pigjlRT 100,000,000 http://jmp.sh/NU8SigY 1,000,000,000 http://jmp.sh/R8a3lCF 10,000 As you can see, each of the possible values is generated about 0.01% times (1/10,000), without any visible bias. 1 Nebraskka reacted to this Quote Share this post Link to post Share on other sites
memoryss 0 Posted June 17, 2015 how can i use rnd in plugin? Quote Share this post Link to post Share on other sites
Haru 290 Posted June 17, 2015 Right now you can't (unless you bring your own implementation). Since I'm currently working on a large batch of fixes for the HPM, I'll add this as well. 1 Nebraskka reacted to this Quote Share this post Link to post Share on other sites
memoryss 0 Posted June 17, 2015 Right now you can't (unless you bring your own implementation). Since I'm currently working on a large batch of fixes for the HPM, I'll add this as well. I thought hercules has been dead when i heard ind's leaving. really hope you guys can bring hercules to another peak. Quote Share this post Link to post Share on other sites
EnRage 0 Posted June 19, 2015 (edited) Edit:// was wrong, nevermind Edited June 19, 2015 by EnRage Quote Share this post Link to post Share on other sites
hemagx 69 Posted June 24, 2015 i believe we should record the killing and drops like some other games i played does, it may be haivy but it will be more fair so always a 25% item will drop once each 4 kills for example. Right now you can't (unless you bring your own implementation).Since I'm currently working on a large batch of fixes for the HPM, I'll add this as well. I thought hercules has been dead when i heard ind's leaving. really hope you guys can bring hercules to another peak. Ind was great and still great, but he never could do it alone with lot of help of all hercules staff and suporters and his extremly good coding skills he could do lot of good stuff so hercules will never die when he leave, it's about the whole community die i don't use hercules or Athena in general anymore however i still support and love Hercules *kisses* Quote Share this post Link to post Share on other sites
memoryss 0 Posted June 24, 2015 i believe we should record the killing and drops like some other games i played does, it may be haivy but it will be more fair so always a 25% item will drop once each 4 kills for example. Right now you can't (unless you bring your own implementation). Since I'm currently working on a large batch of fixes for the HPM, I'll add this as well. I thought hercules has been dead when i heard ind's leaving. really hope you guys can bring hercules to another peak. Ind was great and still great, but he never could do it alone with lot of help of all hercules staff and suporters and his extremly good coding skills he could do lot of good stuff so hercules will never die when he leave, it's about the whole community die i don't use hercules or Athena in general anymore however i still support and love Hercules *kisses* what emulator are u using now? Quote Share this post Link to post Share on other sites
evilpuncker 503 Posted June 24, 2015 @@memoryss my bet is that he left RO world Quote Share this post Link to post Share on other sites
hemagx 69 Posted June 24, 2015 i believe we should record the killing and drops like some other games i played does, it may be haivy but it will be more fair so always a 25% item will drop once each 4 kills for example. Right now you can't (unless you bring your own implementation). Since I'm currently working on a large batch of fixes for the HPM, I'll add this as well. I thought hercules has been dead when i heard ind's leaving. really hope you guys can bring hercules to another peak. Ind was great and still great, but he never could do it alone with lot of help of all hercules staff and suporters and his extremly good coding skills he could do lot of good stuff so hercules will never die when he leave, it's about the whole community die i don't use hercules or Athena in general anymore however i still support and love Hercules *kisses* what emulator are u using now? using Aegis ~ PS: sorry for huge mistakes in my comment still not used to my laptop keyboard q_q Quote Share this post Link to post Share on other sites
banhelba2019 20 Posted April 26, 2018 my favorite thing about Ragnarok is having 95% flee and your still getting hit like half the time 1v1 lol 1 bWolfie reacted to this Quote Share this post Link to post Share on other sites
bWolfie 138 Posted April 27, 2018 9 hours ago, lllaaazzz said: my favorite thing about Ragnarok is having 95% flee and your still getting hit like half the time 1v1 lol I wonder how you guys find these old posts. Quote Share this post Link to post Share on other sites