![]() ![]() What TWings said about the perception of randomness by a human vs reality. If what you're seeing in your testing experience is contradictory to the hard numbers and the math, then either:ġ. Close enough beyond the ability of a human to anecdotally tell it was imperfect. If (missRandom < missChanceHigh) missCountHigh++ Ĭonsole.log("Actual % miss for estimated 1% chance (1 million trials): ", missCountLow / trials * 100) Ĭonsole.log("Actual % miss for estimated 5% chance (1 million trials): ", missCountHigh / trials * 100) For me, on Firefox, I got 0.98% for the first one and 5.01% for the second one. If (missRandom < missChanceLow) missCountLow++ So if you do something more complex than a random counter or check and find an unexpected probability there, then you should doublecheck your own mathematics and coding before assuming that the random function itself went wrong.Ĭonst missRandom = Math.random() * 10000 A lot of people that only guessed how it should be done instead implemented a recursive loop that destroyed randomness. Unfortunately that is often a bad idea, because you need to know exactly what you do to really improve randomness. Some people try to improve the existing random generators by manipulating the results through additional formula. Same goes with 99.5% to hit - simply say it always hits instead of creating lag by high percantage checks. Has been done before, and the ****storm wasn't nice. However any game that really uses such extreme probabilities is broken in my opinion - just check the internet on what gamers had to say about grinding for a weapon required to win that had a loot rate of 0.1%. You can detect this by making hundreds of tests against 99.5% - you won't find much errors when checking 50%-options. Random generators are geared toward the middle, their errors are with the extreme border values. I haven't tested this specific case, but they had to do a really terrible job to make the random generator go wrong, unless it is one of two very specific cases that are in your implementation rather than in the original algorithm. The existing algorithms do a relatively good job of simulating randomness. I don't think that RPG Maker offers this, though. GameMaker Studio, for instance, has a randomise() function that sets the seed randomly, making your subsequent RNG draws much less consistent. Some engines do allow you to randomize the seed the RNG works from (or to set it manually if you do want consistent behavior in playtesting).If there was a REALLY pressing need for a truly random number, such as an in-game lottery in a massively multiplayer project I made, I would probably try to run a call to which combines a computer's RNG with atmospheric noise to achieve true randomness.I would probably change the stored float up every once in a while as well. I'd use this final number (the 0.5856.) to make any comparisons I needed in the game's processing, like a check whether a random is between 0.5 and 0.6. This is the two floats added together, BUT numbers are never carried (for example the 9 + 7 becomes 6, not 16), so each digit is independent and "random". and the new number chosen was 0.235741536. For example, if the stored number was 0.350909780. An even greater level of randomization could probably be achieved by storing a random float very early in the game - after it starts but before I need a random number for any other purpose - and then whenever I take a random number (like Math.random() in a larger method), I'd run it through a special method that would add or subtract each important digit of the stored float from each digit in the new random number, to create an even more random number that I'd actually use for whatever purpose.But if I had to achieve true(r) randomness, there are a few things I might try: And in the same breath, I'd be really curious where you have seen this lack of randomness actually show up in your playtests. So I guess the short answer is " I don't". In my own game (for Ace rather than MV) I randomize the setup to a lot of mini-games, and I haven't found any kind of patterns or consistencies developing that suggest the "pseudo-random" numbers that computers generate is inadequate for use in my game.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |