Hello all,
I did not want to post in the Bugs section, in case this is not a bug. But, I have noticed a statistically significant difference between combat performance when clicking rapidly as opposed to clicking slowly. Obviously, it is easy enough to click slowly. However, these findings are indicative of a poor algorithm for random number generation. In other words, the random number generator is not actually producing random numbers. This is frequently the case with random number generators. In the long run, each number will appear an average number of times, but for the short term, the same number appears more often than different numbers. So, monsters with multiple attacks will tend to miss for all of their attacks if their first attack misses. They will tend to hit for all of their attacks if their first attack hits. They will tend to crit for all of their attacks if their first attack crits. This is not a certainty, but it will happen more often than it should (more often than if the random number generator were producing numbers more randomly. Of course, this is also a benefit to your character. If you have a low probability of hitting, clicking repeatedly and rapidly will give you statistically more successes than clicking slowly. Again, this is something that I have observed experimentally. I have no direct proof that this is the case. I only have a gut instinct that is telling me that my observed results are due to a bug with the random number generator. Anyone else experience something similar?
--Slip
v0.8.13 (Troubling Times) active on Google Play
Useful links
Source code of the game - Contribution guide - ATCS Editor - Translate the game on Weblate - Example walkthrough - Andor's Trail Directory - Join the Discord
Get the game (v0.8.13) from Google, Github, F-Droid, our server, or itch.io
Useful links
Source code of the game - Contribution guide - ATCS Editor - Translate the game on Weblate - Example walkthrough - Andor's Trail Directory - Join the Discord
Get the game (v0.8.13) from Google, Github, F-Droid, our server, or itch.io
Random Number Generator Bug?
-
- Posts: 25
- Joined: Mon Dec 24, 2012 11:44 pm
- android_version: 3.0
- Location: Binghamton University
- nyktos
- VIP
- Posts: 3463
- Joined: Wed Sep 14, 2011 5:38 pm
- android_version: 7.1 - Nougat
- Location: Nor City, Dhayavar
Re: Random Number Generator Bug?
a bug that i was about to post was...SlipEternal wrote:I have noticed a statistically significant difference between combat performance when clicking rapidly as opposed to clicking slowly.
when i tap quickly & die = Force Close
this is a new problem...
i didn't notice it until i made a new character & died a lot.
[more in a moment / kinda busy]
this is an open source game, do you know a better way to code it?SlipEternal wrote: ...these findings are indicative of a poor algorithm for random number generation.
my talents & skills are on the art / writing side,
so i can't really say much other than...
"i think you may be right?"

anyways, welcome to the forum!
it's always great to have more active members...
and thank you for your input!!!
we want to have the best game out there as possible!
(thanks to Oskar for starting this whole project)

"Embrace the Shadow"

[Lv: 60] [HP: 175] [AC: 361] [AD: 25-39] [BC: 75]
[Dual Wielding Swords] [Unarmored Fighting]

[Lv: 60] [HP: 175] [AC: 361] [AD: 25-39] [BC: 75]
[Dual Wielding Swords] [Unarmored Fighting]
-
- Posts: 180
- Joined: Wed Jun 13, 2012 1:38 am
- android_version: 2.2
Re: Random Number Generator Bug?
Slip,
After analyzing your well-written, grammatically correct paragraph, I realize that you are obviously very intelligent and well educated. I believe there is a good possibility that your analysis is correct as the more intelligent a person, the more accurate their foresight and reasoning skills. I also know that sometimes random number generators are not truly random at all (those of us who have extensively played fire emblem know this to be true). although I can not validate your suspicions with absolute certainty, looking back, I too notice the same patterns. I wonder if you have compiled any statistical data supporting your hypothesis as any true scientific mind never makes a claim without providing proof.
-x
After analyzing your well-written, grammatically correct paragraph, I realize that you are obviously very intelligent and well educated. I believe there is a good possibility that your analysis is correct as the more intelligent a person, the more accurate their foresight and reasoning skills. I also know that sometimes random number generators are not truly random at all (those of us who have extensively played fire emblem know this to be true). although I can not validate your suspicions with absolute certainty, looking back, I too notice the same patterns. I wonder if you have compiled any statistical data supporting your hypothesis as any true scientific mind never makes a claim without providing proof.
-x
-
- Site Admin
- Posts: 1187
- Joined: Fri Jan 28, 2011 10:17 pm
- android_version: 14 - Android 14
- Contact:
Re: Random Number Generator Bug?
I don't see the correlation between how fast you attack and "combat performance".
The program is doing very small (in computing terms) calculations to figure out the outcome of each and every attack. The fact is most smartphones could do millions if not billions of these calculations every second without issue. Also correlation does not imply causation.
More specific info about how we deal with combat can be found in our source.
The program is doing very small (in computing terms) calculations to figure out the outcome of each and every attack. The fact is most smartphones could do millions if not billions of these calculations every second without issue. Also correlation does not imply causation.
More specific info about how we deal with combat can be found in our source.
-
- Posts: 25
- Joined: Mon Dec 24, 2012 11:44 pm
- android_version: 3.0
- Location: Binghamton University
Re: Random Number Generator Bug?
Greetings Xero,Xero wrote:Slip,
After analyzing your well-written, grammatically correct paragraph, I realize that you are obviously very intelligent and well educated. I believe there is a good possibility that your analysis is correct as the more intelligent a person, the more accurate their foresight and reasoning skills. I also know that sometimes random number generators are not truly random at all (those of us who have extensively played fire emblem know this to be true). although I can not validate your suspicions with absolute certainty, looking back, I too notice the same patterns. I wonder if you have compiled any statistical data supporting your hypothesis as any true scientific mind never makes a claim without providing proof.
-x
Unfortunately, random number generation is not one of my fields of expertise. A quick search on Wikipedia mentions several algorithms with statistically appealing results. I have not generated any data on this. I was asking to see if anyone else experienced something similar before I even considered looking into it further. I am not convinced that my observations are correct. I have a hunch that if they are correct, it is a result of the random number generator not being truly random. One way to increase randomness is to manually seed the random number generator. Generate a sequence of random numbers (perhaps every second, one of the random numbers is replaced) and loop through that sequence (rather than using the standard seed of the system clock) to seed the random number generator. So, if you have 20 random seeds, you will not loop through the entire sequence during a single combat round, possibly achieving the randomness desired.
I apologize. The confusion is my fault. I did not specify that in preferences, I set "Combat speed" to "Instant (no animations)". Hence, the speed of my attacks is really limited by how quickly I can tap the screen. When I tap the screen in very rapid succession, I can usually slice through several enemies in relatively little time. However, I also notice that occasionally, I will go through three or four combat rounds (making five attacks per round, all of them missing) against enemies with just enough hit points to be one-shotted. Obviously, statistically, this will happen from time to time. But I find that when I do not mash the screen, it happens extremely rarely, whereas when I do mash the screen, it happens with noticeable frequency. Given the statistical improbability that fifteen hits will all miss when I have approximately an 80-90% chance to hit (246 attack vs. 30 block), I should experience a full combat round with zero hits approximately every 100,000 creatures I fight. So, experiencing it five or six times in a 30-minute period may be a case of an extreme outlier (where the random number generation method works perfectly, and I had a streak of bad luck). Or, it may be the case that the random number generator is seeded by the system clock, which is measured in milliseconds. I do not know how cell phones process rapid taps on the screen. Nor do I know how your code generates the random numbers for attack (whether the attack is a success or a failure). For all I know, multiple taps in rapid succession may pull random numbers that are seeded with the same timestamp, even if the taps themselves did not occur at the same millisecond. I have noticed that I fare significantly better in combat when I do not tap rapidly on the screen. Going back and forth between tapping rapidly and tapping slowly with decreased combat performance during rapid tapping and increased performance otherwise may very well be coincidence. Once a pattern is observed, the mind frequently seeks out that pattern. So, rather than spend a great deal of time trying to gather data to correlate the speed in which I tap on the screen and my character's combat performance, I thought I would ask to see if others experienced anything similar.sdevaney wrote:I don't see the correlation between how fast you attack and "combat performance".
The program is doing very small (in computing terms) calculations to figure out the outcome of each and every attack. The fact is most smartphones could do millions if not billions of these calculations every second without issue. Also correlation does not imply causation.
More specific info about how we deal with combat can be found in our source.
-
- VIP
- Posts: 1353
- Joined: Tue Feb 08, 2011 7:05 am
- android_version: 7.0
Re: Random Number Generator Bug?
Timestamp seeding should only be done once at the beginning of the program, if coded correctly. After that, the ”pseudorandom” number generation should follow its cycle regardless of frequency of the calls, at least in any language I've used. Don't know the details in Java specifically, but the code can be checked to see how seeding is done.
Norbert
Lvl:52 XP:2597576 AP:12 HP:124 AC:282 AD:30-42 CHS:27 CM:2.0 ECC:18% BC:132 DR:2
Skills: CS:2 IF:2 Ev:3 Rg:1 DgPro:1 1HPro:2 LtAPro:2 FS-DW:2 Sp-DW:1
Equip: FP BSS JoF RoP PRoB SrpHbk GoLF EnhCH EnhCB
Other: DotSP VD GoW FB TG RoD+6 Oegyth:6
Lvl:52 XP:2597576 AP:12 HP:124 AC:282 AD:30-42 CHS:27 CM:2.0 ECC:18% BC:132 DR:2
Skills: CS:2 IF:2 Ev:3 Rg:1 DgPro:1 1HPro:2 LtAPro:2 FS-DW:2 Sp-DW:1
Equip: FP BSS JoF RoP PRoB SrpHbk GoLF EnhCH EnhCB
Other: DotSP VD GoW FB TG RoD+6 Oegyth:6